parameters: (self, found_path, import_path)
return_statement: return []
docstring: Returns a list of paths of possible ``pkgutil``/``pkg_resources``
          namespaces. If the package is no "namespace package", an empty list is
          returned.
docstring_summary: Returns a list of paths of possible ``pkgutil``/``pkg_resources``
          namespaces. If the package is no "namespace package", an empty list is
          returned.
docstring_tokens: Returns a list of paths of possible pkgutil / pkg_resources namespaces . If the package is no namespace package an empty list is returned .
function: def _namespace_packages(self, found_path, import_path):
          """
          Returns a list of paths of possible ``pkgutil``/``pkg_resources``
          namespaces. If the package is no "namespace package", an empty list is
          returned.
          """
          def follow_path(directories, paths):
              try:
                  directory = next(directories)
              except StopIteration:
                  return paths
              else:
                  deeper_paths = []
                  for p in paths:
                      new = os.path.join(p, directory)
                      if os.path.isdir(new) and new != found_path:
                          deeper_paths.append(new)
                  return follow_path(directories, deeper_paths)
  
          with open(os.path.join(found_path, '__init__.py')) as f:
              content = f.read()
              # these are strings that need to be used for namespace packages,
              # the first one is ``pkgutil``, the second ``pkg_resources``.
              options = 'declare_namespace(__name__)', 'extend_path(__path__'
              if options[0] in content or options[1] in content:
                  # It is a namespace, now try to find the rest of the modules.
                  return follow_path(iter(import_path), sys.path)
          return []
function_tokens: def _namespace_packages ( self , found_path , import_path ) : def follow_path ( directories , paths ) : try : directory = next ( directories ) except StopIteration : return paths else : deeper_paths = [ ] for p in paths : new = os . path . join ( p , directory ) if os . path . isdir ( new ) and new != found_path : deeper_paths . append ( new ) return follow_path ( directories , deeper_paths ) with open ( os . path . join ( found_path , '__init__.py' ) ) as f : content = f . read ( ) # these are strings that need to be used for namespace packages, # the first one is ``pkgutil``, the second ``pkg_resources``. options = 'declare_namespace(__name__)' , 'extend_path(__path__' if options [ 0 ] in content or options [ 1 ] in content : # It is a namespace, now try to find the rest of the modules. return follow_path ( iter ( import_path ) , sys . path ) return [ ]