| 85 | logger.info("Downloading data for %s", sample_data.sample) |
| 86 | |
| 87 | def _downloadFile(path, url): |
| 88 | logger.info("Downloading %s from %s", path, url) |
| 89 | import requests |
| 90 | |
| 91 | r = requests.get(url, stream=True, timeout=5) |
| 92 | size = int(r.headers.get("content-length", 0)) |
| 93 | from tqdm import tqdm |
| 94 | |
| 95 | progress_bar = tqdm(total=size, unit="iB", unit_scale=True) |
| 96 | with open(path, "wb") as fd: |
| 97 | for chunk in r.iter_content(chunk_size=1024): |
| 98 | progress_bar.update(len(chunk)) |
| 99 | fd.write(chunk) |
| 100 | progress_bar.close() |
| 101 | |
| 102 | allGood = True |
| 103 | for f in sample_data.files: |