code: def test_iter_check_niimgs(tmp_path, img_4d_zeros_eye):
      img_2_4d = [[img_4d_zeros_eye, img_4d_zeros_eye]]
  
      # Create a test file
      fd, filename = tempfile.mkstemp(
          prefix="nilearn_test", suffix=".nii", dir=str(tmp_path)
      )
      os.close(fd)
      img_4d_zeros_eye.to_filename(filename)
      niimgs = list(iter_check_niimg([filename]))
      assert_array_equal(
          get_data(niimgs[0]),
          get_data(_utils.check_niimg(img_4d_zeros_eye)),
      )
      del niimgs
      os.remove(filename)
  
      # Regular case
      niimgs = list(iter_check_niimg(img_2_4d))
      assert_array_equal(
          get_data(niimgs[0]), get_data(_utils.check_niimg(img_2_4d))
      )
  
imports: import os
  import re
  import tempfile
  from pathlib import Path
  import nibabel
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from numpy.testing import assert_array_equal
  import nilearn
  from nilearn import _utils
  from nilearn._utils import niimg_conversions, testing
  from nilearn._utils.exceptions import DimensionError
  from nilearn._utils.niimg_conversions import iter_check_niimg
  from nilearn._utils.testing import assert_memory_less_than, with_memory_profiler
  from nilearn.image import get_data
label_desc: Use image node_id 12 for calling a global function with example usage: test_iter_check_niimgs(tmp_path, img_4d_zeros_eye) without return types