def METHOD_NAME(
    selector, X, y, indices, groups=None, feature_groups=None, **fit_params
):
    """
    calculate the cross-validation score for feature data `X` and target variable
     `y`.
    Parameters
    ---------
    selector : objcet with attributes est_` (estimator), `cv` (number of folds
    in cross-validation), and `pre_dispatch`()
    X : numpy.ndarray
        A 2D array consisting of feature data, where each column corresponds to
        one feature, and each row corresponds to one instance (or observation)
    y : numpy.ndarray
        A 1D array consiting of tartget values
    indices : list or tuple
        A list or tuple of interger numbers. When `feature_groups` is not provided,
        i.e. None (default), the values in indices represent the column indices of
        X that should be consdered throughout the calculation of cross validation
        score. When `feature_groups` is not None, the indices represent the indices
        of the groups of features that should be considered through the calculation
        of cross-validation score.
    groups : array-like, with shape (n_samples,), optional
        Group labels for the samples used while splitting the dataset into
        train/test set. Passed to the fit method of the cross-validator.
    feature_groups : list or None (default: None)
        Optional argument for treating certain features as a group.
        This means, the features within a group are always selected together,
        never split.
        For example, `feature_groups=[[1], [2], [3, 4, 5]]`
        specifies 3 feature groups.e
    fit_params : dict of string -> object, optional
        Parameters to pass to to the fit method of classifier.
    Returns
    -------
    indices : List or tuple
        This is exactly the same as the input `indices`
    scores : array
        This is an array of cv scores, with length equal to the cv value.
    """
    if feature_groups is None:
        feature_groups = [[i] for i in range(X.shape[1])]
    IDX = _merge_lists(feature_groups, indices)
    if selector.cv:
        scores = cross_val_score(
            selector.est_,
            X[:, IDX],
            y,
            groups=groups,
            cv=selector.cv,
            scoring=selector.scorer,
            n_jobs=1,
            pre_dispatch=selector.pre_dispatch,
            fit_params=fit_params,
        )
    else:
        selector.est_.fit(X[:, IDX], y, **fit_params)
        scores = np.array([selector.scorer(selector.est_, X[:, IDX], y)])
    return indices, scores