Download scripts/validate_cases.py from xsx001/stateshiftbench-code-review: direct link, hf CLI and curl.
- Browser
- Download file 653 Bytes
-
https://huggingface.co/xsx001/stateshiftbench-code-review/resolve/main/scripts/validate_cases.py
- Command line
-
hf download hf://xsx001/stateshiftbench-code-review/scripts/validate_cases.py
-
curl -L -o validate_cases.py https://huggingface.co/xsx001/stateshiftbench-code-review/resolve/main/scripts/validate_cases.py
653 Bytes
| #!/usr/bin/env python3 | |
| """Validate StateShiftBench case files.""" | |
| import argparse | |
| import json | |
| import sys | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parents[1])) | |
| from stateshiftbench.schemas import validate_case | |
| def main(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--data", required=True, help="Directory containing case JSON files.") | |
| args = parser.parse_args() | |
| paths = sorted(Path(args.data).glob("*.json")) | |
| for path in paths: | |
| case = json.loads(path.read_text()) | |
| validate_case(case) | |
| print(f"validated {len(paths)} cases") | |
| if __name__ == "__main__": | |
| main() | |