b552d0cb84cc02b40146982e926f56513c51cdaf,deeppavlov/download.py,,download_resource,#Any#Any#,127

Before Change


        download_path = dest_paths[0].parent
        download_decompress(url, download_path, dest_paths)
    else:
        file_name = url.split("/")[-1].split("?")[0]
        dest_files = [dest_path / file_name for dest_path in dest_paths]
        download(dest_files, url)

After Change


    file_name = urlparse(url).path.split("/")[-1]
    lockfile = download_path / f".{file_name}.lock"

    with FileLock(lockfile).acquire(poll_intervall=10):
        if check_md5(url, dest_paths):
            log.info(f"Skipped {url} download because of matching hashes")
        elif any(ext in url for ext in (".tar.gz", ".gz", ".zip")):
            download_decompress(url, download_path, dest_paths)
        else:
            dest_files = [dest_path / file_name for dest_path in dest_paths]
            download(dest_files, url)


def download_resources(args: Namespace) -> None:
    if not args.all and not args.config:
        log.error("You should provide either skill config path or -all flag")
        sys.exit(1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: b552d0cb84cc02b40146982e926f56513c51cdaf
Time: 2020-11-10
Author: shuu01@gmail.com
File Name: deeppavlov/download.py
Class Name:
Method Name: download_resource


Project Name: deepmipt/DeepPavlov
Commit Name: 8261994bf8f77251f0b22fb13fa490ffa0bd184b
Time: 2018-02-01
Author: yoptar@gmail.com
File Name: deeppavlov/core/data/utils.py
Class Name:
Method Name: ungzip


Project Name: google/deepvariant
Commit Name: 2f5667b2065568a3c774d76abddb43d726da8c75
Time: 2018-04-13
Author: no-reply@google.com
File Name: third_party/nucleus/util/ranges.py
Class Name:
Method Name: bed_parser