'Generates indices to split data into training and test set.
Parameters
X : array-like, shape (n_samples, n_features)
Training data, where n_samples is the number of samples
and n_features is the number of features.
y : array-like, of length n_samples
The target variable for supervised learning problems.
groups : array-like, with shape (n_samples,), optional
Group labels for the samples used while splitting the dataset into
train/test set.
Returns
train : ndarray
The training set indices for that split.
test : ndarray
The testing set indices for that split.'

def split(self, X, y=None, groups=None):

    n_repeats = self.n_repeats
    rng = check_random_state(self.random_state)
    for idx in range(n_repeats):
        cv = self.cv(random_state=rng, shuffle=True, **self.cvargs)
        for (train_index, test_index) in cv.split(X, y, groups):
            (yield (train_index, test_index))
