code: def _iter_modules(paths, prefix=""):
      # Copy of pkgutil.iter_modules adapted to work with namespaces
  
      for path in paths:
          importer = pkgutil.get_importer(path)
  
          if not isinstance(importer, importlib.machinery.FileFinder):
              # We're only modifying the case for FileFinder. All the other cases
              # still need to be checked (like zip-importing). Do this by just
              # calling the pkgutil version.
              for mod_info in pkgutil.iter_modules([path], prefix):
                  yield mod_info
              continue
  
          # START COPY OF pkutils._iter_file_finder_modules.
          if importer.path is None or not os.path.isdir(importer.path):
              return
  
          yielded = {}
  
          try:
              filenames = os.listdir(importer.path)
          except OSError:
              # ignore unreadable directories like import does
              filenames = []
          filenames.sort()  # handle packages before same-named modules
  
          for fn in filenames:
              modname = inspect.getmodulename(fn)
              if modname == "__init__" or modname in yielded:
                  continue
  
              # jedi addition: Avoid traversing special directories
              if fn.startswith(".") or fn == "__pycache__":
                  continue
  
              path = os.path.join(importer.path, fn)
              ispkg = False
  
              if not modname and os.path.isdir(path) and "." not in fn:
                  modname = fn
                  # A few jedi modifications: Don't check if there's an
                  # __init__.py
                  try:
                      os.listdir(path)
                  except OSError:
                      # ignore unreadable directories like import does
                      continue
                  ispkg = True
  
              if modname and "." not in modname:
                  yielded[modname] = 1
                  yield importer, prefix + modname, ispkg
  
imports: import errno
  import sys
  import os
  import re
  import pkgutil
  import warnings
  import inspect
  import subprocess
  import ast
label_desc: Use image node_id 4 for calling a global function with example usage: _iter_modules(paths, prefix) without return types