code: def get_cv(cv):
      """Return a 'validated' CV iterator."""
  
      if cv is None:
          return KFold(n_splits=5)
      if isinstance(cv, numbers.Integral):
          return KFold(n_splits=cv)
      if hasattr(cv, "split") and not isinstance(cv, str):
          return cv  # str have split
  
      raise ValueError(
          "Wrong CV object. Expecting None, an int or CV iterator, "
          "got a {}".format(type(cv))
      )
  
imports: import numbers
  from collections import defaultdict
  from itertools import chain
  from math import ceil, floor
  import numpy
  from ..utils import get_rng
label_desc: Use image node_id 1 for calling a global function with example usage: get_cv(cv) and returns: KFold, KFold, cv