e1d39a4c9158c9a9db1218cb5be9946152e2ca1b,src/fetch_cnpj_info.py,,,#,137

Before Change


    print("%i CNPJ\"s to be fetched" % len(cnpj_list_to_import))

    with futures.ThreadPoolExecutor(max_workers=10) as executor:
        future_to_cnpj_info = dict((executor.submit(fetch_cnpj_info, cnpj), cnpj)
                                   for cnpj in cnpj_list)

        for future in futures.as_completed(future_to_cnpj_info):
            cnpj = future_to_cnpj_info[future]
            if future.exception() is not None:
                print("%r raised an exception: %s" % (cnpj, future.exception()))
            else:
                write_cnpj_info(cnpj, future.result())

    import_cnpj_infos(info_dataset, info_partners_dataset)

    if len(filesNotFound) > 0:
        print("The following files were not found:")

After Change


    for cnpj in cnpj_list[:3]:
        result = fetch_cnpj_info(cnpj)
        if result != None and result["status"] == "OK":
            info_dataset = info_dataset.append(result, ignore_index=True)

    info_dataset.to_csv(INFO_DATASET_PATH,
                        compression="xz",
                        encoding="utf-8",
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


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:


Project Name: analysiscenter/batchflow
Commit Name: af9280ba162009408b4bc6dbc0edfe94dc3911c5
Time: 2017-04-18
Author: rhudor@gmail.com
File Name: dataset/pipeline.py
Class Name: Pipeline
Method Name: run


Project Name: vatlab/SoS
Commit Name: d85c87182a4eb2434bf3bd4d540217ce68125949
Time: 2017-04-07
Author: ben.bog@gmail.com
File Name: sos/sos_task.py
Class Name: TaskEngine
Method Name: submit_task