def __initialize_instance(self):
config = self.config<EOL>self.instance.auth = self.authentication_class(self.app, config=config)<EOL>init_handlers = (<EOL>handlers if config.auth_mode() else auth_mode_agnostic_handlers<EOL>)<EOL>for handler in init_handlers:<EOL><INDENT>if handler.keys is None:<EOL><INDENT>self.__check_method_in_auth(handler.name, handler.exception)<EOL><DEDENT>else:<EOL><INDENT>if all(map(config.get, handler.keys)):<EOL><INDENT>self.__check_method_in_auth(<EOL>handler.name, handler.exception<EOL>)<EOL><DEDENT><DEDENT><DEDENT>for handler in init_handlers:<EOL><INDENT>if handler.name in self.kwargs:<EOL><INDENT>method = self.kwargs.pop(handler.name)<EOL>setattr(self.instance.auth, handler.name, method)<EOL><DEDENT><DEDENT>
Take any predefined methods/handlers and insert them into Sanic JWT