code: def check_step_length(step_length) -> Optional[int]:
      """Validate window length.
  
      Parameters
      ----------
      step_length : step length for data set.
  
      Returns
      -------
      step_length : int
          if step_length in not none and is int and greater than or equal to 1.
  
      Raises
      ------
      ValueError
          if step_length is negative or not an integer or is None.
      """
      if step_length is None:
          return None
  
      elif is_int(step_length):
          if step_length < 1:
              raise ValueError(
                  f"`step_length` must be a integer >= 1, "
                  f"but found: {step_length}"
              )
          else:
              return step_length
  
      elif is_timedelta(step_length):
          if step_length <= timedelta(0):
              raise ValueError(
                  f"`step_length` must be a positive timedelta, "
                  f"but found: {step_length}"
              )
          else:
              return step_length
  
      elif is_date_offset(step_length):
          if step_length + pd.Timestamp(0) <= pd.Timestamp(0):
              raise ValueError(
                  f"`step_length` must be a positive pd.DateOffset, "
                  f"but found: {step_length}"
              )
          else:
              return step_length
  
      else:
          raise ValueError(
              f"`step_length` must be an integer, timedelta, pd.DateOffset, or None, "
              f"but found: {type(step_length)}"
          )
  
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 5 for calling a global function with example usage: check_step_length(step_length) and returns: None, step_length, step_length, step_length