MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / string_to_bool

Function string_to_bool

python/oneflow/support/env_var_util.py:19–22  ·  view source on GitHub ↗
(env_str)

Source from the content-addressed store, hash-verified

17
18
19def string_to_bool(env_str):
20 if env_str.lower() in ("1", "true", "yes", "on", "y"):
21 return True
22 return False
23
24
25def parse_boolean_from_env(env_var, defalut_value):

Callers 1

parse_boolean_from_envFunction · 0.85

Calls 1

lowerMethod · 0.45

Tested by

no test coverage detected