docs: def prepare_url_list(urlresolver, namespace_path='', namespace=''):
      """
      returns list of tuples [(<url_name>, <url_patern_tuple> ), ...]
      """
      exclude_ns = getattr(settings, 'JS_REVERSE_EXCLUDE_NAMESPACES', JS_EXCLUDE_NAMESPACES)
      include_only_ns = getattr(settings, 'JS_REVERSE_INCLUDE_ONLY_NAMESPACES', JS_INCLUDE_ONLY_NAMESPACES)
  
      if exclude_ns and include_only_ns:
          raise ImproperlyConfigured(
              'Neither use JS_REVERSE_EXCLUDE_NAMESPACES nor JS_REVERSE_INCLUDE_ONLY_NAMESPACES setting')
  
      if namespace[:-1] in exclude_ns:
          return
  
      include_only_allow = True  # include_only state varible
  
      if include_only_ns != []:
          # True mean that ns passed the test
          in_on_empty_ns = False
          in_on_is_in_list = False
          in_on_null = False
  
          # Test urls without ns
          if namespace == '' and '' in include_only_ns:
              in_on_empty_ns = True
  
          # check if nestead ns isn't subns of include_only ns
          # e.g. ns = "foo:bar" include_only = ["foo"] -> this ns will be used
          # works for ns = "lorem:ipsum:dolor" include_only = ["lorem:ipsum"]
          # ns "lorem" will be ignored but "lorem:ipsum" & "lorem:ipsum:.." won't
          for ns in include_only_ns:
              if ns != "" and namespace[:-1].startswith(ns):
                  in_on_is_in_list = True
                  break
  
          # Test if isn't used "\0" flag
          # use "foo\0" to add urls just from "foo" not from subns "foo:bar"
          if namespace[:-1] + '\0' in include_only_ns:
              in_on_null = True
  
          include_only_allow = in_on_empty_ns or in_on_is_in_list or in_on_null
  
      if include_only_allow:
          for url_name in urlresolver.reverse_dict.keys():
              if isinstance(url_name, (text_type, str)):
                  url_patterns = []
                  for url_pattern in urlresolver.reverse_dict.getlist(url_name):
                      url_patterns += [
                          [namespace_path + pat[0], pat[1]] for pat in url_pattern[0]]
                  yield [namespace + url_name, url_patterns]
  
      for inner_ns, (inner_ns_path, inner_urlresolver) in \
              urlresolver.namespace_dict.items():
          inner_ns_path = namespace_path + inner_ns_path
          inner_ns = namespace + inner_ns + ':'
  
          # if we have inner_ns_path, reconstruct a new resolver so that we can
          # handle regex substitutions within the regex of a namespace.
          if inner_ns_path:
              args = [inner_ns_path, inner_urlresolver]
  
              # https://github.com/ierror/django-js-reverse/issues/65
              if StrictVersion(django.get_version()) >= StrictVersion("2.0.6"):
                  args.append(tuple(urlresolver.pattern.converters.items()))
  
              inner_urlresolver = urlresolvers.get_ns_resolver(*args)
              inner_ns_path = ''
  
          for x in prepare_url_list(inner_urlresolver, inner_ns_path, inner_ns):
              yield x