File size: 543 Bytes
15fe5b5
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
"""Extract downloaded result archives into this directory."""
from pathlib import Path
import zipfile
root=Path(__file__).resolve().parent
for archive in sorted((root/'archives').glob('*.zip')):
    print('Extracting',archive.name,flush=True)
    with zipfile.ZipFile(archive) as z:
        for member in z.infolist():
            target=(root/member.filename).resolve()
            if not target.is_relative_to(root):raise ValueError('Unsafe archive path')
        z.extractall(root)
print('Done. See predictions_index.jsonl and README.md.')