code: def test_pairwise_distance_matrix(get_mats, dist, Y, squared):
      n_matrices_X, n_matrices_Y, n_channels = 6, 4, 5
      X = get_mats(n_matrices_X, n_channels, "spd")
      if Y is None:
          n_matrices_Y = n_matrices_X
          Y_ = X
      else:
          Y = get_mats(n_matrices_Y, n_channels, "spd")
          Y_ = Y
  
      pdist = pairwise_distance(X, Y, metric=dist, squared=squared)
      assert pdist.shape == (n_matrices_X, n_matrices_Y)
  
      for i in range(n_matrices_X):
          for j in range(n_matrices_Y):
              assert np.isclose(
                  pdist[i, j],
                  distance(X[i], Y_[j], metric=dist, squared=squared),
                  atol=1e-5,
                  rtol=1e-5,
              )
  
      if Y is None and dist not in ["kullback", "kullback_right"]:
          assert is_sym(pdist)
      else:
          assert not is_sym(pdist)
  
imports: from conftest import get_distances
  import numpy
  from numpy.testing import assert_array_almost_equal
  from scipy.spatial.distance import euclidean, mahalanobis
  import pytest
  from pytest import approx
  from pyriemann.utils.distance import distance_euclid, distance_harmonic, distance_kullback, distance_kullback_right, distance_kullback_sym, distance_logdet, distance_logeuclid, distance_riemann, distance_wasserstein, distance, pairwise_distance, distance_mahalanobis
  from pyriemann.utils.base import logm
  from pyriemann.utils.geodesic import geodesic
  from pyriemann.utils.test import is_sym
label_desc: Use image node_id 19 for calling a global function with example usage: test_pairwise_distance_matrix(get_mats, dist, Y, squared) without return types