code: def modules_in_path(p: Path) -> Iterator[ModuleType]:
      for file in p.rglob("*.py"):
          # Construct path as string for import, for instance "dataframe.frame"
          # The -3 drops the ".py"
          file_name_import = ".".join(file.relative_to(p).parts)[:-3]
          temp_module = importlib.import_module(
              p.name + "." + file_name_import
          )
          yield temp_module
  
file_path: polars/py-polars/tests/docs/run_doctest.py
imports: from __future__ import annotations
  import doctest
  import importlib
  import sys
  import unittest
  import warnings
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import TYPE_CHECKING, Any, Iterator
  import polars
label_desc: Use image node_id 2 for calling a global function with example usage: modules_in_path(p) without return types