12c41492afd6b25847c277be1adaee6642f4756e,tensorflow_datasets/core/download/download_manager.py,DownloadManager,_download,#DownloadManager#Any#,303

Before Change


      if not self._force_download and resource.exists_locally(download_path):
        logging.info("URL %s already downloaded: reusing %s.",
                     url, download_path)
        self._recorded_url_infos[url] = self._url_infos[url]
        return promise.Promise.resolve(download_path)
    // There is a slight difference between downloader and extractor here:
    // the extractor manages its own temp directory, while the DownloadManager
    // manages the temp directory of downloader.

After Change



    // Compute the existing path if the file was previously downloaded
    url_path = self._get_final_dl_path(
        url, hashlib.sha256(url.encode("utf-8")).hexdigest())
    existing_path = self._find_existing_path(url=url, url_path=url_path)

    // If register checksums and file already downloaded, then:
    // * Record the url_infos of the downloaded file
    // * Rename the filename `url_path` -> `file_path`, and return it.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: tensorflow/datasets
Commit Name: 12c41492afd6b25847c277be1adaee6642f4756e
Time: 2020-05-12
Author: epot@google.com
File Name: tensorflow_datasets/core/download/download_manager.py
Class Name: DownloadManager
Method Name: _download


Project Name: ray-project/ray
Commit Name: ef498e8aa5cdfe09247d9c9efc7ef636378165c2
Time: 2020-05-15
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/serve/policy.py
Class Name: PowerOfTwoPolicy
Method Name: flush


Project Name: studioml/studio
Commit Name: ee8321399b0c6f9af6b92ba843e7ac9a1cfe2696
Time: 2017-09-14
Author: peter.zhokhov@sentient.ai
File Name: studio/tartifact_store.py
Class Name: TartifactStore
Method Name: get_artifact