class_docstr: Dataset with additional indexing information.
code: def __init__(
      self,
      *args,
      id_fn: Optional[IdFnType] = None,
      indexed_examples: Optional[list[IndexedInput]] = None,
      **kw,
  ):
      # The base Dataset class will initialize self._examples in this call to
      # super().__init__(), which may or may not include the _id and _meta fields.
      super().__init__(*args, **kw)
      self.id_fn = id_fn if id_fn is not None else input_hash
  
      if indexed_examples:
          self._indexed_examples = indexed_examples
          # Ensure that all indexed exampls provide a readonly view of their data.
          for ie in self._indexed_examples:
              if not isinstance(
                  (ie_data := ie["data"]), types.MappingProxyType
              ):
                  ie["data"] = self._normalize_example(
                      ie_data, ie["id"], ie["meta"]
                  )
      else:
          self._indexed_examples = self.index_inputs(self._examples)
  
      self._examples = [
          self._normalize_example(
              ex["data"], ex["id"], ex.get("meta", {})
          )
          for ex in self._indexed_examples
      ]
      self._index = {ex["id"]: ex for ex in self._indexed_examples}
  
imports: from collections.abc import Callable, Mapping, Sequence
  import hashlib
  import glob
  import inspect
  import os
  import random
  import types
  from typing import Optional, Union, cast
  from absl import logging
  from lit_nlp.api import types
  from lit_nlp.lib import serialize
  from lit_nlp.lib import utils
label_desc: Use image node_id 3 to create a new IndexedDataset object from inherited base classes: Dataset with example: obj = IndexedDataset()