MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / env_is_truthy

Function env_is_truthy

misc/python/materialize/ui.py:152–157  ·  view source on GitHub ↗

Return true if `env_var` is set and is not one of: 0, '', no, false

(env_var: str, default: str = "0")

Source from the content-addressed store, hash-verified

150
151
152def env_is_truthy(env_var: str, default: str = "0") -> bool:
153 """Return true if `env_var` is set and is not one of: 0, '', no, false"""
154 env = os.getenv(env_var, default)
155 if env is not None:
156 return env not in ("", "0", "no", "false")
157 return False
158
159
160class UIError(Exception):

Callers 2

init_from_envMethod · 0.85
log_in_automationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected