chain of responsibility pattern def function_ (in_string)print(in_stringreturn "join([ for in in_string if !' ']def function_ (in_string)print(in_stringreturn "join([ for in in_string if !' ']def main(request)dispatcher dispatcher(function_ function_ function_ function_ ]dispatcher handle_request(requestif __name__ ="__main__"main(" "as an exercisei suggest you use this structure to implement the process for the web app before we wrap up this want you to think about the discussion on middleware that we started with can you see how you would use the chain of responsibility pattern to implement middleware for your web app by adding handlers to the queueparting shots as we have seen throughout this the request is the central object around which the pattern is builtand as such care should be taken when constructing and altering the request object as it gets passed from one handler to the next since the chain of responsibility pattern affords us the opportunity to shuffle and alter the handlers used at runtimewe can apply some performance-enhancing ideas to the chain we could move handler to the front of the chain every time it is usedresulting in more regularly used handlers taking the early positions in the chain followed