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

    """The fixture sets paste.throw_errors, which suppresses exactly what
    we want to test in this case. This wrapper also strips exc_info
    on the *first* call to start_response (but not the second, or
    subsequent calls.
    """
    def clear_throw_errors(environ, start_response):
        headers_sent = []
        def replacement(status, headers, exc_info=None):
            if headers_sent:
                return start_response(status, headers, exc_info)
            headers_sent.append(True)
            return start_response(status, headers)
        if ('paste.throw_errors' in environ):
            del environ['paste.throw_errors']
        return app(environ, replacement)
    return clear_throw_errors