Download inference/core/active_learning/utils.py from ftopal/OMG: direct link, hf CLI and curl.
- Browser
- Download file 458 Bytes
-
https://huggingface.co/spaces/ftopal/OMG/resolve/main/inference/core/active_learning/utils.py
- Command line
-
hf download hf://spaces/ftopal/OMG/inference/core/active_learning/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/ftopal/OMG/resolve/main/inference/core/active_learning/utils.py
458 Bytes
| from datetime import datetime, timedelta | |
| TIMESTAMP_FORMAT = "%Y_%m_%d" | |
| def generate_today_timestamp() -> str: | |
| return datetime.today().strftime(TIMESTAMP_FORMAT) | |
| def generate_start_timestamp_for_this_week() -> str: | |
| today = datetime.today() | |
| return (today - timedelta(days=today.weekday())).strftime(TIMESTAMP_FORMAT) | |
| def generate_start_timestamp_for_this_month() -> str: | |
| return datetime.today().replace(day=1).strftime(TIMESTAMP_FORMAT) | |