ProCreations's picture
Publish validated ICML reproduction
6c3fe2a verified
Raw
History Blame Contribute Delete
407 Bytes
#!/usr/bin/env python3
import hashlib
from pathlib import Path
r=Path(__file__).resolve().parent;o=r/"BUNDLE_SHA256SUMS.txt"
rows=[f"{hashlib.sha256(p.read_bytes()).hexdigest()} {p.relative_to(r).as_posix()}" for p in sorted(r.rglob("*")) if p.is_file() and p!=o and "__pycache__" not in p.parts and p.suffix!=".pyc"]
o.write_text("\n".join(rows)+"\n",encoding="utf-8");print(f"wrote {len(rows)} entries")