MCPcopy Create free account
hub / github.com/Dizzy-K/AutoPT / _coerce_bool

Function _coerce_bool

config/loader.py:43–50  ·  view source on GitHub ↗
(value: Any, default: bool = False)

Source from the content-addressed store, hash-verified

41
42
43def _coerce_bool(value: Any, default: bool = False) -> bool:
44 if value is None:
45 return default
46 if isinstance(value, bool):
47 return value
48 if isinstance(value, str):
49 return value.strip().lower() in {"1", "true", "yes", "on"}
50 return bool(value)
51
52
53def _as_mapping(value: Any) -> Mapping[str, Any]:

Callers 2

_build_workflowFunction · 0.85
_build_optimizationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected