code: def test_check_niimg_wildcards_no_expand_wildcards(
      img_3d_zeros_eye, img_4d_zeros_eye, tmp_path
  ):
      nofile_path = "/tmp/nofile"
  
      file_not_found_msg = "File not found: '%s'"
  
      #######
      # Test when global variable is set to False => no globbing allowed
      ni.EXPAND_PATH_WILDCARDS = False
  
      # Non existing filename (/tmp/nofile) could match an existing one through
      # globbing but global wildcards variable overrides this feature => raises
      # a ValueError
      with pytest.raises(
          ValueError, match=file_not_found_msg % nofile_path
      ):
          _utils.check_niimg(nofile_path)
  
      # Verify wildcards function parameter has no effect
      with pytest.raises(
          ValueError, match=file_not_found_msg % nofile_path
      ):
          _utils.check_niimg(nofile_path, wildcards=False)
  
      # Testing with an exact filename matching (3d case)
      filename = testing.write_imgs_to_path(
          img_3d_zeros_eye, file_path=tmp_path, create_files=True
      )
      assert_array_equal(
          get_data(_utils.check_niimg(filename)),
          get_data(img_3d_zeros_eye),
      )
  
      # Testing with an exact filename matching (4d case)
      filename = testing.write_imgs_to_path(
          img_4d_zeros_eye, file_path=tmp_path, create_files=True
      )
      assert_array_equal(
          get_data(_utils.check_niimg(filename)),
          get_data(img_4d_zeros_eye),
      )
  
      # Reverting to default behavior
      ni.EXPAND_PATH_WILDCARDS = True
  
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 10 for calling a global function with example usage: test_check_niimg_wildcards_no_expand_wildcards(img_3d_zeros_eye, img_4d_zeros_eye, tmp_path) without return types