class_docstr: Base class for KFold, GroupKFold, and StratifiedKFold
code: def __init__(self, n_splits, *, shuffle, random_state):
      if not isinstance(n_splits, numbers.Integral):
          raise ValueError(
              "The number of folds must be of Integral type. "
              "%s of type %s was passed." % (n_splits, type(n_splits))
          )
      n_splits = int(n_splits)
  
      if n_splits <= 1:
          raise ValueError(
              "k-fold cross-validation requires at least one"
              " train/test split by setting n_splits=2 or more,"
              " got n_splits={0}.".format(n_splits)
          )
  
      if not isinstance(shuffle, bool):
          raise TypeError(
              "shuffle must be True or False; got {0}".format(shuffle)
          )
  
      if (
          not shuffle and random_state is not None
      ):  # None is the default
          raise ValueError(
              "Setting a random_state has no effect since shuffle is "
              "False. You should leave "
              "random_state to its default (None), or set shuffle=True.",
          )
  
      self.n_splits = n_splits
      self.shuffle = shuffle
      self.random_state = random_state
  
imports: import numbers
  from abc import ABCMeta, abstractmethod
  from itertools import chain
  from math import ceil, floor
  import numpy
  from ...core import ExecutableTuple
  from ...None import tensor
  from ...tensor.utils import check_random_state
  from ..utils import shuffle
  from ..utils.validation import indexable, _num_samples
label_desc: Use image node_id 1 to create a new _BaseKFold object from inherited base classes: BaseCrossValidator with example: obj = _BaseKFold(n_splits)