(parser, default_dict)
| 269 | |
| 270 | |
| 271 | def add_dict_to_argparser(parser, default_dict): |
| 272 | for k, v in default_dict.items(): |
| 273 | v_type = type(v) |
| 274 | if v is None: |
| 275 | v_type = str |
| 276 | elif isinstance(v, bool): |
| 277 | v_type = str2bool |
| 278 | parser.add_argument(f"--{k}", default=v, type=v_type) |
| 279 | |
| 280 | |
| 281 | def args_to_dict(args, keys): |
no outgoing calls
no test coverage detected