def compat_middleware_factory(klass):
    class compatwrapper(klass):
        def process_response(self, req, resp):
            if not hasattr(resp, 'streaming'):
                return klass.process_response(self, req, resp)
            return resp
    return compatwrapper
Class wrapper that only executes `process_response`
dataset/ETHPy150Open dgraziotin/dycapo/piston/middleware.py/compat_middleware_factory