Download scrapers_and_normalizers/gap_queue.py from justicedao/ipfs_state_admin_rules: direct link, hf CLI and curl.
- Browser
- Download file 959 Bytes
-
https://huggingface.co/datasets/justicedao/ipfs_state_admin_rules/resolve/main/scrapers_and_normalizers/gap_queue.py
- Command line
-
hf download hf://datasets/justicedao/ipfs_state_admin_rules/scrapers_and_normalizers/gap_queue.py
-
curl -L -o gap_queue.py https://huggingface.co/datasets/justicedao/ipfs_state_admin_rules/resolve/main/scrapers_and_normalizers/gap_queue.py
959 Bytes
| """Load US items from world_complete_gap_matrix bot_work_queues.admin_rules_eo_scraper.""" | |
| from __future__ import annotations | |
| import json | |
| from pathlib import Path | |
| from typing import Any, Dict, List | |
| MATRIX = Path("/workspace/world_complete_gap_matrix_20261105.json") | |
| US_LANES = {"us_federal_admin_eo", "us_state_admin_and_eo", "us_local_admin_and_eo"} | |
| def load_us_queue() -> List[Dict[str, Any]]: | |
| data = json.loads(MATRIX.read_text(encoding="utf-8")) | |
| q = data["bot_work_queues"]["admin_rules_eo_scraper"] | |
| us = [it for it in q if it.get("lane") in US_LANES or str(it.get("target_id", "")).startswith("ARE-US-")] | |
| us.sort(key=lambda x: int(x.get("priority_rank") or 9999)) | |
| return us | |
| def state_code_from_target(target_id: str) -> str | None: | |
| # ARE-US-OH-ADMIN-EO -> OH | |
| parts = target_id.split("-") | |
| if len(parts) >= 4 and parts[0] == "ARE" and parts[1] == "US" and parts[-2] == "ADMIN": | |
| return parts[2] | |
| return None | |