code: def check_cv(cv=None):
      """Input checker utility for building a cross-validator
  
      Parameters
      ----------
      cv : BaseTSCrossValidator or None, optional (default=None)
          An instance of CV or None. Possible inputs:
  
          - None, to use a default RollingForecastCV
          - A BaseTSCrossValidator as a passthrough
      """
      cv = RollingForecastCV() if cv is None else cv
      if not isinstance(cv, BaseTSCrossValidator):
          raise TypeError(
              "cv should be an instance of BaseTSCrossValidator or "
              "None, but got %r (type=%s)" % (cv, type(cv))
          )
      return cv
  
imports: import abc
  import numpy
  from sklearn.base import BaseEstimator
  from sklearn.utils.validation import indexable
  from sklearn.model_selection import train_test_split
label_desc: Use image node_id 2 for calling a global function with example usage: check_cv(cv) and returns: cv