code: def minkowski_distance_p(x, y, p=2):
      """Compute the pth power of the L**p distance between two arrays.
  
      For efficiency, this function computes the L**p distance but does
      not extract the pth root. If `p` is 1 or infinity, this is equal to
      the actual L**p distance.
  
      Parameters
      ----------
      x : (M, K) array_like
          Input array.
      y : (N, K) array_like
          Input array.
      p : float, 1 <= p <= infinity
          Which Minkowski p-norm to use.
  
      Examples
      --------
      >>> from scipy.spatial import minkowski_distance_p
      >>> minkowski_distance_p([[0,0],[0,0]], [[1,1],[0,1]])
      array([2, 1])
  
      """
      x = np.asarray(x)
      y = np.asarray(y)
  
      # Find smallest common datatype with float64 (return type of this function) - addresses #10262.
      # Don't just cast to float64 for complex input case.
      common_datatype = np.promote_types(
          np.promote_types(x.dtype, y.dtype), "float64"
      )
  
      # Make sure x and y are NumPy arrays of correct datatype.
      x = x.astype(common_datatype)
      y = y.astype(common_datatype)
  
      if p == np.inf:
          return np.amax(np.abs(y - x), axis=-1)
      elif p == 1:
          return np.sum(np.abs(y - x), axis=-1)
      else:
          return np.sum(np.abs(y - x) ** p, axis=-1)
  
imports: import numpy
  import warnings
  from .ckdtree import cKDTree, cKDTreeNode
label_desc: Use image node_id 1 for calling a global function with example usage: minkowski_distance_p(x, y, p) and returns: np, np, np