4 def bool_type(value: str) -> bool:
5 """Helper function for argparse (string to bool conversion)."""
7 if value in ['1', 'true', 't', 'yes', 'y']:
9 if value in ['0', 'false', 'f', 'no', 'n']:
11 raise argparse.ArgumentTypeError(f'"{value}" could not be converted to bool.')