def _keep_going(epochs, timesteps, episodes,
                num_epochs, num_timesteps, num_episodes):
    """Determine whether we've collected enough data"""

    if (num_epochs) and (epochs >= num_epochs):
        return False
    # If num_episodes is set, stop if limit reached.
    elif num_episodes and episodes >= num_episodes:
        return False
    # If num_steps is set, stop if limit reached.
    elif num_timesteps and timesteps >= num_timesteps:
        return False

    # Otherwise, keep going.
    return True