code: def iter_modules(path=None, prefix=""):
      """Yields ModuleInfo for all submodules on path,
      or, if path is None, all top-level modules on sys.path.
  
      'path' should be either None or a list of paths to look for
      modules in.
  
      'prefix' is a string to output on the front of every module name
      on output.
      """
      if path is None:
          importers = iter_importers()
      elif isinstance(path, str):
          raise ValueError(
              "path must be None or list of paths to look for "
              "modules in"
          )
      else:
          importers = map(get_importer, path)
  
      yielded = {}
      for i in importers:
          for name, ispkg in iter_importer_modules(i, prefix):
              if name not in yielded:
                  yielded[name] = 1
                  yield ModuleInfo(i, name, ispkg)
  
imports: from collections import namedtuple
  from functools import singledispatch
  import importlib
  import importlib.util
  import importlib.machinery
  import os
  import os.path
  import sys
  from types import ModuleType
  import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: iter_modules(path, prefix) without return types