code: def _validate_pdist_input(X, m, n, metric_info, **kwargs):
      # get supported types
      types = metric_info.types
      # choose best type
      typ = (
          types[types.index(X.dtype)] if X.dtype in types else types[0]
      )
      # validate data
      X = _convert_to_type(X, out_type=typ)
  
      # validate kwargs
      _validate_kwargs = metric_info.validator
      if _validate_kwargs:
          kwargs = _validate_kwargs(X, m, n, **kwargs)
      return X, typ, kwargs
  
imports: import math
  import warnings
  import numpy
  import dataclasses
  from typing import Optional, Callable
  from functools import partial
  from scipy._lib._util import _asarray_validated
  from .None import _distance_wrap
  from .None import _hausdorff
  from ..linalg import norm
  from ..special import rel_entr
  from .None import _distance_pybind
label_desc: Use image node_id 12 for calling a global function with example usage: _validate_pdist_input(X, m, n, metric_info) and returns: X,  typ,  kwargs