code: def test_clean_finite_no_inplace_mod():
      """
      Test for verifying that the passed in signal array is not modified.
      For PR #2125 . This test is failing on main, passing in this PR.
      """
      n_samples = 2
      # n_features  Must be higher than 500
      n_features = 501
      x_orig, _, _ = generate_signals(
          n_features=n_features, length=n_samples
      )
      x_orig_inital_copy = x_orig.copy()
  
      x_orig_with_nans = x_orig.copy()
      x_orig_with_nans[0, 0] = np.nan
      x_orig_with_nans_initial_copy = x_orig_with_nans.copy()
  
      _ = clean(x_orig)
      assert np.array_equal(x_orig, x_orig_inital_copy)
  
      _ = clean(x_orig_with_nans, ensure_finite=True)
      assert np.isnan(x_orig_with_nans_initial_copy[0, 0])
      assert np.isnan(x_orig_with_nans[0, 0])
  
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 16 for calling a global function with example usage: test_clean_finite_no_inplace_mod() without return types