parameters: (checkpoint_dir,
                              last_checkpoint,
                              seconds_to_sleep=1,
                              timeout=None)
docstring: Waits until a new checkpoint file is found.
  
    Args:
      checkpoint_dir: The directory in which checkpoints are saved.
      last_checkpoint: The last checkpoint path used.
      seconds_to_sleep: The number of seconds to sleep for before looking for a
        new checkpoint.
      timeout: The maximum amount of time to wait. If left as `None`, then the
        process will wait indefinitely.
  
    Returns:
      a new checkpoint path, or None if the timeout was reached.
docstring_summary: Waits until a new checkpoint file is found.
docstring_tokens: Waits until a new checkpoint file is found .
function: def wait_for_new_checkpoint(checkpoint_dir,
                              last_checkpoint,
                              seconds_to_sleep=1,
                              timeout=None):
    """Waits until a new checkpoint file is found.
  
    Args:
      checkpoint_dir: The directory in which checkpoints are saved.
      last_checkpoint: The last checkpoint path used.
      seconds_to_sleep: The number of seconds to sleep for before looking for a
        new checkpoint.
      timeout: The maximum amount of time to wait. If left as `None`, then the
        process will wait indefinitely.
  
    Returns:
      a new checkpoint path, or None if the timeout was reached.
    """
    stop_time = time.time() + timeout if timeout is not None else None
    while True:
      checkpoint_path = tf_saver.latest_checkpoint(checkpoint_dir)
      if checkpoint_path is None or checkpoint_path == last_checkpoint:
        if stop_time is not None and time.time() + seconds_to_sleep > stop_time:
          return None
        time.sleep(seconds_to_sleep)
      else:
        return checkpoint_path
function_tokens: def wait_for_new_checkpoint ( checkpoint_dir , last_checkpoint , seconds_to_sleep = 1 , timeout = None ) : stop_time = time . time ( ) + timeout if timeout is not None else None while True : checkpoint_path = tf_saver . latest_checkpoint ( checkpoint_dir ) if checkpoint_path is None or checkpoint_path == last_checkpoint : if stop_time is not None and time . time ( ) + seconds_to_sleep > stop_time : return None time . sleep ( seconds_to_sleep ) else : return checkpoint_path