https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse
(v)
| 462 | |
| 463 | |
| 464 | def str2bool(v): |
| 465 | """ |
| 466 | https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse |
| 467 | """ |
| 468 | if isinstance(v, bool): |
| 469 | return v |
| 470 | if v.lower() in ("yes", "true", "t", "y", "1"): |
| 471 | return True |
| 472 | elif v.lower() in ("no", "false", "f", "n", "0"): |
| 473 | return False |
| 474 | else: |
| 475 | raise argparse.ArgumentTypeError("boolean value expected") |
nothing calls this directly
no outgoing calls
no test coverage detected