code: def test_distance_riemann_properties(kind, get_mats):
      n_channels = 6
      mats = get_mats(2, n_channels, kind)
      A, B = mats[0], mats[1]
      dist_AB = distance_riemann(A, B)
  
      # exponential metric increasing property, Eq(6.8) in [Bhatia2007]
      assert dist_AB >= np.linalg.norm(logm(A) - logm(B))
  
      # invariance under inversion
      assert dist_AB == approx(
          distance_riemann(np.linalg.inv(A), np.linalg.inv(B))
      )
  
      # congruence-invariance
      W = np.random.normal(
          size=(n_channels, n_channels)
      )  # must be invertible
      WAW, WBW = W @ A @ W.T, W @ B @ W.T
      assert dist_AB == approx(distance_riemann(WAW, WBW))
  
      # proportionality, Eq(6.12) in [Bhatia2007]
      alpha = np.random.uniform()
      dist_1 = distance_riemann(
          A, geodesic(A, B, alpha, metric="riemann")
      )
      dist_2 = alpha * distance_riemann(A, B)
      assert dist_1 == approx(dist_2)
  
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 16 for calling a global function with example usage: test_distance_riemann_properties(kind, get_mats) without return types