Skip to content
Snippets Groups Projects

Fix datasets

Closed Alexandru-Mihai GHERGHESCU requested to merge fix/datasets_links into main
3 files
+ 53
61
Compare changes
  • Side-by-side
  • Inline
Files
3
import os
import hashlib
import zipfile
import tarfile
import urllib
@@ -44,6 +45,20 @@ def extract_zip(file: str) -> None:
zip_ref.extractall(os.path.dirname(file))
def extract_tgz(file: str) -> None:
"""
Extract a tar gzipped file in the current directory.
Args:
file (str): The archive file to be extracted.
"""
assert os.path.exists(file) and tarfile.is_tarfile(file)
with tarfile.open(file, 'r') as tgz_ref:
tgz_ref.extractall(os.path.dirname(file))
def download_data(url: str, path: str) -> None:
"""
Download the data specified by url to path.
Loading