code: def test_spectral_decomposition():
      # mainly to test that the second sign follows the first
      spectral, approx = spectral_decomposition(hrf.glover)
      val_makers = [lambdify_t(def_func(T)) for def_func in spectral]
      t = np.linspace(-15, 50, 3251)
      vals = [val_maker(t) for val_maker in val_makers]
      ind = np.argmax(vals[1])
      assert vals[0][ind] > 0
      # test that we can get several components
      spectral, approx = spectral_decomposition(hrf.glover, ncomp=5)
      assert len(spectral) == 5
  
imports: import numpy
  from ...None import hrf
  from ...utils import T, lambdify_t
  from ..hrf import spectral_decomposition
label_desc: Use image node_id 1 for calling a global function with example usage: test_spectral_decomposition() without return types