code: def test_clean_frequencies_using_power_spectrum_density():
      # Create signal
      sx = np.array(
          [
              np.sin(np.linspace(0, 100, 100) * 1.5),
              np.sin(np.linspace(0, 100, 100) * 3.0),
              np.sin(np.linspace(0, 100, 100) / 8.0),
          ]
      ).T
  
      # Create confound
      _, _, confounds = generate_signals(
          n_features=10, n_confounds=10, length=100
      )
  
      # Apply low- and high-pass filter with butterworth (separately)
      t_r = 1.0
      low_pass = 0.1
      high_pass = 0.4
      res_low = clean(
          sx,
          detrend=False,
          standardize=False,
          filter="butterworth",
          low_pass=low_pass,
          high_pass=None,
          t_r=t_r,
      )
      res_high = clean(
          sx,
          detrend=False,
          standardize=False,
          filter="butterworth",
          low_pass=None,
          high_pass=high_pass,
          t_r=t_r,
      )
  
      # cosine high pass filter
      res_cos = clean(
          sx,
          detrend=False,
          standardize=False,
          filter="cosine",
          low_pass=None,
          high_pass=high_pass,
          t_r=t_r,
      )
  
      # Compute power spectrum density for both test
      f, Pxx_den_low = scipy.signal.welch(
          np.mean(res_low.T, axis=0), fs=t_r
      )
      f, Pxx_den_high = scipy.signal.welch(
          np.mean(res_high.T, axis=0), fs=t_r
      )
      f, Pxx_den_cos = scipy.signal.welch(
          np.mean(res_cos.T, axis=0), fs=t_r
      )
  
      # Verify that the filtered frequencies are removed
      assert np.sum(Pxx_den_low[f >= low_pass * 2.0]) <= 1e-4
      assert np.sum(Pxx_den_high[f <= high_pass / 2.0]) <= 1e-4
      assert np.sum(Pxx_den_cos[f <= high_pass / 2.0]) <= 1e-4
  
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 15 for calling a global function with example usage: test_clean_frequencies_using_power_spectrum_density() without return types