code: def testKeepAll(self):
      checkpoint = util.Checkpoint()
      directory = os.path.join(
          self.get_temp_dir(),
          # Avoid sharing directories between eager and graph
          # TODO(allenl): stop run_in_graph_and_eager_modes reusing directories
          str(context.executing_eagerly()),
      )
      manager = checkpoint_management.CheckpointManager(
          checkpoint, directory, max_to_keep=None
      )
      first_path = manager.save()
      second_path = manager.save()
      third_path = manager.save()
      self.assertTrue(
          checkpoint_management.checkpoint_exists(third_path)
      )
      self.assertTrue(
          checkpoint_management.checkpoint_exists(second_path)
      )
      self.assertTrue(
          checkpoint_management.checkpoint_exists(first_path)
      )
      self.assertEqual(third_path, manager.latest_checkpoint)
      self.assertEqual(
          [first_path, second_path, third_path], manager.checkpoints
      )
      del manager
      manager = checkpoint_management.CheckpointManager(
          checkpoint, directory, max_to_keep=None
      )
      fourth_path = manager.save()
      self.assertEqual(
          [first_path, second_path, third_path, fourth_path],
          manager.checkpoints,
      )
      del manager
      manager = checkpoint_management.CheckpointManager(
          checkpoint, directory, max_to_keep=3
      )
      self.assertEqual(
          [first_path, second_path, third_path, fourth_path],
          manager.checkpoints,
      )
      self.assertTrue(
          checkpoint_management.checkpoint_exists(fourth_path)
      )
      self.assertTrue(
          checkpoint_management.checkpoint_exists(third_path)
      )
      self.assertTrue(
          checkpoint_management.checkpoint_exists(second_path)
      )
      self.assertTrue(
          checkpoint_management.checkpoint_exists(first_path)
      )
      fifth_path = manager.save()
      self.assertEqual(
          [third_path, fourth_path, fifth_path], manager.checkpoints
      )
      self.assertTrue(
          checkpoint_management.checkpoint_exists(fifth_path)
      )
      self.assertTrue(
          checkpoint_management.checkpoint_exists(fourth_path)
      )
      self.assertTrue(
          checkpoint_management.checkpoint_exists(third_path)
      )
      self.assertFalse(
          checkpoint_management.checkpoint_exists(second_path)
      )
      self.assertFalse(
          checkpoint_management.checkpoint_exists(first_path)
      )
  
imports: import contextlib
  import os
  import pathlib
  import shutil
  import tempfile
  from google.protobuf import text_format
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import checkpoint_management
  from tensorflow.python.eager import context
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.training import saver
  from tensorflow.python.training.checkpoint_state_pb2 import CheckpointState
label_desc: Use image node_id 2 for calling the CheckpointManagerTest obj's underlying member method code with example usage: obj.testKeepAll() without return types