(model_list)
| 49 | print(f"Download failed with status code {response.status_code}") |
| 50 | |
| 51 | def get_user_choice(model_list): |
| 52 | # Print the enumerated list |
| 53 | print("\n") |
| 54 | for i, (model_id, rfilename) in enumerate(model_list): |
| 55 | print(f"{i+1}: Model ID: {model_id}, RFilename: {rfilename}") |
| 56 | |
| 57 | # Get user's choice |
| 58 | choice = input("Choose a model to download by entering the corresponding number: ") |
| 59 | try: |
| 60 | index = int(choice) - 1 |
| 61 | if 0 <= index < len(model_list): |
| 62 | # Return the chosen model |
| 63 | return model_list[index] |
| 64 | else: |
| 65 | print("Invalid choice.") |
| 66 | except ValueError: |
| 67 | print("Invalid input. Please enter a number corresponding to a model.") |
| 68 | except IndexError: |
| 69 | print("Invalid choice. Index out of range.") |
| 70 | |
| 71 | return None |
| 72 | |
| 73 | def main(): |
| 74 | # Create an argument parser |
no outgoing calls
no test coverage detected
searching dependent graphs…