def get_urls(<EOL>self,<EOL>root_view_name=None,<EOL>optional_trailing_slash=False,<EOL>decorate=(),<EOL>name_template='<STR_LIT>',<EOL>):
if isinstance(decorate, Iterable):<EOL><INDENT>decorators = decorate<EOL>def decorate(view):<EOL><INDENT>return reduce(lambda view, decorator: decorator(view), decorators, view)<EOL><DEDENT><DEDENT>urls = []<EOL>for path in self.api.get_paths():<EOL><INDENT>regex = path.regex<EOL>if optional_trailing_slash:<EOL><INDENT>regex = regex.rstrip('<STR_LIT:$>')<EOL>if not regex.endswith('<STR_LIT:/>'):<EOL><INDENT>regex += '<STR_LIT:/>'<EOL><DEDENT>regex += '<STR_LIT>'<EOL><DEDENT>view = decorate(path.get_view_class(router=self).as_view())<EOL>urls.append(url(regex, view, name=name_template.format(name=path.name)))<EOL><DEDENT>if root_view_name:<EOL><INDENT>urls.append(url(r'<STR_LIT>', root_view, name=name_template.format(name=root_view_name)))<EOL><DEDENT>return urls<EOL>
Get the router's URLs, ready to be installed in `urlpatterns` (directly or via `include`).

:param root_view_name: The optional url name for an API root view.
                       This may be useful for projects that do not explicitly know where the
                       router is mounted; those projects can then use `reverse('api:root')`,
                       for instance, if they need to construct URLs based on the API's root URL.
:type root_view_name: str|None

:param optional_trailing_slash: Whether to fix up the regexen for the router to make any trailing
                                slashes optional.
:type optional_trailing_slash: bool

:param decorate: A function to decorate view functions with, or an iterable of such decorators.
                 Use `(lepo.decorators.csrf_exempt,)` to mark all API views as CSRF exempt.
:type decorate: function|Iterable[function]

:param name_template: A `.format()` template for view naming.
:type name_template: str

:return: List of URL tuples.
:rtype: list[tuple]