class_docstr: Stratified K-Folds cross-validator that ensures that there is always at least
  1 sample per class in the training set.
code: def split(self, X, y=None, groups=None):  # type: ignore
      X, y, groups = indexable(X, y, groups)
      n_samples = _num_samples(X)
      if self.n_splits > n_samples:
          raise ValueError(
              f"Cannot have number of splits n_splits={self.n_splits} greater"
              f" than the number of samples: n_samples={n_samples}."
          )
  
      for train, test in super().split(X, y, groups):
          all_classes = np.unique(y)
          train_classes = np.unique(y[train])
          train = list(train)
          test = list(test)
          missing_classes = set(all_classes) - set(train_classes)
          if len(missing_classes) > 0:
              # print(missing_classes)
              for diff in missing_classes:
                  # print(len(train), len(test))
                  to_move = np.where(y[test] == diff)[0][0]
                  # print(y[test][to_move])
                  train = train + [test[to_move]]
                  del test[to_move]
                  # print(len(train), len(test))
          train = np.array(train, dtype=int)
          test = np.array(test, dtype=int)
  
          yield train, test
  
file_path: auto-sklearn/autosklearn/evaluation/splitter.py
imports: import warnings
  import numpy
  from sklearn.model_selection import StratifiedKFold, StratifiedShuffleSplit
  from sklearn.model_selection._split import _validate_shuffle_split
  from sklearn.utils import _approximate_mode, check_random_state, indexable
  from sklearn.utils.multiclass import type_of_target
  from sklearn.utils.validation import _num_samples, check_array, column_or_1d
label_desc: Use image node_id 2 for calling the CustomStratifiedKFold obj's underlying member method code with example usage: obj.split(X, y, groups) without return types