code: def _check_params(X, metric, p, metric_params):
      """Check the validity of the input parameters"""
      params = zip(
          ["metric", "p", "metric_params"], [metric, p, metric_params]
      )
      est_params = X.get_params()
      for param_name, func_param in params:
          if func_param != est_params[param_name]:
              raise ValueError(
                  "Got %s for %s, while the estimator has %s for the same parameter."
                  % (func_param, param_name, est_params[param_name])
              )
  
imports: from ..base import ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context
  from ..utils._param_validation import StrOptions
  from ..utils.validation import check_is_fitted
  from ._base import KNeighborsMixin, NeighborsBase, RadiusNeighborsMixin
  from ._unsupervised import NearestNeighbors
label_desc: Use image node_id 1 for calling a global function with example usage: _check_params(X, metric, p, metric_params) without return types