def validate_data(
        _estimator,
        /,
        X="no_validation",
        y="no_validation",
        reset=True,
        validate_separately=False,
        skip_check_array=False,
        **kwargs,
    ):
        """Validate input data and set or check feature names and counts of the input.

        See the original scikit-learn documentation:
        https://scikit-learn.org/stable/modules/generated/sklearn.utils.validation.validate_data.html#sklearn.utils.validation.validate_data
        """
        if skip_check_array:
            _check_n_features(_estimator, X, reset=reset)
            _check_feature_names(_estimator, X, reset=reset)

            no_val_X = isinstance(X, str) and X == "no_validation"
            no_val_y = y is None or isinstance(y, str) and y == "no_validation"
            if not no_val_X and no_val_y:
                out = X
            elif no_val_X and not no_val_y:
                out = y
            else:
                out = X, y
            return out
        else:
            if "ensure_all_finite" in kwargs:
                force_all_finite = kwargs.pop("ensure_all_finite")
            else:
                force_all_finite = True
            return _estimator._validate_data(
                X=X,
                y=y,
                reset=reset,
                validate_separately=validate_separately,
                force_all_finite=force_all_finite,
                **kwargs,
            )
Validate input data and set or check feature names and counts of the input.

        See the original scikit-learn documentation:
        https://scikit-learn.org/stable/modules/generated/sklearn.utils.validation.validate_data.html#sklearn.utils.validation.validate_data
        
imblearn/utils/_sklearn_compat.py