code: def test_load_non_nifti(tmp_path):
      """Test non-nifti and invalid file type as input."""
      # tsv file - unsupported input
      _, tsv = create_tmp_filepath(
          tmp_path, copy_confounds=True, copy_json=True
      )
  
      with pytest.raises(ValueError):
          load_confounds(str(tsv))
  
      # cifti file should be supported
      cifti, _ = create_tmp_filepath(
          tmp_path,
          image_type="cifti",
          copy_confounds=True,
          copy_json=True,
      )
      conf, _ = load_confounds(cifti)
      assert conf.size != 0
  
      # gifti support
      gifti, _ = create_tmp_filepath(
          tmp_path,
          image_type="gifti",
          copy_confounds=True,
          copy_json=True,
      )
      conf, _ = load_confounds(gifti)
      assert conf.size != 0
  
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 20 for calling a global function with example usage: test_load_non_nifti(tmp_path) without return types