MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / _str2bool

Function _str2bool

dm_control/mjcf/schema.py:57–70  ·  view source on GitHub ↗

Converts either 'true' or 'false' (not case-sensitively) into a boolean.

(string)

Source from the content-addressed store, hash-verified

55
56
57def _str2bool(string):
58 """Converts either 'true' or 'false' (not case-sensitively) into a boolean."""
59 if string is None:
60 return False
61 else:
62 string = string.lower()
63
64 if string == 'true':
65 return True
66 elif string == 'false':
67 return False
68 else:
69 raise ValueError(
70 'String should either be `true` or `false`: got {}'.format(string))
71
72
73def parse_schema(schema_path):

Callers 2

_parse_elementFunction · 0.85
_parse_attributeFunction · 0.85

Calls 1

lowerMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…