MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / maybe_download

Function maybe_download

tensorpack/dataflow/dataset/mnist.py:16–23  ·  view source on GitHub ↗

Download the data from Yann's website, unless it's already here.

(url, work_directory)

Source from the content-addressed store, hash-verified

14
15
16def maybe_download(url, work_directory):
17 """Download the data from Yann's website, unless it's already here."""
18 filename = url.split('/')[-1]
19 filepath = os.path.join(work_directory, filename)
20 if not os.path.exists(filepath):
21 logger.info("Downloading to {}...".format(filepath))
22 download(url, work_directory)
23 return filepath
24
25
26def _read32(bytestream):

Callers 1

get_images_and_labelsMethod · 0.70

Calls 3

downloadFunction · 0.85
joinMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected