code: def test_clean_runs():
      n_samples = 21
      n_features = 501  # Must be higher than 500
      signals, _, confounds = generate_signals(
          n_features=n_features, length=n_samples
      )
      trends = generate_trends(n_features=n_features, length=n_samples)
      x = signals + trends
      x_orig = x.copy()
      # Create run info
      runs = np.ones(n_samples)
      runs[0 : n_samples // 2] = 0
      x_detrended = nisignal.clean(
          x,
          confounds=confounds,
          standardize=False,
          detrend=True,
          low_pass=None,
          high_pass=None,
          runs=runs,
      )
      # clean should not modify inputs
      assert np.array_equal(x_orig, x)
  
      # check the runs are individually cleaned
      x_run1 = nisignal.clean(
          x[0 : n_samples // 2, :],
          confounds=confounds[0 : n_samples // 2, :],
          standardize=False,
          detrend=True,
          low_pass=None,
          high_pass=None,
      )
      assert np.array_equal(x_run1, x_detrended[0 : n_samples // 2, :])
  
imports: import os.path
  import numpy
  import pytest
  import scipy.signal
  from pandas import read_csv
  from nilearn import signal
  from nilearn.conftest import _rng
  from nilearn.signal import clean
label_desc: Use image node_id 13 for calling a global function with example usage: test_clean_runs() without return types