code: def test_filter_and_mask():
      data = np.zeros([20, 30, 40, 5])
      mask = np.ones([20, 30, 40])
  
      data_img = nibabel.Nifti1Image(data, np.eye(4))
      mask_img = nibabel.Nifti1Image(mask, np.eye(4))
  
      masker = NiftiMasker()
      params = get_params(NiftiMasker, masker)
      params["clean_kwargs"] = {}
  
      # Test return_affine = False
      data = _filter_and_mask(data_img, mask_img, params)
      assert data.shape == (5, 24000)
  
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 22 for calling a global function with example usage: test_filter_and_mask() without return types