MCPcopy Create free account
hub / github.com/ZyphrZero/z.ai2api_python / normalize_trend_window

Function normalize_trend_window

app/admin/stats.py:51–58  ·  view source on GitHub ↗

规范化趋势窗口参数,非法值回退到默认值。

(value: Any)

Source from the content-addressed store, hash-verified

49
50
51def normalize_trend_window(value: Any) -> str:
52 """规范化趋势窗口参数,非法值回退到默认值。"""
53 normalized = str(value or "").strip().lower()
54 if normalized in {"24h", "7d", "30d"}:
55 return normalized
56 if normalized == "1d":
57 return "24h"
58 return DEFAULT_TREND_WINDOW
59
60
61def format_uptime(total_seconds: int) -> str:

Callers 2

collect_admin_statsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected