human
Complete the below
def deferredGenerator(f):

    ''''deferredGenerator and waitForDeferred help you write L{Deferred}-using code
    that looks like a regular sequential function. If your code has a minimum
    requirement of Python 2.5, consider the use of L{inlineCallbacks} instead,
    which can accomplish the same thing in a more concise manner.
    There are two important functions involved: L{waitForDeferred}, and
    L{deferredGenerator}.  They are used together, like this::
    @deferredGenerator
    def thingummy():
    thing = waitForDeferred(makeSomeRequestResultingInDeferred())
    yield thing
    thing = thing.getResult()
    print thing #the result! hoorj!
    L{waitForDeferred} returns something that you should immediately yield.
when
    your generator is resumed, calling C{thing.getResult()} will either give you
    the result of the L{Deferred} if it was a success, or raise an exception if it
    was a failure.  Calling C{getResult} is B{absolutely mandatory}.  If you do
    not call it, I{your program will not work}.
    L{deferredGenerator} takes one of these waitForDeferred-using generator
    functions and converts it into a function that returns a L{Deferred}. The
    result of the L{Deferred} will be the last value that your generator yielded
    unless the last value is a L{waitForDeferred} instance, in which case the
    result will be C{None}.  If the function raises an unhandled exception, the
    L{Deferred} will errback instead.  Remember that C{return result} won\'t work;
    use C{yield result.
return} in place of that.
    Note that not yielding anything from your generator will make the L{Deferred}
    result in C{None}. Yielding a L{Deferred} from your generator is also an error
    condition.
always yield C{waitForDeferred(d)} instead.
    The L{Deferred} returned from your deferred generator may also errback if your
    generator raised an exception.  For example::
    @deferredGenerator
    def thingummy():
    thing = waitForDeferred(makeSomeRequestResultingInDeferred())
    yield thing
    thing = thing.getResult()
   ...'''
assistant
#Here is Python code to print thing #the result! hoorj!
.
    def unwindGenerator(*args, **kwargs):
        return _deferGenerator(f(*args, **kwargs), Deferred())
    return mergeFunctionMetadata(f, unwindGenerator)