code: def test_optimize_scrub(
      original_motion_outliers_index, expected_optimal
  ):
      """Check the segment removal is acting correctly."""
      # simulated labels with 100 time frames and remove any segment under
      # 5 volumes
      optimised_index = optimize_scrub(
          original_motion_outliers_index, 100, 5
      )
      assert np.array_equal(optimised_index, expected_optimal)
  
file_path: nilearn/nilearn/interfaces/fmriprep/tests/test_load_confounds_scrub.py
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from nilearn.interfaces.fmriprep.load_confounds_scrub import _get_outlier_cols, extract_outlier_regressors, optimize_scrub
label_desc: Use image node_id 1 for calling a global function with example usage: test_optimize_scrub(original_motion_outliers_index, expected_optimal) without return types