code: def test_mahalanobis2(rng):
      n = 50
      x = rng.standard_normal(size=(n, 3))
      Aa = np.zeros([n, n, 3])
      for i in range(3):
          A = rng.standard_normal(size=(120, n))
          A = np.dot(A.T, A)
          Aa[:, :, i] = A
      i = rng.integers(3)
      mah = np.dot(x[:, i], np.dot(spl.inv(Aa[:, :, i]), x[:, i]))
      f_mah = (multiple_mahalanobis(x, Aa))[i]
  
      assert np.allclose(mah, f_mah)
  
imports: import numpy
  import pytest
  import scipy.linalg
  import scipy.stats
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from scipy.stats import norm
  from nilearn._utils.data_gen import generate_fake_fmri
  from nilearn.glm._utils import full_rank, multiple_fast_inverse, multiple_mahalanobis, pad_contrast, positive_reciprocal, z_score
  from nilearn.glm.first_level import FirstLevelModel, make_first_level_design_matrix
  from nilearn.maskers import NiftiMasker
label_desc: Use image node_id 6 for calling a global function with example usage: test_mahalanobis2(rng) without return types