def __getattr__(self, name: str):
    """Retrieves and wraps an attribute of the underlying module.

    Args:
      name: The attribute name to retrieve.

    Returns:
      Either an AutoNmapModuleWrapper or a `nmap`-ped callable, depending on the
      type of object retrieved from the original module.
    """
    original = getattr(self._module, name)
    if isinstance(original, types.ModuleType):
      return AutoNmapModuleWrapper(original)
    elif callable(original):
      return named_axes.nmap(original)
    else:
      raise AttributeError(
          f"Cannot wrap attribute {name} of {self._module}: it has unrecognized"
          f" type {type(original)} (expected a callable or submodule)"
      )
Retrieves and wraps an attribute of the underlying module.

    Args:
      name: The attribute name to retrieve.

    Returns:
      Either an AutoNmapModuleWrapper or a `nmap`-ped callable, depending on the
      type of object retrieved from the original module.
    
penzai/toolshed/auto_nmap.py