e4d5b98f9d2ef79279300d1074cbaacde8e816dc,src/fetch_sex_places.py,,sex_places_neraby,#Any#,207

Before Change


                q.put(csv_line_as_string(sex_place))

    write_queue = Queue()
    place_search = Process(target=make_queue, args=(write_queue, companies))
    place_search.start()

    with lzma.open(OUTPUT, "at") as output:
        while place_search.is_alive() or not write_queue.empty():
            try:
                contents = write_queue.get(timeout=1)
                if contents:
                    print(contents, file=output)
            except:
                pass

    place_search.join()


def sex_place_nearby(company):

After Change


    Genarator of CSV lines (as strings) to be saved as the results.
    :param companies: pandas dataframe.
    
    dicts = map(lambda x: dict(x._asdict()), companies.itertuples(index=True))
    with Pool(processes=4) as pool:
        for place in pool.imap(sex_place_nearby, tuple(dicts)):
            if place:
                yield csv_line_as_string(place)


def csv_line_as_string(company=None, **kwargs):
    
    Receives a given company (dict) and returns a string representnig this
    company data in a CSV format. CSV headers are defined in `fieldnames`.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: okfn-brasil/serenata-de-amor
Commit Name: e4d5b98f9d2ef79279300d1074cbaacde8e816dc
Time: 2016-11-20
Author: cuducos@gmail.com
File Name: src/fetch_sex_places.py
Class Name:
Method Name: sex_places_neraby


Project Name: DexterInd/GoPiGo3
Commit Name: 1fb289b0de21ec00d28046eff88d6da8f4c15319
Time: 2017-07-21
Author: robert.lucian.chiriac@gmail.com
File Name: Projects/BasicRobotControl/runnable.py
Class Name:
Method Name: Main


Project Name: DexterInd/GoPiGo3
Commit Name: f8d97b8a228504adc12a2286c62f0fd7827a3a3c
Time: 2017-07-20
Author: robert.lucian.chiriac@gmail.com
File Name: Projects/BasicRobotControl/runnable.py
Class Name:
Method Name: Main