code: def test_mask_reducer_reduced_data_is_orthogonal(
      data_for_mask_and_reduce, masker, shape_3d_default
  ):
      """Test that the reduced data is orthogonal."""
      data = _mask_and_reduce(
          masker,
          data_for_mask_and_reduce[0],
          n_components=3,
          random_state=0,
      )
  
      assert data.shape == (3, np.prod(shape_3d_default))
  
      cov = data.dot(data.T)
      cov_diag = np.zeros((3, 3))
      for i in range(3):
          cov_diag[i, i] = cov[i, i]
  
      assert_array_almost_equal(cov, cov_diag)
  
file_path: nilearn/nilearn/decomposition/tests/test_base.py
imports: import numpy
  import pytest
  from nibabel import Nifti1Image
  from numpy.testing import assert_array_almost_equal
  from scipy import linalg
  from nilearn.conftest import _affine_eye, _img_3d_ones, _rng
  from nilearn.decomposition._base import _fast_svd, _mask_and_reduce
  from nilearn.maskers import MultiNiftiMasker
label_desc: Use image node_id 6 for calling a global function with example usage: test_mask_reducer_reduced_data_is_orthogonal(data_for_mask_and_reduce, masker, shape_3d_default) without return types