def METHOD_NAME(url_or_viewname, qs, *args, **kwargs):
    if url_or_viewname.startswith('/'):
        url = url_or_viewname
        assert not args
        assert not kwargs
    else:
        url = reverse(url_or_viewname, *args, **kwargs)
    if qs:
        url += '?' + urllib.parse.urlencode(qs)
    return url