Datasets:
Tasks:
Text Generation
Formats:
parquet
Sub-tasks:
language-modeling
Languages:
English
Size:
< 1K
License:
Download harbor/verify_bundle.py from ExpertCrowd/ec-swe: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/datasets/ExpertCrowd/ec-swe/resolve/main/harbor/verify_bundle.py
- Command line
-
hf download hf://datasets/ExpertCrowd/ec-swe/harbor/verify_bundle.py
-
curl -L -o verify_bundle.py https://huggingface.co/datasets/ExpertCrowd/ec-swe/resolve/main/harbor/verify_bundle.py
1.03 kB
| """Check every distributed file against checksums.json before building anything.""" | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| root = Path(__file__).resolve().parent | |
| checks = json.loads((root / "checksums.json").read_text()) | |
| for name, expected in checks.items(): | |
| path = (root / name).resolve() | |
| if not path.is_relative_to(root): | |
| raise ValueError("Unsafe checksum path") | |
| with path.open("rb") as stream: | |
| actual = hashlib.file_digest(stream, "sha256").hexdigest() | |
| if actual != expected: | |
| raise RuntimeError("File checksum mismatch: " + name) | |
| listed = set(checks) | {"checksums.json"} | |
| extra = sorted( | |
| path.relative_to(root).as_posix() | |
| for folder in ("tasks", "sources", "evidence") | |
| for path in (root / folder).rglob("*") | |
| if path.is_file() and path.relative_to(root).as_posix() not in listed | |
| and "__pycache__" not in path.parts | |
| ) | |
| if extra: | |
| raise RuntimeError("Files not in checksums.json: " + ", ".join(extra[:10])) | |
| print(f"Validated {len(checks)} file checksums") | |