code: def test_mask_reducer_single_image_same_with_multiple_jobs(
      data_for_mask_and_reduce, masker, shape_3d_default
  ):
      """Mask and reduce a 3D image and check results is the same \
      when split over several CPUs."""
      data_single = _mask_and_reduce(
          masker, data_for_mask_and_reduce[0], n_components=3
      )
  
      assert data_single.shape == (3, np.prod(shape_3d_default))
  
      # Test n_jobs > 1
      data = _mask_and_reduce(
          masker,
          data_for_mask_and_reduce[0],
          n_components=3,
          n_jobs=2,
          random_state=0,
      )
  
      assert data.shape == (3, np.prod(shape_3d_default))
      assert_array_almost_equal(data_single, data)
  
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 5 for calling a global function with example usage: test_mask_reducer_single_image_same_with_multiple_jobs(data_for_mask_and_reduce, masker, shape_3d_default) without return types