Parse a comma-separated ID list string into a list of integers.
(ids_str: Optional[str])
| 35 | |
| 36 | |
| 37 | def parse_ids(ids_str: Optional[str]) -> Optional[list[int]]: |
| 38 | """Parse a comma-separated ID list string into a list of integers.""" |
| 39 | if not ids_str: |
| 40 | return None |
| 41 | try: |
| 42 | return [int(x.strip()) for x in ids_str.split(",")] |
| 43 | except ValueError: |
| 44 | raise ValueError(f"Invalid ID list format: {ids_str}") |
| 45 | |
| 46 | |
| 47 | def add_llm_args(parser: argparse.ArgumentParser, prefix: str = "") -> None: |
no outgoing calls
no test coverage detected