MCPcopy Create free account
hub / github.com/apple/ml-pointersect / str2bool

Function str2bool

cdslib/core/utils/argparse_utils.py:17–25  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

15
16
17def str2bool(v):
18 if v.lower() in ("yes", "true", "t", "y", "1"):
19 return True
20 elif v.lower() in ("no", "false", "f", "n", "0"):
21 return False
22 elif v.lower() == "none":
23 return None
24 else:
25 raise argparse.ArgumentTypeError("Boolean value expected.")
26
27
28def read_config_file(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected