code: def test_not_found_exception_ica_aroma(tmp_path, fmriprep_version):
      """Check various file or parameter for ICA-AROMA strategy."""
      # Create invalid confound file in temporary dir
      img_missing_confounds, bad_conf = create_tmp_filepath(
          tmp_path,
          copy_confounds=True,
          copy_json=False,
          fmriprep_version=fmriprep_version,
      )
  
      _remove_confounds(bad_conf)
  
      # Aggressive ICA-AROMA strategy requires
      # default nifti and noise ICs in confound file
      # correct nifti but missing noise regressor
      with pytest.raises(ValueError) as exc_info:
          load_confounds(
              img_missing_confounds,
              strategy=("ica_aroma",),
              ica_aroma="basic",
          )
      assert "ica_aroma" in exc_info.value.args[0]
  
      # Default nifti
      aroma_nii, _ = create_tmp_filepath(
          tmp_path,
          image_type="ica_aroma",
          bids_fields={"entities": {"sub": "icaAroma"}},
          fmriprep_version=fmriprep_version,
      )
      with pytest.raises(ValueError) as exc_info:
          load_confounds(
              aroma_nii, strategy=("ica_aroma",), ica_aroma="basic"
          )
      assert "Invalid file type" in exc_info.value.args[0]
  
      # non aggressive ICA-AROMA strategy requires
      # desc-smoothAROMAnonaggr nifti file
      with pytest.raises(ValueError) as exc_info:
          load_confounds(
              img_missing_confounds,
              strategy=("ica_aroma",),
              ica_aroma="full",
          )
      assert "desc-smoothAROMAnonaggr_bold" in exc_info.value.args[0]
  
      # no confound files along the image file
      (tmp_path / bad_conf).unlink()
      with pytest.raises(ValueError) as exc_info:
          load_confounds(img_missing_confounds)
      assert (
          "Could not find associated confound file."
          in exc_info.value.args[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 18 for calling a global function with example usage: test_not_found_exception_ica_aroma(tmp_path, fmriprep_version) without return types