code: def create_key_index_object(key_index_name: str, iterables: Dict[str, Any]) -> Any:
      for name, iterable in iterables.items():
          if iter(iterable) == iter(iterable):
              raise TypeError(
                  f"Iterable {name} is in iterator which can be exhausted. Please pass the iterable"
                  f" in a container that can recreate the iterable. See the comments here for more info."
              )
      fields = [(name, type(next(iter(iterable)))) for name, iterable in iterables.items()]
      KeyIndex = dataclasses.make_dataclass(
          key_index_name,
          fields,
          frozen = True
      )
      KeyIndex.__iter__ = _key_index_iter
      return KeyIndex