code: def test_sample_mask(
      tmp_path,
      fmriprep_version,
      scrubbed_time_points,
      non_steady_outliers,
  ):
      """Test load method and sample mask."""
      regular_nii, regular_conf = create_tmp_filepath(
          tmp_path,
          image_type="regular",
          copy_confounds=True,
          fmriprep_version=fmriprep_version,
      )
  
      reg, mask = load_confounds(
          regular_nii,
          strategy=("motion", "scrub"),
          scrub=5,
          fd_threshold=0.15,
      )
      # the "1.4.x" test data has 6 time points marked as motion outliers,
      # and one nonsteady state (overlap with the first motion outlier)
      # 2 time points removed due to the "full" srubbing strategy
      # (remove segment shorter than 5 volumes)
      assert reg.shape[0] - len(mask) == scrubbed_time_points
  
      # nilearn requires unmasked confound regressors
      assert reg.shape[0] == 30
  
      # non steady state will always be removed
      reg, mask = load_confounds(regular_nii, strategy=("motion",))
      assert reg.shape[0] - len(mask) == non_steady_outliers
  
      # When no non-steady state volumes are present
      conf_data, _ = get_legal_confound(non_steady_state=False)
      conf_data.to_csv(
          regular_conf, sep="\t", index=False
      )  # save to tmp
      reg, mask = load_confounds(regular_nii, strategy=("motion",))
      assert mask is None
  
      # When no volumes needs removing (very liberal motion threshould)
      reg, mask = load_confounds(
          regular_nii,
          strategy=("motion", "scrub"),
          scrub=0,
          fd_threshold=4,
      )
      assert mask is None
  
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 23 for calling a global function with example usage: test_sample_mask(tmp_path, fmriprep_version, scrubbed_time_points, non_steady_outliers) without return types