eb61fee854576c8a57fd9a20ee03b6fcb89c493a,torchnlp/download.py,,_maybe_extract,#Any#Any#Any#,84

Before Change


    if "zip" in extension:
        with zipfile.ZipFile(compressed_filename, "r") as zip_:
            zip_.extractall(directory)
    elif "tar" in extension or "tgz" in extension:
        with tarfile.open(compressed_filename, mode="r") as tar:
            tar.extractall(path=directory)

    logger.info("Extracted {}".format(compressed_filename))


def _get_filename_from_url(url):

After Change


    if "zip" in extension:
        with zipfile.ZipFile(compressed_filename, "r") as zip_:
            zip_.extractall(directory)
    elif "tar.gz" in extension or "tgz" in extension:
        // `tar` is much faster than python"s `tarfile` implementation
        subprocess.call(["tar", "-C", directory, "-zxvf", compressed_filename])
    elif "tar" in extension:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: PetrochukM/PyTorch-NLP
Commit Name: eb61fee854576c8a57fd9a20ee03b6fcb89c493a
Time: 2019-05-16
Author: petrochukm@gmail.com
File Name: torchnlp/download.py
Class Name:
Method Name: _maybe_extract


Project Name: tensorflow/datasets
Commit Name: db887bdd5236d8d34f0dd3625c7f1026e511b640
Time: 2020-04-16
Author: cs17btech11040@iith.ac.in
File Name: tensorflow_datasets/core/download/kaggle.py
Class Name: KaggleCompetitionDownloader
Method Name: download_file


Project Name: uuazed/numerapi
Commit Name: 1ef4d66a2706fb74cc1b9d2585a8085e562c0a64
Time: 2017-08-14
Author: arodenius@numer.ai
File Name: numerapi/numerapi.py
Class Name: NumerAPI
Method Name: download_current_dataset