def add_route(self, handler, uri, methods=frozenset({'<STR_LIT:GET>'}), host=None,<EOL>strict_slashes=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>if getattr(handler.view_class, method.lower(), None):<EOL><INDENT>methods.add(method)<EOL><DEDENT><DEDENT><DEDENT>if isinstance(handler, self._composition_view_class):<EOL><INDENT>methods = handler.handlers.keys()<EOL><DEDENT>self.route(uri=uri, methods=methods, host=host,<EOL>strict_slashes=strict_slashes)(handler)<EOL>return handler<EOL>
Create a blueprint route from a function.

        :param handler: function for handling uri requests. Accepts function,
                        or class instance with a view_class method.
        :param uri: endpoint at which the route will be accessible.
        :param methods: list of acceptable HTTP methods.
        :return: function or class instance