Download tasks/t50-shape-orbits/tests/friction_audit/artifacts.py from refreshdotdev/Refresh-GUI-dataset: direct link, hf CLI and curl.
- Browser
- Download file 956 Bytes
-
https://huggingface.co/datasets/refreshdotdev/Refresh-GUI-dataset/resolve/main/tasks/t50-shape-orbits/tests/friction_audit/artifacts.py
- Command line
-
hf download hf://datasets/refreshdotdev/Refresh-GUI-dataset/tasks/t50-shape-orbits/tests/friction_audit/artifacts.py
-
curl -L -o artifacts.py https://huggingface.co/datasets/refreshdotdev/Refresh-GUI-dataset/resolve/main/tasks/t50-shape-orbits/tests/friction_audit/artifacts.py
956 Bytes
| """Freeze named submissions with hashes; never merge whitespace-distinct paths.""" | |
| from pathlib import Path | |
| import json | |
| import shutil | |
| from media import sha256 | |
| def freeze(project, videos, out): | |
| out = Path(out) | |
| out.mkdir(parents=True, exist_ok=True) | |
| records = [] | |
| for role, source in [('project', project)] + list(videos.items()): | |
| source = Path(source) | |
| row = {'role': role, 'original_path': str(source)} | |
| if not source.is_file(): | |
| row['status'] = 'missing' | |
| else: | |
| destination = out / role / source.name | |
| destination.parent.mkdir(parents=True, exist_ok=True) | |
| shutil.copy2(source, destination) | |
| row.update(status='ok', path=str(destination), sha256=sha256(destination), | |
| size_bytes=destination.stat().st_size) | |
| records.append(row) | |
| (out / 'manifest.json').write_text(json.dumps(records, indent=2) + '\n') | |
| return records | |