human
Complete this python program:
def inlineCallbacks(f):
assistant
#Here is the Python program you requested.

    """WARNING: this function will not work in Python 2.4 and earlier!
    inlineCallbacks helps you write Deferred-using code that looks like a
    regular sequential function. This function uses features of Python 2.5
    generators.  If you need to be compatible with Python 2.4 or before, use
    the L{deferredGenerator} function instead, which accomplishes the same
    thing, but with somewhat more boilerplate.  For example::
    @inlineCallBacks
    def thingummy():
    thing = yield makeSomeRequestResultingInDeferred()
    print thing #the result! hoorj!
    When you call anything that results in a L{Deferred}, you can simply yield it;
    your generator will automatically be resumed when the Deferred\s result is
    available. The generator will be sent the result of the L{Deferred} with the
    \send\ method on generators, or if the result was a failure, \throw\.
    Your inlineCallbacks-enabled generator will return a L{Deferred} object, which
    will result in the return value of the generator (or will fail with a
    failure object if your generator raises an unhandled exception). Note that
    you can\t use C{return result} to return a value; use C{returnValue(result)}
    instead. Falling off the end of the generator, or simply using C{return}
    will cause the L{Deferred} to have a result of C{None}.
    The L{Deferred} returned from your deferred generator may errback if your
    generator raised an exception::
    @inlineCallbacks
    def thingummy():
    thing = yield makeSomeRequestResultingInDeferred()
    if thing == \I love Twisted\:
    # will become the result of the Deferred
    returnValue(\TWISTED IS GREAT!\)
    else:
    # will trigger an errback
    raise Exception(\DESTROY ALL LIFE\)
    """
    def unwindGenerator(*args, **kwargs):
        return _inlineCallbacks(None, f(*args, **kwargs), Deferred())
    return mergeFunctionMetadata(f, unwindGenerator)