class_docstr: Saves checkpoints every N steps or seconds.
class_docstr_tok: ["Saves","checkpoints","every","N","steps","or","seconds","."]
code: def _get_saver(self):
      if self._saver is not None:
          return self._saver
      elif self._scaffold is not None:
          return self._scaffold.saver
  
      # Get saver from the SAVERS collection if present.
      collection_key = ops.GraphKeys.SAVERS
      savers = ops.get_collection(collection_key)
      if not savers:
          raise RuntimeError(
              "No items in collection {}. Please add a saver to the collection "
              "or provide a saver or scaffold.".format(collection_key)
          )
      elif len(savers) > 1:
          raise RuntimeError(
              "More than one item in collection {}. "
              "Please indicate which one to use by passing it to the constructor.".format(
                  collection_key
              )
          )
  
      self._saver = savers[0]
      return savers[0]
  
imports: import os
  import threading
  import time
  from typing import Any, List, Optional, Text
  from tensorflow.core.util import event_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import meta_graph
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.saved_model.pywrap_saved_model import metrics
  from tensorflow.python.training import basic_session_run_hooks
  from tensorflow.python.training import monitored_session
  from tensorflow.python.training import saver
  from tensorflow.python.training import session_run_hook
  from tensorflow.python.training import training_util
  from tensorflow.python.training.summary_io import SummaryWriterCache
label_desc: Use image node_id 9 for calling the AsyncCheckpointSaverHook obj's underlying member method code with example usage: obj._get_saver() and returns: savers, self, self