def middleware(self, *args, **kwargs):
def register_middleware(_middleware):<EOL><INDENT>future_middleware = FutureMiddleware(_middleware, args, kwargs)<EOL>self.middlewares.append(future_middleware)<EOL>return _middleware<EOL><DEDENT>if len(args) == <NUM_LIT:1> and len(kwargs) == <NUM_LIT:0> and callable(args[<NUM_LIT:0>]):<EOL><INDENT>middleware = args[<NUM_LIT:0>]<EOL>args = []<EOL>return register_middleware(middleware)<EOL><DEDENT>else:<EOL><INDENT>return register_middleware<EOL><DEDENT>
Create a blueprint middleware from a decorated function.