<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_new_checkpoint_when_available( self, sess, current_checkpoint, sleep_seconds=10):
 """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. """

    # 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