MCPcopy Create free account
hub / github.com/FinancialComputingUCL/LOBFrame / str2bool

Function str2bool

utils.py:386–394  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

384
385
386def str2bool(v):
387 if isinstance(v, bool):
388 return v
389 if v.lower() in ('yes', 'true', 't', 'y', '1'):
390 return True
391 elif v.lower() in ('no', 'false', 'f', 'n', '0'):
392 return False
393 else:
394 raise argparse.ArgumentTypeError('Boolean value expected.')
395
396
397def parse_args() -> Any:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected