code: def _adjusted_metric(metric, metric_kwargs, p=None):
      metric_kwargs = metric_kwargs or {}
      if metric == "minkowski":
          metric_kwargs["p"] = p
          if p == 2:
              metric = "euclidean"
      return metric, metric_kwargs
  
imports: import warnings
  from numbers import Integral
  import numpy
  from sklearn.neighbors._base import _check_precomputed
  from ..base import ClassifierMixin, _fit_context
  from ..metrics._pairwise_distances_reduction import ArgKminClassMode, RadiusNeighborsClassMode
  from ..utils._param_validation import StrOptions
  from ..utils.arrayfuncs import _all_with_any_reduction_axis_1
  from ..utils.extmath import weighted_mode
  from ..utils.fixes import _mode
  from ..utils.validation import _is_arraylike, _num_samples, check_is_fitted
  from ._base import KNeighborsMixin, NeighborsBase, RadiusNeighborsMixin, _get_weights
label_desc: Use image node_id 1 for calling a global function with example usage: _adjusted_metric(metric, metric_kwargs, p) and returns: metric,  metric_kwargs