docs: def mapper(mapping, _nt_name='NT'):
      """ Convert mappings to namedtuples recursively. """
      if isinstance(mapping, Mapping) and not isinstance(mapping, AsDict):
          for key, value in list(mapping.items()):
              mapping[key] = mapper(value)
          return namedtuple_wrapper(_nt_name, **mapping)
      elif isinstance(mapping, list):
          return [mapper(item) for item in mapping]
      return mapping