def umap(path, name=None, include=None, namespace=None, priority=None):
def url_wrapper(view):<EOL><INDENT>module = _find_urls_module(view)<EOL>fn = view.as_view() if hasattr(view, '<STR_LIT>') else view<EOL>if namespace and include:<EOL><INDENT>raise TypeError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT>if namespace:<EOL><INDENT>base = import_string('<STR_LIT>'.format(module))<EOL>urlpatterns_list = [<EOL>x for x in base<EOL>if getattr(x, '<STR_LIT>', None) == namespace<EOL>]<EOL>if len(urlpatterns_list) != <NUM_LIT:1>:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'.format(namespace)<EOL>)<EOL><DEDENT>urlpatterns = urlpatterns_list.pop(<NUM_LIT:0>).url_patterns<EOL><DEDENT>else:<EOL><INDENT>urlpatterns = import_string('<STR_LIT>'.format(<EOL>module,<EOL>include or '<STR_LIT>'<EOL>))<EOL><DEDENT>call = (<EOL>urlpatterns.append if priority is None<EOL>else partial(urlpatterns.insert, priority)<EOL>)<EOL>call(url(path, fn, name=name))<EOL>return view<EOL><DEDENT>return url_wrapper<EOL>
Maps a given URL path, name and namespace to a view.
Arguments:
    - path: the URL regex, e.g.: '^teste/(?P<pk>[0-9])/$'.

Optional arguments:
    - name: the URL name, which Django uses to identify the URL;
    - include: A custom URL list, previously
               set on the module's urls.py;
    - namespace: the URL's namespace;
    - priority: the URL's priority;