code: def check_cv(cv, enforce_start_with_window=False):
      """Check CV generators.
  
      Parameters
      ----------
      cv : CV generator
  
      Raises
      ------
      ValueError
          if cv does not have the required attributes.
      """
      from sktime.split.base import BaseSplitter
  
      if not isinstance(cv, BaseSplitter):
          raise TypeError(f"`cv` is not an instance of {BaseSplitter}")
  
      if enforce_start_with_window:
          if (
              hasattr(cv, "start_with_window")
              and not cv.start_with_window
          ):
              raise ValueError(
                  "`start_with_window` must be set to True"
              )
  
      return cv
  
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 4 for calling a global function with example usage: check_cv(cv, enforce_start_with_window) and returns: cv