80f87868e6ffad6b2a7f6c4e9933ff14bb8abb49,deeppavlov/core/data/utils.py,,download_decompress,#Any#Any#Any#,106
Before Change
download_path = Path(download_path)
if extract_path is None:
extract_path = download_path
extract_path = Path(extract_path)
arch_file_path = download_path / file_name
log.info("Extracting {} archive into {}".format(arch_file_path, extract_path))
download(arch_file_path, url)
if url.endswith(".tar.gz"):
After Change
elif isinstance(extract_paths, list):
extract_paths = [Path(path) for path in extract_paths]
if url.endswith((".tar.gz", ".gz", ".zip")):
for extract_path in extract_paths:
log.info("Extracting {} archive into {}".format(arch_file_path, extract_path))
extract_path.mkdir(parents=True, exist_ok=True)
if url.endswith(".tar.gz"):
untar(arch_file_path, extract_path)
elif url.endswith(".gz"):
ungzip(arch_file_path, extract_path)
elif url.endswith(".zip"):
zip_ref = zipfile.ZipFile(arch_file_path, "r")
zip_ref.extractall(extract_path)
zip_ref.close()
arch_file_path.unlink()
else:
log.error("File {} has unsupported format. "
"Not extracted, downloaded to {}".format(file_name, arch_file_path))
def load_vocab(vocab_path):
vocab_path = Path(vocab_path)
with vocab_path.open() as f:
return f.read().split()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: deepmipt/DeepPavlov
Commit Name: 80f87868e6ffad6b2a7f6c4e9933ff14bb8abb49
Time: 2018-04-27
Author: alitinsky@gmail.com
File Name: deeppavlov/core/data/utils.py
Class Name:
Method Name: download_decompress
Project Name: deepmipt/DeepPavlov
Commit Name: 00de689e6624b4b3c312c921226ad23f49a79229
Time: 2018-01-19
Author: ol.gure@gmail.com
File Name: deeppavlov/core/models/keras_model.py
Class Name: KerasModel
Method Name: load
Project Name: deepmipt/DeepPavlov
Commit Name: 286a864220a00732d382a75051e11877acf13c3f
Time: 2018-01-24
Author: ol.gure@gmail.com
File Name: deeppavlov/core/models/keras_model.py
Class Name: KerasModel
Method Name: load