Download scripts/package.py from zzhang2816/CS_TA: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/zzhang2816/CS_TA/resolve/main/scripts/package.py
- Command line
-
hf download hf://datasets/zzhang2816/CS_TA/scripts/package.py
-
curl -L -o package.py https://huggingface.co/datasets/zzhang2816/CS_TA/resolve/main/scripts/package.py
1.07 kB
| #!/usr/bin/env python3 | |
| """Build the Canvas source ZIP after provisioning, excluding private files.""" | |
| from pathlib import Path | |
| from zipfile import ZIP_DEFLATED, ZipFile | |
| ROOT = Path(__file__).resolve().parents[1] | |
| OUTPUT = ROOT / 'SecureMed.zip' | |
| INCLUDE = ['Dockerfile', 'docker-compose.yml', '.env.example', 'README.md', | |
| 'hands_on.md', 'checklist.py', 'submission.json', | |
| 'securemed-diagnosis.tar', 'api/app.py', 'api/index.html', | |
| 'api/requirements.txt', 'scripts/provision_grading_accounts.py', | |
| 'scripts/seed_accounts.py', 'scripts/package.py'] | |
| def main(): | |
| missing = [name for name in INCLUDE if not (ROOT / name).is_file()] | |
| if missing: | |
| raise SystemExit('Missing required submission files: ' + ', '.join(missing)) | |
| with ZipFile(OUTPUT, 'w', ZIP_DEFLATED, compresslevel=2, allowZip64=True) as archive: | |
| for name in INCLUDE: | |
| archive.write(ROOT / name, arcname=name) | |
| print(f'Created {OUTPUT}. Private .env and private_accounts.json were excluded.') | |
| if __name__ == '__main__': | |
| main() | |