def mp_worker(input, output):
    """
    Process an item from `input` queue and place results in `output` queue.

    Parameters
    ----------
    input : multiprocessing.Queue object
    output : multiprocessing.Queue object
    """
    for func, args in iter(input.get, 'STOP'):
        result = func(*args)
        output.put(result)
