code: def test_strategy_mean_seasonal(fh, sp, window_length):
      """Test mean strategy on seasonal data."""
      if (window_length is not None and window_length > sp) or (
          window_length is None
      ):
          f = NaiveForecaster(
              strategy="mean", sp=sp, window_length=window_length
          )
          f.fit(y_train)
          y_pred = f.predict(fh)
  
          # check predicted index
          cutoff = get_cutoff(y_train, return_index=True)
          _assert_correct_pred_time_index(y_pred.index, cutoff, fh)
  
          if window_length is None:
              window_length = len(y_train)
  
          # check values
          fh = check_fh(fh)  # get well formatted fh
          reps = int(np.ceil(max(fh) / sp))
          last_window = (
              y_train.iloc[-window_length:].to_numpy().astype(float)
          )
          last_window = np.pad(
              last_window,
              (sp - len(last_window) % sp, 0),
              "constant",
              constant_values=np.nan,
          )
  
          last_window = last_window.reshape(
              int(np.ceil(len(last_window) / sp)), sp
          )
          expected = np.tile(
              np.nanmean(last_window, axis=0), reps=reps
          )[fh - 1]
          np.testing.assert_array_equal(y_pred, expected)
  
imports: import numpy
  import pandas
  import pytest
  from sktime.datatypes._utilities import get_cutoff
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.forecasting.tests._config import TEST_OOS_FHS, TEST_SPS, TEST_WINDOW_LENGTHS_INT
  from sktime.utils._testing.forecasting import _assert_correct_pred_time_index
  from sktime.utils.validation.forecasting import check_fh
label_desc: Use image node_id 4 for calling a global function with example usage: test_strategy_mean_seasonal(fh, sp, window_length) without return types