def extends(func):
<EOL>func._wsgi_extension = True<EOL>return func<EOL>
Decorator which marks a method as an extension.  The method must
have the same name as the method it is extending.  Extensions come
in two flavors:

* Generator extensions
    During request processing, generator extensions are called
    before calling the action method.  They may perform any
    desired preprocessing of the request, then they must yield.
    After the action method has been called, the final
    ResponseObject will be sent back to the generator (appearing
    as the return value of the "yield" statement), and the
    generator extension may perform any desired postprocessing of
    the response.  Note that if an actual value is yielded back to
    the caller, the postprocessing part of the generator will not
    be called, and normal request processing is aborted.  Also
    note that the postprocessing portions of all prior extensions
    *will* be called on the yielded response.

* Regular extensions
    Regular extensions are simple methods, rather than generator
    methods.  They are only called during the postprocessing stage
    of request processing.

During the postprocessing stage, if a generator extension yields
another value or a regular extension returns a value, that value
will be wrapped in a ResponseObject and will be used for
subsequent postprocessing.