eb6566de307bab286c5632b9335ca74c73b68971,python/magent/utility.py,,download_file,#Any#Any#,216
Before Change
print("wget fails. Retry with python function. It may takes several minutes...")
print("It may be slow, you"d better install wget by "brew install wget" and retry.")
raw = urllib2.urlopen(url)
with open(filename, "wb") as fout:
fout.write(raw.read() )
else:
print("download done!")
After Change
if ret != 0:
print("ERROR: wget fails!")
print("If you are an OSX user, you can install wget by "brew install wget" and retry.")
exit(-1)
else:
print("download done!")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: geek-ai/MAgent
Commit Name: eb6566de307bab286c5632b9335ca74c73b68971
Time: 2017-12-06
Author: zhenglianmin96@163.com
File Name: python/magent/utility.py
Class Name:
Method Name: download_file
Project Name: okfn-brasil/serenata-de-amor
Commit Name: e1d39a4c9158c9a9db1218cb5be9946152e2ca1b
Time: 2017-04-14
Author: marcus.rehm@gmail.com
File Name: src/fetch_cnpj_info.py
Class Name:
Method Name: fetch_cnpj_info
Project Name: estnltk/estnltk
Commit Name: f1106d2c7e4580a1c2947fa8dd181aec1babf517
Time: 2015-09-05
Author: Annett.Saarik@hotmail.com
File Name: estnltk/database/database.py
Class Name: Database
Method Name: keyword_documents