human
Complete this python program:
def fork_task_context(functor, context=None):
assistant
#Here is the Python program you requested.

    """Wrap a functor to transfer context.
    Usage example:
    gevent.spawn(zerorpc.fork_task_context(myfunction), args...)
    The goal is to permit context "inheritance" from a task to another.
    Consider the following example:
    zerorpc.Server receive a new event
    - task1 is created to handle this event this task will be linked
    to the initial event context. zerorpc.Server does that for you.
    - task1 make use of some zerorpc.Client instances, the initial
    event context is transfered on every call.
    - task1 spawn a new task2.
    - task2 make use of some zerorpc.Client instances, it\s a fresh
    context. Thus there is no link to the initial context that
    spawned task1.
    - task1 spawn a new fork_task_context(task3).
    - task3 make use of some zerorpc.Client instances, the initial
    event context is transfered on every call.
    A real use case is a distributed tracer. Each time a new event is
    created, a trace_id is injected in it or copied from the current task
    context. This permit passing the trace_id from a zerorpc.Server to
    another via zerorpc.Client.
    The simple rule to know if a task need to be wrapped is:
    - if the new task will make any zerorpc call, it should be wrapped.
    """
    context = (context or Context.get_instance())
    xheader = context.hook_get_task_context()
    def wrapped(*args, **kargs):
        context.hook_load_task_context(xheader)
        return functor(*args, **kargs)
    return wrapped