code: def test_distance_mahalanobis_scipy(rndstate, get_mats, mean):
      """Test equivalence between pyriemann and scipy for real data"""
      n_channels, n_times = 3, 100
      X = rndstate.randn(n_channels, n_times)
      C = get_mats(1, n_channels, "spd")[0]
  
      Cinv = np.linalg.inv(C)
      y = np.zeros(n_channels)
      dist_sp = [mahalanobis(x, y, Cinv) for x in X.T]
  
      if mean:
          mean = np.zeros((n_channels, 1))
      else:
          mean = None
      dist_pr = distance_mahalanobis(X, C, mean=mean)
  
      assert_array_almost_equal(dist_sp, dist_pr)
  
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 21 for calling a global function with example usage: test_distance_mahalanobis_scipy(rndstate, get_mats, mean) without return types