a3e9a51bb758111edf59f7b6dbcc5205d0f0364b,tensorflow_datasets/core/download/downloader.py,_Downloader,_sync_download,#_Downloader#Any#Any#,80

Before Change


    Synchronous version of `download` method.
    checksum = self._checksumer()
    try:
      with contextlib.closing(urllib.request.urlopen(url)) as response:
        fname = util.get_file_name(response.geturl())
        path = os.path.join(destination_path, fname)
        _copy_response_to_file(response, path, checksum)
    except urllib.error.HTTPError as err:
      raise HTTPError(url, err.code, err.reason)
    return checksum.hexdigest()

After Change


  def _sync_download(self, url, destination_path):
    Synchronous version of `download` method.
    checksum = self._checksumer()
    session = requests.Session()
    if _DRIVE_URL.match(url):
      url = self._get_drive_url(url, session)
    response = session.get(url, stream=True)
    fname = util.get_file_name(response.url)
    path = os.path.join(destination_path, fname)
    with gfile.Open(path, "wb") as file_:
      for block in response.iter_content(chunk_size=io.DEFAULT_BUFFER_SIZE):
        checksum.update(block)
        // TODO(pierrot): Test this is faster than doing checksum in the end
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: tensorflow/datasets
Commit Name: a3e9a51bb758111edf59f7b6dbcc5205d0f0364b
Time: 2018-12-06
Author: pierrot@google.com
File Name: tensorflow_datasets/core/download/downloader.py
Class Name: _Downloader
Method Name: _sync_download


Project Name: apple/coremltools
Commit Name: 40220c28a320d5fe351b893e256db48deb864d09
Time: 2020-07-17
Author: aseem.elec@gmail.com
File Name: coremltools/converters/mil/frontend/tensorflow/load.py
Class Name: TF1Loader
Method Name: _from_saved_model


Project Name: HyperGAN/HyperGAN
Commit Name: 4197dd561f94b34a2b048825bc786dd9cb8318ee
Time: 2016-07-13
Author: martyn@255bits.com
File Name: preprocess-directory.py
Class Name:
Method Name:


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 12ca4329d9abff181f8df380369dae3a8eb35734
Time: 2019-05-08
Author: M.N.Tran@ibm.com
File Name: art/classifiers/tensorflow.py
Class Name: TFClassifier
Method Name: __setstate__