def _download_with_progress_bar()

in download_dataset.py [0:0]


def _download_with_progress_bar(url: str, fname: str, category: str):
    # taken from https://stackoverflow.com/a/62113293/986477
    resp = requests.get(url, stream=True)
    total = int(resp.headers.get('content-length', 0))
    with open(fname, 'wb') as file, tqdm(
        desc=fname,
        total=total,
        unit='iB',
        unit_scale=True,
        unit_divisor=1024,
    ) as bar:
        for datai, data in enumerate(resp.iter_content(chunk_size=1024)):
            size = file.write(data)
            bar.update(size)
            if datai % max(((total//1024)//20),1) == 0:
                print(f"{category}: Downloaded {100.0*(float(bar.n)/total):3.1f}%.")
                print(bar)