# Path: envlogger/step_data.py
# class StepData(NamedTuple):


from typing import Callable, List, Union
from envlogger import step_data
import numpy as np

  Args:
    step_interval: Must be a positive integer.
  Raises:
    ValueError: When `step_interval` is not a positive integer.
  """
  if step_interval <= 0:
    raise ValueError(f'step_interval must be positive, got {step_interval}')

  def f(unused_data: step_data.StepData) -> bool:
    should_log = f.step_counter % step_interval == 0
    f.step_counter += 1
    return should_log

  f.step_counter = 0
  return f


def bernoulli_step_scheduler(keep_probability: float) -> Scheduler:
  """Returns a closure that returns True with probability `keep_probability`.

  Args:
    keep_probability: Must be within [0,1].
  Raises:
    ValueError: When `keep_probability` is not in [0,1].
  """
  if keep_probability < 0.0 or keep_probability > 1.0:
    raise ValueError(
        f'keep_probability must be in [0,1], got: {keep_probability}')


# Path: envlogger/step_data.py
# class StepData(NamedTuple):


# Path: envlogger/backends/schedulers.py
from typing import Callable, List, Union
from envlogger import step_data
import numpy as np


  Args:
    step_interval: Must be a positive integer.
  Raises:
    ValueError: When `step_interval` is not a positive integer.
  """
  if step_interval <= 0:
    raise ValueError(f'step_interval must be positive, got {step_interval}')

  def f(unused_data: step_data.StepData) -> bool:
    should_log = f.step_counter % step_interval == 0
    f.step_counter += 1
    return should_log

  f.step_counter = 0
  return f


def bernoulli_step_scheduler(keep_probability: float) -> Scheduler:
  """Returns a closure that returns True with probability `keep_probability`.

  Args:
    keep_probability: Must be within [0,1].
  Raises:
    ValueError: When `keep_probability` is not in [0,1].
  """
  if keep_probability < 0.0 or keep_probability > 1.0:
    raise ValueError(
        f'keep_probability must be in [0,1], got: {keep_probability}')


  def f(unused_data: step_data.StepData) -> bool: