code: def load_new_checkpoint_when_available(
        self, sess, current_checkpoint, sleep_seconds=10):
      
      # Load the checkpoint.
      while True:
        next_checkpoint = self.load_from_checkpoint(sess)
        if not next_checkpoint or next_checkpoint == current_checkpoint:
          print('Model not yet available, sleeping for %d seconds: '
                'path %s; found: %s' %
                (sleep_seconds,
                 os.path.dirname(self._save_path), current_checkpoint))
          sys.stdout.flush()
          time.sleep(sleep_seconds)
        else:
          return next_checkpoint
docs: Waits for a new checkpoint to be available and then loads it.
  
      Args:
        sess: The current session.
        current_checkpoint: The current checkpoint or None to just load the next
          one.
        sleep_seconds: How long to sleep between checks.
  
      Returns:
        The next checkpoint to use.