code: def find_all_sonnet_modules(
      root_python_module: types.ModuleType,
      base_class: Type[Module],
  ) -> Sequence[Type[Module]]:
      """Finds all subclasses of `base_class` under `root_python_module`."""
      modules = []
      for _, python_module in find_sonnet_python_modules(
          root_python_module
      ):
          for name in dir(python_module):
              value = getattr(python_module, name)
              if inspect.isclass(value) and issubclass(
                  value, base_class
              ):
                  modules.append(value)
      return modules
  
imports: import functools
  import inspect
  import itertools
  import os
  import sys
  import threading
  import types
  from typing import Sequence, Tuple, Type, TypeVar
  from absl.testing import parameterized
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: find_all_sonnet_modules(root_python_module, base_class) and returns: modules