Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
19
def
string_to_bool(env_str):
20
if
env_str.lower() in (
"1"
,
"true"
,
"yes"
,
"on"
,
"y"
):
21
return
True
22
return
False
23
24
25
def
parse_boolean_from_env(env_var, defalut_value):
Callers
1
parse_boolean_from_env
Function · 0.85
Calls
1
lower
Method · 0.45
Tested by
no test coverage detected