code: def cart_distance(pts1, pts2):
      """Cartesian distance between `pts1` and `pts2`
  
      If either of `pts1` or `pts2` is 2D, then we take the first
      dimension to index points, and the second indexes coordinate.  More
      generally, we take the last dimension to be the coordinate
      dimension.
  
      Parameters
      ----------
      pts1 : (N,R) or (R,) array_like
         where N is the number of points and R is the number of
         coordinates defining a point (``R==3`` for 3D)
      pts2 : (N,R) or (R,) array_like
         where N is the number of points and R is the number of
         coordinates defining a point (``R==3`` for 3D).  It should be
         possible to broadcast `pts1` against `pts2`
  
      Returns
      -------
      d : (N,) or (0,) array
         Cartesian distances between corresponding points in `pts1` and
         `pts2`
  
      See Also
      --------
      sphere_distance : distance between points on sphere surface
  
      Examples
      --------
      >>> cart_distance([0,0,0], [0,0,3])
      3.0
      """
      sqs = np.subtract(pts1, pts2) ** 2
      return np.sqrt(np.sum(sqs, axis=-1))
  
imports: import itertools
  import math
  import numpy
  import numpy.linalg
label_desc: Use image node_id 9 for calling a global function with example usage: cart_distance(pts1, pts2) and returns: np