class_docstr: Dataset with additional indexing information.
docstr: Create indexed versions of inputs.
docstr_tok: ["Create","indexed","versions","of","inputs","."]
code: def index_inputs(
      self, examples: list[lit_types.JsonDict]
  ) -> list[IndexedInput]:
      """Create indexed versions of inputs."""
      indexed = []
      for example in examples:
          ex_id = example.get(INPUT_ID_FIELD, self.id_fn(example))
          ex_meta = example.get(
              INPUT_META_FIELD,
              lit_types.InputMetadata(
                  added=None, parentId=None, source=None
              ),
          )
          indexed.append(
              IndexedInput(
                  data=types.MappingProxyType(
                      example
                      | {
                          INPUT_ID_FIELD: ex_id,
                          INPUT_META_FIELD: ex_meta,
                      }
                  ),
                  id=ex_id,
                  meta=ex_meta,
              )
          )
      return indexed
  
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 2 for calling the IndexedDataset obj's underlying member method code with example usage: obj.index_inputs(examples) and returns: indexed