def process_values(self, values, callback, processes_count=1, **kwargs):

        ##################################################################################
        # Retrieves data from Pipe's connection
        ##################################################################################
        def receive_from_pipe(conn):
            while True:
                if conn.poll(None):
                    data = conn.recv()
                    conn.close()
                    return data
                time.sleep(1)

        if processes_count > 1:

            data = []
            errors = []

            conns = []
            processes = []

            max_value = len(values)-1
            interval = max_value/processes_count
            values_range = processes_count
            if processes_count*(interval%1) < max_value:
                values_range = values_range + 1

            values_from = 0
            values_to = interval if interval <= max_value else max_value

            for i in range(0, values_range):

                parent_conn, child_conn = Pipe(False)
                conns.append(parent_conn)

                processes.append(Process(target=self.launch_worker,
                                         args=(callback,values[values_from:values_to+1],
                                         child_conn), kwargs=kwargs))

                values_from = values_to + 1
                values_to = values_to + interval + 1
                if i == values_range-2 and values_to > max_value:
                    values_to = max_value

            for process in processes: process.start()

            for conn in conns:
                result = receive_from_pipe(conn)
                for record in result['data']: data.append(record)
                for error in result['errors']: errors.append(error)

            for process in processes: process.join()

            return {
                'data': data,
                'errors': errors
            }

        else:

            return callback(values, **kwargs)

	######################################################################################
dataset/ETHPy150Open ipeirotis/Mturk-Tracker/app/mturk/main/management/commands/crawler_.py/Crawler.process_values/operator `+` -> `%`