class_docstr: Dataset with additional indexing information.
docstr: Save newly-created datapoints to disk.
  
  Args:
    examples: A list of datapoints to save.
    path: The path to save the datapoints to.
  
  Returns:
    (string) The file path of the saved datapoints.
docstr_tok: ["Save","newly-created","datapoints","to","disk",".","Args",":","examples",":","A","list","of","datapoints","to","save",".","path",":","The","path","to","save","the","datapoints","to",".","Returns",":","(","string",")","The","file","path","of","the","saved","datapoints","."]
code: def save(self, examples: list[IndexedInput], path: str):
      """Save newly-created datapoints to disk.
  
      Args:
        examples: A list of datapoints to save.
        path: The path to save the datapoints to.
  
      Returns:
        (string) The file path of the saved datapoints.
      """
      # Attempt to save the datapoints using the base save method, which
      # datasets can override. Then also save in the lit json format and save
      # the spec as well.
      if not path.endswith(LIT_FILE_EXTENSION):
          if (base_dataset := self._base) is not None:
              base_dataset.save(examples, path)
          path += LIT_FILE_EXTENSION
  
      write_examples(examples, path)
      write_spec(self.spec(), path + LIT_SPEC_EXTENSION)
  
      return path
  
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 8 for calling the IndexedDataset obj's underlying member method code with example usage: obj.save(examples, path) and returns: path