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: import itertools
  from ..base import ClassNamePrefixFeaturesOutMixin, TransformerMixin, _fit_context
  from ..utils._param_validation import Integral, Interval, Real, StrOptions, validate_params
  from ..utils.validation import check_is_fitted
  from ._base import VALID_METRICS, 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