design pattern quick reference chain of responsibility chain_of_responsibility py class endhandler(object)def __init__(self)pass def handle_request(selfrequest)pass class handler (object)def __init__(self)self next_handler endhandler(def handle_request(selfrequest)self next_handler handle_request(requestdef main(request)concrete_handler handler (concrete_handler handle_request(requestif __name__ ="__main__"from the command line we can define some request main(requestalternative chain_of_responsibility_alt py class dispatcher(object)def __init__(selfhandlers=[])self handlers handlers def handle_request(selfrequest)for handler in self handlersrequest handler(requestreturn request