6ca60969b6893268680d4386e2f22cdc3bc3c405,src/fonduer/utils/udf.py,UDFRunner,apply_mt,#UDFRunner#Any#Any#,86

Before Change



        while any([udf.is_alive() for udf in self.udfs]) and count_parsed < total_count:
            if docs_added < total_count:
                in_queue.put(next(xs_generator))
                docs_added += 1
            if docs_added == total_count:
                in_queue.put(UDF.QUEUE_CLOSED)
                docs_added += 1

After Change



        // Create a Queue to feed documents to parsers
        manager = Manager()
        in_queue = manager.Queue()

        // Use an output queue to track multiprocess progress
        out_queue = JoinableQueue()

        total_count = len(xs)

        // Start UDF Processes
        for i in range(parallelism):
            udf = self.udf_class(
                in_queue=in_queue,
                out_queue=out_queue,
                worker_id=i,
                **self.udf_init_kwargs
            )
            udf.apply_kwargs = kwargs
            self.udfs.append(udf)

        // Start the UDF processes, and then join on their completion
        for udf in self.udfs:
            udf.start()

        // Fill input queue with documents
        pool = Pool(parallelism)
        in_tuples = ((in_queue, x) for x in xs)
        pool.map_async(func=async_fill_input_queue, iterable=in_tuples)

        count_parsed = 0
        while count_parsed < total_count:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: HazyResearch/fonduer
Commit Name: 6ca60969b6893268680d4386e2f22cdc3bc3c405
Time: 2018-09-05
Author: jrausch@inf.ethz.ch
File Name: src/fonduer/utils/udf.py
Class Name: UDFRunner
Method Name: apply_mt


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: e7890473e703e7ad0c4ccb04398eec6bf6b4e8a5
Time: 2019-06-17
Author: slliu96@163.com
File Name: category_encoders/hashing.py
Class Name: HashingEncoder
Method Name: transform


Project Name: HazyResearch/fonduer
Commit Name: 735287afab4bdcbd791022dc9d75d88a4032c616
Time: 2019-10-23
Author: hiromu.hota@hal.hitachi.com
File Name: src/fonduer/utils/udf.py
Class Name: UDFRunner
Method Name: _apply_mt