code: def find_internal_python_modules(
      root_module: types.ModuleType,
  ) -> Sequence[tuple[str, types.ModuleType]]:
      """Returns `(name, module)` for all Haiku submodules under `root_module`."""
      modules = {(root_module.__name__, root_module)}
      visited = set()
      to_visit = [root_module]
  
      while to_visit:
          mod = to_visit.pop()
          visited.add(mod)
  
          for name in dir(mod):
              obj = getattr(mod, name)
              if inspect.ismodule(obj) and obj not in visited:
                  if obj.__name__.startswith("haiku"):
                      to_visit.append(obj)
                      modules.add((obj.__name__, obj))
  
      return sorted(modules)
  
file_path: dm-haiku/haiku/_src/test_utils.py
imports: from collections.abc import Generator, Sequence
  import functools
  import inspect
  import itertools
  import os
  import types
  from typing import Any, Callable, Optional, TypeVar
  from absl.testing import parameterized
  from haiku._src import config
  from haiku._src import transform
  import jax
label_desc: Use image node_id 2 for calling a global function with example usage: find_internal_python_modules(root_module) and returns: sorted