db887bdd5236d8d34f0dd3625c7f1026e511b640,tensorflow_datasets/core/download/kaggle.py,KaggleCompetitionDownloader,download_file,#KaggleCompetitionDownloader#Any#Any#,153

Before Change


    _run_kaggle_command(command, self._competition_name)
    // kaggle silently compresses some files to ".zip` files.
    fpath = os.path.join(output_dir, fname + ".zip")
    if not fname.endswith(".zip") and tf.io.gfile.exists(fpath):
      with tf.io.gfile.GFile(fpath, "rb") as fobj:
        z = zipfile.ZipFile(fobj)
        z.extractall(output_dir)
      tf.io.gfile.remove(fpath)
    return os.path.join(output_dir, fname) 


def _run_kaggle_command(command_args, competition_name):

After Change


    // TODO(tfds): use --unzip once supported by kaggle 
    // (https://github.com/Kaggle/kaggle-api/issues/9)
    fpath = os.path.join(output_dir, fname + ".zip")
    if zipfile.is_zipfile(fpath):
      e = extractor.get_extractor()
      with e.tqdm():
        e.extract(fpath, resource.ExtractMethod.ZIP, output_dir).get()
    return os.path.join(output_dir, fname) 


def _run_kaggle_command(command_args, competition_name):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


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: sony/nnabla
Commit Name: dd0ee4e2e8c9bd08d1f4300ce6d92d798beaa1b1
Time: 2020-06-22
Author: 46014028+TE-ShiyuYang@users.noreply.github.com
File Name: python/src/nnabla/utils/load.py
Class Name:
Method Name: load


Project Name: tensorflow/datasets
Commit Name: 9ea53fa7a5c1a3594a5a5019e299a34f38290851
Time: 2020-06-26
Author: sharanramjee@gmail.com
File Name: tensorflow_datasets/core/download/kaggle.py
Class Name: KaggleCompetitionDownloader
Method Name: download_competition