cef99445ab551931fed507518b85034b97c946ee,src/search_suspect_places.py,,search_suspicious_around_companies,#Any#,130

Before Change


        for index, company in companies.iterrows():
            future = executor.submit(search_suspicious_around_company, company)
            future_to_search_suspicious[future] = company
        for future in futures.as_completed(future_to_search_suspects):
            company = future_to_search_suspicious[future]
            if future.exception() is not None:
                warn("{} raised an exception: {}".format(company["cnpj"],
                                                      future.exception()))
            elif future.result() is not None:
                write_suspicious_info(future.result(), company["cnpj"])


def search_suspicious_around_company(company):
    
    :param company: panda series.
    :return: suspect

After Change


    
    :param companies: pandas dataframe.
    
    rows = companies.to_dict("records")
    total = len(rows)
    count = 0
    with Pool(processes=4) as pool:
        for company in pool.imap(search_suspicious_around_company, rows):
            count += 1
            print_status(total, count)
            if company:
                write_csv(company)


def search_suspicious_around_company(company):
    
    :param company: (dict)
    :return: suspect
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: okfn-brasil/serenata-de-amor
Commit Name: cef99445ab551931fed507518b85034b97c946ee
Time: 2016-11-09
Author: cuducos@gmail.com
File Name: src/search_suspect_places.py
Class Name:
Method Name: search_suspicious_around_companies


Project Name: uber/ludwig
Commit Name: 7d9db23a389499c2764fb850cd19f853cc3e8565
Time: 2019-08-08
Author: smiryala@uber.com
File Name: ludwig/features/image_feature.py
Class Name: ImageBaseFeature
Method Name: add_feature_data


Project Name: okfn-brasil/serenata-de-amor
Commit Name: cef99445ab551931fed507518b85034b97c946ee
Time: 2016-11-09
Author: cuducos@gmail.com
File Name: src/search_suspect_places.py
Class Name:
Method Name: search_suspicious_around_companies


Project Name: uber/ludwig
Commit Name: 5667af96dade79ef77194d519182d4989494b3a4
Time: 2019-08-25
Author: smiryala@uber.com
File Name: ludwig/features/image_feature.py
Class Name: ImageBaseFeature
Method Name: add_feature_data