29c957249fbdd4d5f7f517772835b7dc31a85e94,src/gluonnlp/data/utils.py,,_load_pretrained_vocab,#Any#Any#Any#,285

Before Change


        os.remove(zip_file_path)
    except OSError as e:
        // file has already been removed.
        if e.errno == 2:
            pass
        else:
            raise e

    if check_sha1(file_path, sha1_hash):
        return _load_vocab_file(file_path, cls)
    else:
        raise ValueError("Downloaded file has different hash. Please try again.")

After Change


             path=temp_zip_file_path, overwrite=True)
    with zipfile.ZipFile(temp_zip_file_path) as zf:
        if not os.path.exists(file_path):
            utils.mkdir(temp_root)
            zf.extractall(temp_root)
            os.replace(temp_file_path, file_path)
            shutil.rmtree(temp_root)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: dmlc/gluon-nlp
Commit Name: 29c957249fbdd4d5f7f517772835b7dc31a85e94
Time: 2020-01-15
Author: linhaibin.eric@gmail.com
File Name: src/gluonnlp/data/utils.py
Class Name:
Method Name: _load_pretrained_vocab


Project Name: matplotlib/matplotlib
Commit Name: 52136a7dda72978004f6af8e90e9ebe7596c27b8
Time: 2019-11-26
Author: anntzer.lee@gmail.com
File Name: examples/misc/image_thumbnail_sgskip.py
Class Name:
Method Name:


Project Name: PavlosMelissinos/enet-keras
Commit Name: 28e7817f3ec42a59054a772f80a5782812a02448
Time: 2019-12-17
Author: PavlosMelissinos@users.noreply.github.com
File Name: src/data/utils.py
Class Name:
Method Name: ensure_dir