(parser, default_dict)
| 425 | |
| 426 | |
| 427 | def add_dict_to_argparser(parser, default_dict): |
| 428 | for k, v in default_dict.items(): |
| 429 | v_type = type(v) |
| 430 | if v is None: |
| 431 | v_type = str |
| 432 | elif isinstance(v, bool): |
| 433 | v_type = str2bool |
| 434 | parser.add_argument(f"--{k}", default=v, type=v_type) |
| 435 | |
| 436 | |
| 437 | def args_to_dict(args, keys): |
no outgoing calls
no test coverage detected