def collate_worker(processor_klass, processor_args, processor_method, in_queue,
                   out_queue, logger=None):
    '''worker process for multiprocess_collate'''
    try:
        p = processor_klass(*processor_args)
        while True:
            item = in_queue.get()
            if item is None:
                # no more work to process
                break
            try:
                method = getattr(p, processor_method)
            except __HOLE__:
                return
            try:
                ret = method(*item)
            except:
                err_type, err, tb = sys.exc_info()
                # Use err_type since unplickling err in the parent process
                # will fail if it has a custom constructor with required
                # parameters.
                ret = WorkerError()
                ret.tb_str = ''.join(traceback.format_tb(tb))
            out_queue.put((item, ret))
    except Exception, err:
        if logger:
            logger.exception('Error in worker')
    finally:
        in_queue.close()
        out_queue.close()
dataset/ETHPy150Open notmyname/slogging/slogging/log_common.py/collate_worker