MCPcopy Create free account
hub / github.com/JMoonr/LATR / str2bool

Function str2bool

utils/utils.py:294–300  ·  view source on GitHub ↗
(argument)

Source from the content-addressed store, hash-verified

292
293# trick from stackoverflow
294def str2bool(argument):
295 if argument.lower() in ('yes', 'true', 't', 'y', '1'):
296 return True
297 elif argument.lower() in ('no', 'false', 'f', 'n', '0'):
298 return False
299 else:
300 raise argparse.ArgumentTypeError('Wrong argument in argparse, should be a boolean')
301
302
303class Logger(object):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected