code: def test_load_confounds_for_gifti(tmp_path):
      """Ensure that confounds are found for gifti files.
  
      Regression test for
      https://github.com/nilearn/nilearn/issues/3817
      Wrong order of space and hemi entity in filename pattern
      lead to confounds not being found.
      """
      bids_path = create_fake_bids_dataset(
          base_dir=tmp_path, n_sub=1, n_ses=1
      )
      selection = get_bids_files(
          bids_path / "derivatives",
          sub_label="01",
          file_tag="bold",
          file_type="func.gii",
          filters=[
              ("ses", "01"),
              ("task", "main"),
              ("run", "01"),
              ("hemi", "L"),
          ],
          sub_folder=True,
      )
      assert len(selection) == 1
      load_confounds(
          selection[0],
          strategy=["motion", "wm_csf"],
          motion="basic",
          demean=False,
      )
  
imports: import re
  import numpy
  import pandas
  import pytest
  from nibabel import Nifti1Image
  from scipy.stats import pearsonr
  from sklearn.preprocessing import scale
  from nilearn._utils.data_gen import create_fake_bids_dataset
  from nilearn._utils.fmriprep_confounds import to_camel_case
  from nilearn.conftest import _rng
  from nilearn.interfaces.bids import get_bids_files
  from nilearn.interfaces.fmriprep import load_confounds
  from nilearn.interfaces.fmriprep.load_confounds import _check_strategy, _load_single_confounds_file
  from nilearn.interfaces.fmriprep.tests._testing import create_tmp_filepath, get_legal_confound
  from nilearn.maskers import NiftiMasker
label_desc: Use image node_id 25 for calling a global function with example usage: test_load_confounds_for_gifti(tmp_path) without return types