code: def test_standardize(rng):
      n_features = 10
      n_samples = 17
  
      # Create random signals with offsets
      a = rng.random((n_samples, n_features))
      a += np.linspace(0, 2.0, n_features)
  
      # Test raise error when strategy is not valid option
      with pytest.raises(
          ValueError, match="no valid standardize strategy"
      ):
          nisignal.standardize_signal(a, standardize="foo")
  
      # test warning for strategy that will be removed
      with pytest.warns(
          DeprecationWarning, match="default strategy for standardize"
      ):
          nisignal.standardize_signal(a, standardize="zscore")
  
      # transpose array to fit standardize input.
      # Without trend removal
      b = nisignal.standardize_signal(a, standardize="zscore_sample")
      stds = np.std(b)
      np.testing.assert_almost_equal(
          stds, np.ones(n_features), decimal=1
      )
      np.testing.assert_almost_equal(
          b.sum(axis=0), np.zeros(n_features)
      )
  
      # With trend removal
      a = np.atleast_2d(np.linspace(0, 2.0, n_features)).T
      b = nisignal.standardize_signal(
          a, detrend=True, standardize=False
      )
      np.testing.assert_almost_equal(b, np.zeros(b.shape))
  
      b = nisignal.standardize_signal(
          a, detrend=True, standardize="zscore_sample"
      )
      np.testing.assert_almost_equal(b, np.zeros(b.shape))
  
      length_1_signal = np.atleast_2d(np.linspace(0, 2.0, n_features))
      np.testing.assert_array_equal(
          length_1_signal,
          nisignal.standardize_signal(
              length_1_signal, standardize="zscore_sample"
          ),
      )
  
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 5 for calling a global function with example usage: test_standardize(rng) without return types