chain of responsibility pattern self name name self email email @classmethod def get_verified_user(clsusernamepassword)return userusernamepasswordusername"{}@demo comformat(usernameclass endhandler(object)def __init__(self)pass def handle_request(selfrequestresponse=none)return response encode('utf- 'class authorizationhandler(object)def __init__(self)self next_handler endhandler(def handle_request(selfrequestresponse=none)authorization_header request["http_authorization"header_array authorization_header split(encoded_string header_array[ decoded_string base decode(encoded_stringdecode('utf- 'usernamepassword decoded_string split(":"request['username'username request['password'password return self next_handler handle_request(requestresponseclass userhandler(object)def __init__(self)self next_handler endhandler(