MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / str2bool

Function str2bool

leaderboard/leaderboard/leaderboard_evaluator.py:43–51  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

41from leaderboard.utils.route_indexer import RouteIndexer
42
43def str2bool(v):
44 if isinstance(v, bool):
45 return v
46 if v.lower() in ('yes', 'true', 't', 'y', '1'):
47 return True
48 elif v.lower() in ('no', 'false', 'f', 'n', '0'):
49 return False
50 else:
51 raise argparse.ArgumentTypeError('Boolean value expected.')
52
53sensors_to_icons = {
54 'sensor.camera.rgb': 'carla_camera',

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected