code: def test_mahalanobis2(self):
      x = np.random.rand(100, 3, 4)
      Aa = np.zeros([100, 100, 3, 4])
      for i in range(3):
          for j in range(4):
              A = np.random.rand(100, 100)
              A = np.dot(A.T, A)
              Aa[:, :, i, j] = A
      i = np.random.randint(3)
      j = np.random.randint(4)
      mah = np.dot(
          x[:, i, j], np.dot(np.linalg.inv(Aa[:, :, i, j]), x[:, i, j])
      )
      f_mah = (mahalanobis(x, Aa))[i, j]
      assert np.allclose(mah, f_mah)
  
file_path: nipy/nipy/labs/utils/tests/test_misc.py
imports: import numpy
  from numpy.testing import TestCase, assert_almost_equal
  from scipy import special
  from ..routines import gamln, mahalanobis, median, psi
label_desc: Use image node_id 5 for calling the TestAll obj's underlying member method code with example usage: obj.test_mahalanobis2() without return types