(internal) Composes a sequence of functions in the global variable TASK. The
    resulting composition is given the input "inbox" and arguments "args", 
    "kwargs".

def _comp_task(inbox, args, kwargs):
    """
    (internal) Composes a sequence of functions in the global variable TASK. The
    resulting composition is given the input "inbox" and arguments "args", 
    "kwargs".
    
    """
    # Note. this function uses a global variable which must be defined on the 
    # remote host.
    for func, args, kwargs in itertools.izip(TASK, args, kwargs):
        inbox = (func(inbox, *args, **kwargs),)
    return inbox[0]