Spaces:
Paused
Paused
Download scratch/list_rules.py from 3SCError404/miracle: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/spaces/3SCError404/miracle/resolve/main/scratch/list_rules.py
- Command line
-
hf download hf://spaces/3SCError404/miracle/scratch/list_rules.py
-
curl -L -o list_rules.py https://huggingface.co/spaces/3SCError404/miracle/resolve/main/scratch/list_rules.py
643 Bytes
| import asyncio | |
| import os | |
| import sys | |
| if sys.platform == 'win32': | |
| asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) | |
| sys.path.append(os.getcwd()) | |
| from sqlalchemy import select | |
| from core.database import async_session_factory | |
| from models.escalation_rule import EscalationRule | |
| async def list_rules(): | |
| async with async_session_factory() as db: | |
| res = await db.execute(select(EscalationRule)) | |
| for r in res.scalars().all(): | |
| print(f"WS: {r.workspace_id} | Name: {r.name} | Level: {r.priority_level} | Thresh: {r.threshold_minutes}") | |
| if __name__ == '__main__': | |
| asyncio.run(list_rules()) | |