2c00aa18540df4ab4c3afeacd44b556b3ce90782,python/magent/utility.py,,download_file,#Any#Any#,208
Before Change
//file = urllib2.urlopen(url)
//with open(filename, "wb") as fout:
// fout.write(file.read())
if platform.system() == "Darwin":
os.system("curl -O %s "%s"" % (filename, url))
else:
os.system("wget -O %s "%s"" % (filename, url))
print("download done!")
def download_model(url):
After Change
if ret != 0:
print("wget fails. Retry with python function. It may takes several miniuts...")
raw = urllib2.urlopen(url)
with open(filename, "wb") as fout:
fout.write(raw.read())
else:
print("download done!")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances
Project Name: geek-ai/MAgent
Commit Name: 2c00aa18540df4ab4c3afeacd44b556b3ce90782
Time: 2017-12-01
Author: zhenglianmin96@163.com
File Name: python/magent/utility.py
Class Name:
Method Name: download_file
Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 3c8509c5711bf3e3edef1cd0bfd3a767ab426ab0
Time: 2018-04-22
Author: yutiansut@qq.com
File Name: QUANTAXIS/QACmd/__init__.py
Class Name: CLI
Method Name: do_examples
Project Name: facebookresearch/ParlAI
Commit Name: 9fc989afc19ec56ccbf0b7b966d34bfdd254c651
Time: 2017-05-06
Author: ahm@fb.com
File Name: parlai/core/build_data.py
Class Name:
Method Name: mark_done