2c00aa18540df4ab4c3afeacd44b556b3ce90782,python/magent/utility.py,,download_file,#,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!")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: DistrictDataLabs/yellowbrick
Commit Name: 708274289d66d9265f7ded03e3445bc2bd70f46e
Time: 2019-01-01
Author: benjamin@bengfort.com
File Name: yellowbrick/download.py
Class Name:
Method Name: download_data


Project Name: acl-org/acl-anthology
Commit Name: 7419eacac2dfa909b280881524e685d7ea4d7ec7
Time: 2020-04-24
Author: post@cs.jhu.edu
File Name: bin/add_attachments.py
Class Name:
Method Name: add_attachment