class_docstr: K-Folds cross-validator
  
  Provides train/test indices to split data in train/test sets. Split
  dataset into k consecutive folds (without shuffling by default).
  
  Each fold is then used once as a validation while the k - 1 remaining
  folds form the training set.
  
  Parameters
  ----------
  n_splits : int, default=5
      Number of folds. Must be at least 2.
  
  shuffle : boolean, optional
      Whether to shuffle the data before splitting into batches.
  
  random_state : int, RandomState instance or None, optional, default=None
      If int, random_state is the seed used by the random number generator;
      If RandomState instance, random_state is the random number generator;
      If None, the random number generator is the RandomState instance used
      by `np.random`. Used when ``shuffle`` == True.
class_docstr_tok: ["K-Folds","cross-validator","Provides","train\/test","indices","to","split","data","in","train\/test","sets",".","Split","dataset","into","k","consecutive","folds","(","without","shuffling","by","default",")",".","Each","fold","is","then","used","once","as","a","validation","while","the","k","-","1","remaining","folds","form","the","training","set",".","Parameters","--","--","--","--","--","n_splits",":","int",",","default=5","Number","of","folds",".","Must","be","at","least","2.","shuffle",":","boolean",",","optional","Whether","to","shuffle","the","data","before","splitting","into","batches",".","random_state",":","int",",","RandomState","instance","or","None",",","optional",",","default=None","If","int",",","random_state","is","the","seed","used","by","the","random","number","generator",";","If","RandomState","instance",",","random_state","is","the","random","number","generator",";","If","None",",","the","random","number","generator","is","the","RandomState","instance","used","by","`","np.random","`",".","Used","when","``","shuffle","``","==","True","."]
code: def split(self, X, y=None, groups=None):
      X = check_array(X)
      n_samples = X.shape[0]
      n_splits = self.n_splits
      fold_sizes = np.full(n_splits, n_samples // n_splits, dtype=int)
      fold_sizes[: n_samples % n_splits] += 1
  
      chunks = X.chunks[0]
      seeds = [None] * len(chunks)
      if self.shuffle:
          rng = check_random_state(self.random_state)
          seeds = draw_seed(
              rng, 0, _I4MAX, size=len(chunks), dtype="uint"
          )
  
      test_current = 0
      for fold_size in fold_sizes:
          test_start, test_stop = test_current, test_current + fold_size
          yield self._split(
              test_start, test_stop, n_samples, chunks, seeds
          )
          test_current = test_stop
  
imports: import itertools
  import logging
  import numbers
  import warnings
  import dask
  import dask.array
  import dask.dataframe
  import numpy
  import sklearn.model_selection
  from sklearn.model_selection._split import BaseCrossValidator, _validate_shuffle_split
  from sklearn.utils import check_random_state
  from dask_ml._compat import DASK_2130, DASK_VERSION
  from dask_ml.utils import check_array, check_matching_blocks
  from .._utils import draw_seed
label_desc: Use image node_id 2 for calling the KFold obj's underlying member method code with example usage: obj.split(X, y, groups) without return types