code: def test_resample_to_mask_warning():
      """Check that a warning is raised when data is
      being resampled to mask's resolution.
      """
      data = np.zeros((9, 9, 9))
      data[3:-3, 3:-3, 3:-3] = 10
      img = nibabel.Nifti1Image(data, np.eye(4))
      # defining a mask with different fov than img
      mask = np.zeros((12, 12, 12))
      mask[3:-3, 3:-3, 3:-3] = 10
      mask = mask.astype("uint8")
      mask_img = nibabel.Nifti1Image(mask, np.eye(4))
      masker = NiftiMasker(mask_img=mask_img)
      with pytest.warns(
          UserWarning,
          match="imgs are being resampled to the mask_img resolution. "
          "This process is memory intensive. You might want to provide "
          "a target_affine that is equal to the affine of the imgs "
          "or resample the mask beforehand "
          "to save memory and computation time.",
      ):
          masker.fit_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 6 for calling a global function with example usage: test_resample_to_mask_warning() without return types