def _raise_for_params(params, owner, method):
        """Raise an error if metadata routing is not enabled and params are passed."""
        from sklearn.utils._metadata_requests import _routing_enabled

        caller = (
            f"{owner.__class__.__name__}.{method}"
            if method
            else owner.__class__.__name__
        )
        if not _routing_enabled() and params:
            raise ValueError(
                f"Passing extra keyword arguments to {caller} is only supported if"
                " enable_metadata_routing=True, which you can set using"
                " `sklearn.set_config`. See the User Guide"
                " <https://scikit-learn.org/stable/metadata_routing.html> for more"
                f" details. Extra parameters passed are: {set(params)}"
            )
Raise an error if metadata routing is not enabled and params are passed.
imblearn/utils/_sklearn_compat.py