code: def test_compute_multi_brain_mask():
      with pytest.raises(TypeError):
          compute_multi_brain_mask([])
  
      # Check error raised if images with different shapes are given as input
      imgs = [
          data_gen.generate_mni_space_img(res=8, random_state=0)[0],
          data_gen.generate_mni_space_img(res=12, random_state=0)[0],
      ]
      with pytest.raises(ValueError):
          compute_multi_brain_mask(imgs)
  
      # Check results are the same if affine is the same
      imgs1 = [
          data_gen.generate_mni_space_img(res=9, random_state=0)[0],
          data_gen.generate_mni_space_img(res=9, random_state=1)[0],
      ]
      imgs2 = [
          data_gen.generate_mni_space_img(res=9, random_state=2)[0],
          data_gen.generate_mni_space_img(res=9, random_state=3)[0],
      ]
      mask1 = compute_multi_brain_mask(imgs1, threshold=0.2)
      mask2 = compute_multi_brain_mask(imgs2, threshold=0.2)
      assert_array_equal(get_data(mask1), get_data(mask2))
  
imports: import warnings
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from numpy.testing import assert_array_equal
  from sklearn.preprocessing import StandardScaler
  from nilearn import masking
  from nilearn._utils import data_gen
  from nilearn._utils.exceptions import DimensionError
  from nilearn._utils.testing import write_imgs_to_path
  from nilearn.conftest import _rng
  from nilearn.image import get_data, high_variance_confounds
  from nilearn.maskers import NiftiMasker
  from nilearn.masking import _MaskWarning, _unmask_3d, _unmask_4d, compute_background_mask, compute_brain_mask, compute_epi_mask, compute_multi_brain_mask, compute_multi_epi_mask, extrapolate_out_mask, intersect_masks, unmask, unmask_from_to_3d_array
label_desc: Use image node_id 14 for calling a global function with example usage: test_compute_multi_brain_mask() without return types