code: def test_fit_transform_warning():
      data = np.zeros((9, 9, 9))
      data[3:-3, 3:-3, 3:-3] = 10
      img = nibabel.Nifti1Image(data, np.eye(4))
      y = np.ones((9, 9, 9))
      mask = data.astype("uint8")
      mask_img = nibabel.Nifti1Image(mask, np.eye(4))
      masker = NiftiMasker(mask_img=mask_img)
      with pytest.warns(
          UserWarning,
          match="Generation of a mask has been requested .*"
          "while a mask has been provided at masker creation.",
      ):
          X = masker.fit_transform(X=img, y=y)
          assert np.any(X != 0)
  
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 4 for calling a global function with example usage: test_fit_transform_warning() without return types