code: def pairwise_distances(xq, xb, metric=METRIC_L2, metric_arg=0):
      """compute the whole pairwise distance matrix between two sets of
      vectors"""
      xq = np.ascontiguousarray(xq, dtype="float32")
      xb = np.ascontiguousarray(xb, dtype="float32")
      nq, d = xq.shape
      nb, d2 = xb.shape
      assert d == d2
      dis = np.empty((nq, nb), dtype="float32")
      if metric == METRIC_L2:
          pairwise_L2sqr(
              d, nq, swig_ptr(xq), nb, swig_ptr(xb), swig_ptr(dis)
          )
      elif metric == METRIC_INNER_PRODUCT:
          dis[:] = xq @ xb.T
      else:
          pairwise_extra_distances(
              d,
              nq,
              swig_ptr(xq),
              nb,
              swig_ptr(xb),
              metric,
              metric_arg,
              swig_ptr(dis),
          )
      return dis
  
imports: import numpy
  from faiss.loader import *
  import faiss
  import collections.abc
label_desc: Use image node_id 3 for calling a global function with example usage: pairwise_distances(xq, xb, metric, metric_arg) and returns: dis