def METHOD_NAME(environment: deep_sea.DeepSea):
  """Make stochastic DeepSea demonstration dataset."""
  recorder = DemonstrationRecorder()
  # Use 10*size demos, 80% success, 20% failure.
  num_demos = environment._size * 10  # pylint: disable=protected-access
  num_failures = num_demos // 5
  num_successes = num_demos - num_failures
  successes_saved = 0
  failures_saved = 0
  while (successes_saved < num_successes) or (failures_saved < num_failures):
    _run_optimal_deep_sea_episode(environment, recorder)
    if recorder.episode_reward > 0 and successes_saved < num_successes:
      recorder.record_episode()
      successes_saved += 1
    elif recorder.episode_reward <= 0 and failures_saved < num_failures:
      recorder.record_episode()
      failures_saved += 1
    else:
      recorder.discard_episode()
  return recorder.make_tf_dataset()