code: def test_cdist_(self, xp, scp):
      a = self._make_matrix(xp, self.dtype, self.order)
      b = self._make_matrix(xp, self.dtype, self.order)
  
      # RussellRao expects boolean arrays
      if self.metric == "russellrao":
          a[a < 0.5] = 0
          a[a >= 0.5] = 1
          b[b < 0.5] = 0
          b[b >= 0.5] = 1
  
      # JensenShannon expects probability arrays
      elif self.metric == "jensenshannon":
          a_n = a
          b_n = b
          if xp == cupy:
              a_n = a_n.get()
              b_n = b_n.get()
  
          # l1 normalization is different between cupy and numpy
          # so use numpy.
          norm = numpy.sum(a_n, axis=1)
          a = (a_n.T / norm).T
          if xp == cupy:
              a = cupy.asarray(a)
  
          norm = numpy.sum(b_n, axis=1)
          b = (b_n.T / norm).T
          if xp == cupy:
              b = cupy.asarray(b)
  
      if self.metric == "minkowski":
          out = scp.spatial.distance.cdist(
              a, b, metric=self.metric, p=self.p
          ).astype(self.dtype)
      else:
          out = scp.spatial.distance.cdist(
              a, b, metric=self.metric
          ).astype(self.dtype)
  
      print(str(out.shape))
      return out
  
imports: import unittest
  import pytest
  import numpy
  import cupy
  import cupyx.scipy.spatial.distance
  from cupy import testing
label_desc: Use image node_id 2 for calling the TestCdist obj's underlying member method code with example usage: obj.test_cdist_(xp, scp) and returns: out