code: def test_mahalanobis_distance():
      sdm = SampleDistortionMetric(sd_rand, sd_rand2)
      assert np.isclose(
          sdm.total_mahalanobis_distance(),
          np.diag(
              cdist(rand[:, :3], rand2[:, :3], "mahalanobis")
          ).sum(),
      )
  
file_path: AIF360/tests/test_sample_distortion_metric.py
imports: import numpy
  import pandas
  from scipy.spatial.distance import cdist
  from aif360.datasets import StructuredDataset
  from aif360.metrics import SampleDistortionMetric
label_desc: Use image node_id 3 for calling a global function with example usage: test_mahalanobis_distance() without return types