def _permutation_test_score(estimator, X, y, labels, cv, scorer):
    avg_score = []
    for train, test in cv.split(X, y, labels):
        estimator.fit(X[train], y[train])
        avg_score.append(scorer(estimator, X[test], y[test]))
    return np.mean(avg_score)
Auxiliary function for permutation_test_score
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/model_selection/_validation.py/_permutation_test_score