code: def walk_modules(path):
      logger = logging.getLogger("enumerate-api")
      modules = find_modules(path)
      api = {"functions": {}, "classes": {}}
      for mod in modules:
          module = f"statsmodels.{mod}"
          logger.info(module)
          if (
              ".sandbox" in module
              or module.endswith(".tests")
              or ".tests." in module
          ):
              continue
          try:
              lib = importlib.import_module(module)
          except (ImportError, OSError):
              lib = None
          if lib is None:
              continue
          for v in dir(lib):
              if v.startswith("_"):
                  continue
              func = getattr(lib, v)
              if not (
                  inspect.isfunction(func) or inspect.isclass(func)
              ):
                  continue
              if "statsmodels" not in func.__module__:
                  continue
              name = f"{func.__module__}.{v}"
              try:
                  if inspect.isfunction(func):
                      d = api["functions"]
                  else:
                      d = api["classes"]
                  sig = inspect.signature(func)
                  d[name] = tuple(k for k in sig.parameters.keys())
              except Exception:
                  d[name] = tuple()
              if inspect.isclass(func):
                  update_class(func, api["classes"], v, name)
              logger.info(f"{module}.{v}")
      return api
  
file_path: statsmodels/tools/releasing/enumerate-api.py
imports: from setuptools import find_packages
  import argparse
  import importlib
  import inspect
  import json
  import logging
  import os
  from pkgutil import iter_modules
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: walk_modules(path) and returns: api