Download core/multi_program.py from GodsDevProject/FOIA_Declassified_Document_Search: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/GodsDevProject/FOIA_Declassified_Document_Search/resolve/main/core/multi_program.py
- Command line
-
hf download hf://spaces/GodsDevProject/FOIA_Declassified_Document_Search/core/multi_program.py
-
curl -L -o multi_program.py https://huggingface.co/spaces/GodsDevProject/FOIA_Declassified_Document_Search/resolve/main/core/multi_program.py
417 Bytes
| from typing import Dict, List | |
| def compare_programs(docs: List[dict]) -> Dict[str, Dict[str, int]]: | |
| matrix: Dict[str, Dict[str, int]] = {} | |
| for d in docs: | |
| agency = d.get("agency", "Unknown") | |
| year = d.get("date", "")[:4] | |
| if not year.isdigit(): | |
| continue | |
| matrix.setdefault(agency, {}) | |
| matrix[agency][year] = matrix[agency].get(year, 0) + 1 | |
| return matrix |