code: def traverse(
      structure: Mapping[str, Mapping[str, T]],
  ) -> Generator[tuple[str, str, T], None, None]:
      """Iterates over a structure yielding module names, names and values.
  
      NOTE: Items are iterated in key sorted order.
  
      Args:
        structure: The structure to traverse.
  
      Yields:
        Tuples of the module name, name and value from the given structure.
      """
      for module_name in sorted(structure):
          bundle = structure[module_name]
          for name in sorted(bundle):
              value = bundle[name]
              yield module_name, name, value
  
file_path: dm-haiku/haiku/_src/filtering.py
imports: import collections
  from collections.abc import Generator, Mapping, MutableMapping
  from typing import Any, Callable, TypeVar
  from haiku._src import data_structures
  from haiku._src import utils
  import jax
label_desc: Use image node_id 1 for calling a global function with example usage: traverse(structure) without return types