code: def _seasonal_naive(
      y: np.ndarray,  # time series
      h: int,  # forecasting horizon
      fitted: bool,  # fitted values
      season_length: int,  # season length
  ) -> Dict[str, np.ndarray]:
      n = y.size
      season_vals = np.full(season_length, np.nan, np.float32)
      season_samples = min(season_length, n)
      season_vals[:season_samples] = y[-season_samples:]
      out = _repeat_val_seas(season_vals=season_vals, h=h)
      fcst = {"mean": out}
      if fitted:
          fitted_vals = np.empty(n, dtype=np.float32)
          fitted_vals[:season_length] = np.nan
          if n > season_length:
              fitted_vals[season_length:] = y[: n - season_length]
          fcst["fitted"] = fitted_vals
      return fcst
  
file_path: statsforecast/statsforecast/utils.py
imports: from typing import Dict
  import math
  import os
  import warnings
  import numpy
  import pandas
  from scipy.stats import norm
  from utilsforecast.compat import DataFrame
  from utilsforecast.data import generate_series
label_desc: Use image node_id 3 for calling a global function with example usage: _seasonal_naive(y, h, fitted, season_length) and returns: fcst