code: def test_distance_wrapper_between_set_and_matrix(dist, get_mats):
      n_matrices, n_channels = 10, 4
      mats = get_mats(n_matrices, n_channels, "spd")
      assert distance(mats, mats[-1], metric=dist).shape == (
          n_matrices,
          1,
      )
  
      n_sets = 5
      covs_4d = np.asarray([mats for _ in range(n_sets)])
      with pytest.raises(ValueError):
          distance(covs_4d, mats, metric=dist)
  
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 18 for calling a global function with example usage: test_distance_wrapper_between_set_and_matrix(dist, get_mats) without return types