code: def collect(
      root: ModuleType,
  ) -> "DocumentableModule":
      root_name = root.__name__
      exported_names = set(getattr(root, "__all__", []))
  
      modules: List["DocumentableModule"] = []
      classes: List[DocumentableClass] = []
      functions: List[
          Union[DocumentableDispatcher, DocumentableFunction]
      ] = []
  
      for key in dir(root):
          if key.startswith("_"):
              continue
  
          child = getattr(root, key)
          child_name = root_name + "." + key
          if child_name in IGNORE_MODULES:
              continue
  
          # pylint: disable=cell-var-from-loop
          def _should_ignore(
              child: Union[Callable[..., Any], Type[Any]]
          ) -> bool:
              declared_in_root = child.__module__ == root_name
              explicitly_exported = key in exported_names
              return not (declared_in_root or explicitly_exported)
  
          # pylint: enable=cell-var-from-loop
  
          if isinstance(child, Dispatcher):
              functions.append(
                  DocumentableDispatcher(child_name, child)
              )
          elif inspect.ismodule(child):
              if (
                  child.__name__ != child_name
              ):  # Ignore imports of modules.
                  continue
              modules.append(DocumentableModule.collect(child))
          elif inspect.isclass(child):
              if _should_ignore(child):
                  continue
              classes.append(DocumentableClass(child_name, child))
          elif inspect.isfunction(child):
              if _should_ignore(child):
                  continue
              functions.append(DocumentableFunction(child_name, child))
  
      return DocumentableModule(
          root_name, root, modules, classes, functions
      )
  
imports: import inspect
  from dataclasses import dataclass
  from pathlib import Path
  from types import ModuleType
  from typing import Any, Callable, Deque, Dict, List, Mapping, Set, TextIO, Tuple, Type, Union
  from gpflow.utilities import Dispatcher
label_desc: Use image node_id 1 for calling the DocumentableModule obj's underlying member method code with example usage: obj.collect(root) and returns: DocumentableModule, unknown