def thread_local_middleware(app):
    def application(environ, start_response):
        with thread_local():
            return app(environ, start_response)
    return application
Process the request and return a JSON response. Catch errors and return the
dataset/ETHPy150Open cosmic-api/cosmic.py/cosmic/globals.py/thread_local_middleware--crossover with--dataset/ETHPy150Open saltstack/salt/salt/netapi/rest_wsgi.py/application