code: def test_auto_mask():
      """Perform a smoke test on the auto-mask option."""
      data = np.zeros((9, 9, 9))
      data[3:-3, 3:-3, 3:-3] = 10
      img = nibabel.Nifti1Image(data, np.eye(4))
      masker = NiftiMasker()
      # Smoke test the fit
      masker.fit(img)
      # Smoke test the transform
      # With a 4D img
      masker.transform([img])
      # With a 3D img
      masker.transform(img)
  
      # check exception when transform() called without prior fit()
      masker2 = NiftiMasker(mask_img=img)
      with pytest.raises(ValueError, match="has not been fitted. "):
          masker2.transform(img)
  
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 1 for calling a global function with example usage: test_auto_mask() without return types