code: def check_sp(sp, enforce_list=False):
      """Validate seasonal periodicity.
  
      Parameters
      ----------
      sp : int or [int/float]
          Seasonal periodicity
      enforce_list : bool, optional (default=False)
          If true, convert sp to list if not list.
  
      Returns
      -------
      sp : int or [int/float]
          Validated seasonal periodicity
      """
      if sp is not None:
          if enforce_list and is_int(sp) and sp >= 1:
              sp = [sp]
          elif (enforce_list and isinstance(sp, list)) or (
              is_int(sp) and sp >= 1
          ):
              pass
          else:
              if enforce_list:
                  raise ValueError(
                      "`sp` must be an int >= 1, [float/int] or None"
                  )
              else:
                  raise ValueError("`sp` must be an int >= 1 or None")
      return sp
  
file_path: sktime/sktime/utils/validation/forecasting.py
imports: from datetime import timedelta
  from typing import Optional, Union
  import numpy
  import pandas
  from sklearn.base import clone, is_regressor
  from sklearn.ensemble import GradientBoostingRegressor
  from sktime.utils.validation import array_is_datetime64, array_is_int, is_date_offset, is_int, is_timedelta
  from sktime.utils.validation.series import check_equal_time_index, check_series
label_desc: Use image node_id 6 for calling a global function with example usage: check_sp(sp, enforce_list) and returns: sp