code: def test_compute_epi_mask():
      """Test that the masker class is passing parameters appropriately."""
      # Taken from test_masking.py, but used to test that the masker class
      #   is passing parameters appropriately.
      mean_image = np.ones((9, 9, 3))
      mean_image[3:-2, 3:-2, :] = 10
      mean_image[5, 5, :] = 11
      mean_image = nibabel.Nifti1Image(
          mean_image.astype(float), np.eye(4)
      )
  
      masker = NiftiMasker(
          mask_strategy="epi", mask_args=dict(opening=False)
      )
      masker.fit(mean_image)
      mask1 = masker.mask_img_
  
      masker2 = NiftiMasker(
          mask_strategy="epi",
          mask_args=dict(opening=False, exclude_zeros=True),
      )
      masker2.fit(mean_image)
      mask2 = masker2.mask_img_
  
      # With an array with no zeros, exclude_zeros should not make
      # any difference
      np.testing.assert_array_equal(get_data(mask1), get_data(mask2))
  
      # Check that padding with zeros does not change the extracted mask
      mean_image2 = np.zeros((30, 30, 3))
      mean_image2[3:12, 3:12, :] = get_data(mean_image)
      mean_image2 = nibabel.Nifti1Image(mean_image2, np.eye(4))
  
      masker3 = NiftiMasker(
          mask_strategy="epi",
          mask_args=dict(opening=False, exclude_zeros=True),
      )
      masker3.fit(mean_image2)
      mask3 = masker3.mask_img_
      np.testing.assert_array_equal(
          get_data(mask1), get_data(mask3)[3:12, 3:12]
      )
  
      # However, without exclude_zeros, it does
      masker4 = NiftiMasker(
          mask_strategy="epi", mask_args=dict(opening=False)
      )
      masker4.fit(mean_image2)
      mask4 = masker4.mask_img_
  
      assert not np.allclose(
          get_data(mask1), get_data(mask4)[3:12, 3:12]
      )
  
imports: import os
  import shutil
  import warnings
  from tempfile import mkdtemp
  import nibabel
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from nilearn._utils import data_gen, exceptions, testing
  from nilearn._utils.class_inspect import get_params
  from nilearn.image import get_data, index_img
  from nilearn.maskers import NiftiMasker
  from nilearn.maskers.nifti_masker import _filter_and_mask
label_desc: Use image node_id 18 for calling a global function with example usage: test_compute_epi_mask() without return types