code: def test_insample_and_outofsample_forecasting():
      n = 20
      df = pd.DataFrame(
          index=pd.period_range("2020-01-01", periods=n, freq="D"),
          data={"value": np.arange(n)},
      )
  
      model = NaiveForecaster(strategy="mean", window_length=7)
      model.fit(df)
  
      assert (
          model.predict(fh=[1, 2, 3]).values.flatten() == [16, 16, 16]
      ).all()
      assert (model.predict(fh=[0]).values.flatten() == [15]).all()
      assert (
          model.predict(fh=[0, 1, 2, 3]).values.flatten()
          == [15, 16, 16, 16]
      ).all()
  
file_path: sktime/sktime/forecasting/tests/test_window_forecasters.py
imports: import numpy
  import pandas
  import pytest
  from sktime.forecasting.base._sktime import _BaseWindowForecaster
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.registry import all_estimators
  from sktime.split import temporal_train_test_split
  from sktime.utils._testing.forecasting import make_forecasting_problem
  from sktime.utils._testing.series import _make_series
label_desc: Use image node_id 2 for calling a global function with example usage: test_insample_and_outofsample_forecasting() without return types