MCPcopy Index your code
hub / github.com/usestrix/strix / _float_stat

Function _float_stat

strix/interface/utils.py:259–264  ·  view source on GitHub ↗
(usage: dict[str, Any], key: str)

Source from the content-addressed store, hash-verified

257
258
259def _float_stat(usage: dict[str, Any], key: str) -> float:
260 try:
261 value = float(usage.get(key) or 0.0)
262 except (TypeError, ValueError):
263 return 0.0
264 return value if value > 0 else 0.0
265
266
267def _detail_value(usage: dict[str, Any], detail_key: str, value_key: str) -> int:

Callers 2

_build_llm_usage_statsFunction · 0.85
build_tui_stats_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected