code: def test_forecasts_at_each_step():
      dataset = datasets.AirlinePassengers()
      model = MeanForecaster()
      metric = metrics.MAE()
      horizon = 12
      grace_period = 1
  
      steps = time_series.iter_evaluate(
          dataset=dataset,
          model=model,
          metric=metric,
          horizon=horizon,
          grace_period=grace_period,
      )
  
      _, _, y_pred, _ = next(steps)
      assert y_pred == [112] * horizon
      _, _, y_pred, _ = next(steps)
      assert y_pred == [(112 + 118) / 2] * horizon
      _, _, y_pred, _ = next(steps)
      assert y_pred == [(112 + 118 + 132) / 3] * horizon
      _, _, y_pred, _ = next(steps)
      assert y_pred == [(112 + 118 + 132 + 129) / 4] * horizon
  
      n_steps = sum(
          1
          for _ in time_series.iter_evaluate(
              dataset=dataset,
              model=model,
              metric=metric,
              horizon=horizon,
              grace_period=grace_period,
          )
      )
      assert n_steps == dataset.n_samples - horizon - grace_period
  
file_path: river/river/time_series/test_evaluate.py
imports: from __future__ import annotations
  from river import datasets, metrics, stats, time_series
label_desc: Use image node_id 1 for calling a global function with example usage: test_forecasts_at_each_step() without return types