MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _env_int

Function _env_int

agents/reading-agent/main.py:179–185  ·  view source on GitHub ↗
(name: str, default: int, *, minimum: int = 1, maximum: int = 16)

Source from the content-addressed store, hash-verified

177 return default
178 return raw.strip().lower() not in {"0", "false", "off", "no", ""}
179
180
181def _env_int(name: str, default: int, *, minimum: int = 1, maximum: int = 16) -> int:
182 raw = os.environ.get(name, "").strip()
183 try:
184 value = int(raw) if raw else int(default)
185 except (TypeError, ValueError):
186 value = int(default)
187 return max(minimum, min(maximum, value))
188

Callers 1

Calls 1

getMethod · 0.80

Tested by

no test coverage detected