code: def test_get_file_name(tmp_path, flag, keyword, image_type):
      """Test _get_file_name."""
      if image_type == "part":
          kwargs = {
              "bids_fields": {
                  "entities": {
                      "sub": flag.replace(".", ""),
                      "task": "test",
                      "part": "mag",
                      "run": "01",
                  }
              }
          }
      else:
          kwargs = {}
  
      img, _ = create_tmp_filepath(
          tmp_path,
          image_type=image_type,
          fmriprep_version=flag,
          **kwargs,
      )
  
      conf = _get_file_name(img)
  
      assert keyword in conf
  
imports: import pytest
  from nilearn.interfaces.fmriprep.load_confounds_utils import _get_file_name, sanitize_confounds
  from nilearn.interfaces.fmriprep.tests._testing import create_tmp_filepath
label_desc: Use image node_id 2 for calling a global function with example usage: test_get_file_name(tmp_path, flag, keyword, image_type) without return types