Download src/reference_db/review/quarantine.py from offCanada/reference-db-system: direct link, hf CLI and curl.
- Browser
- Download file 530 Bytes
-
https://huggingface.co/offCanada/reference-db-system/resolve/main/src/reference_db/review/quarantine.py
- Command line
-
hf download hf://offCanada/reference-db-system/src/reference_db/review/quarantine.py
-
curl -L -o quarantine.py https://huggingface.co/offCanada/reference-db-system/resolve/main/src/reference_db/review/quarantine.py
530 Bytes
| import json | |
| from pathlib import Path | |
| from .models import ReviewRecord | |
| def quarantine_record( | |
| record: ReviewRecord, | |
| output_dir: str = "data/review", | |
| ) -> Path: | |
| """ | |
| Save an ambiguous record for later review. | |
| """ | |
| phase_dir = Path(output_dir) / record.retailer / record.phase | |
| phase_dir.mkdir(parents=True, exist_ok=True) | |
| output_file = phase_dir / "ambiguous.jsonl" | |
| with output_file.open("a", encoding="utf-8") as f: | |
| f.write(json.dumps(record.__dict__) + "\n") | |
| return output_file | |