Datasets:
Download scripts/govdata/common/guard.py from ethux/belastingdienst-dataset: direct link, hf CLI and curl.
- Browser
- Download file 437 Bytes
-
https://huggingface.co/datasets/ethux/belastingdienst-dataset/resolve/main/scripts/govdata/common/guard.py
- Command line
-
hf download hf://datasets/ethux/belastingdienst-dataset/scripts/govdata/common/guard.py
-
curl -L -o guard.py https://huggingface.co/datasets/ethux/belastingdienst-dataset/resolve/main/scripts/govdata/common/guard.py
437 Bytes
| def check_counts(previous: dict[str, int] | None, current: dict[str, int], max_drop: float = 0.10) -> list[str]: | |
| """Configs whose row count dropped more than max_drop. Configs absent on either side are skipped.""" | |
| if not previous: | |
| return [] | |
| return [ | |
| f"{cfg}: {prev} -> {current[cfg]}" | |
| for cfg, prev in previous.items() | |
| if cfg in current and prev and current[cfg] < prev * (1 - max_drop) | |
| ] | |