def add_route(self, handler, uri, methods=frozenset({'<STR_LIT:GET>'}), host=None,<EOL>strict_slashes=False):
stream = False<EOL>if hasattr(handler, '<STR_LIT>'):<EOL><INDENT>http_methods = (<EOL>'<STR_LIT:GET>', '<STR_LIT:POST>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>methods = set()<EOL>for method in http_methods:<EOL><INDENT>_handler = getattr(handler.view_class, method.lower(), None)<EOL>if _handler:<EOL><INDENT>methods.add(method)<EOL>if hasattr(_handler, '<STR_LIT>'):<EOL><INDENT>stream = True<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if isinstance(handler, self.composition_view_class):<EOL><INDENT>methods = handler.handlers.keys()<EOL>for _handler in handler.handlers.values():<EOL><INDENT>if hasattr(_handler, '<STR_LIT>'):<EOL><INDENT>stream = True<EOL>break<EOL><DEDENT><DEDENT><DEDENT>self.route(uri=uri, methods=methods, host=host,<EOL>strict_slashes=strict_slashes, stream=stream)(handler)<EOL>return handler<EOL>
A helper method to register class instance or
        functions as a handler to the application url
        routes.

        :param handler: function or class instance
        :param uri: path of the URL
        :param methods: list or tuple of methods allowed, these are overridden
                        if using a HTTPMethodView
        :param host:
        :return: function or class instance