Spaces:
Sleeping
Sleeping
Download core/analytics.py from GodsDevProject/FOIA_Doc_Search: direct link, hf CLI and curl.
- Browser
- Download file 221 Bytes
-
https://huggingface.co/spaces/GodsDevProject/FOIA_Doc_Search/resolve/main/core/analytics.py
- Command line
-
hf download hf://spaces/GodsDevProject/FOIA_Doc_Search/core/analytics.py
-
curl -L -o analytics.py https://huggingface.co/spaces/GodsDevProject/FOIA_Doc_Search/resolve/main/core/analytics.py
221 Bytes
| import time | |
| from collections import Counter | |
| _events = Counter() | |
| def track(event: str): | |
| _events[event] += 1 | |
| def snapshot(): | |
| return { | |
| "timestamp": int(time.time()), | |
| "events": dict(_events) | |
| } | |