(usage: dict[str, Any], key: str)
| 257 | |
| 258 | |
| 259 | def _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 | |
| 267 | def _detail_value(usage: dict[str, Any], detail_key: str, value_key: str) -> int: |
no outgoing calls
no test coverage detected