code: def testRegression(self):
      # NB: the schemas of the peak types don't look correct here...
      spectrum = [0] * 100
  
      # \___
      spectrum[0:3] = [0.5, 0.4, 0.3]
  
      # __/\__
      spectrum[10:13] = [0.5, 0.6, 0.5]
  
      # __/`---\__
      spectrum[20:25] = [0.8, 0.95, 0.95, 0.95, 0.8]
  
      # __/---\__
      spectrum[30:35] = [0.5, 0.6, 0.6, 0.6, 0.7]
  
      # __/`--\__
      spectrum[40:44] = [0.5, 0.6, 0.6, 0.7]
  
      # __/`---\__
      spectrum[50:55] = [0.7, 0.6, 0.6, 0.6, 0.5]
  
      # __/`---\__
      spectrum[60:65] = [0.7, 0.6, 0.6, 0.6, 0.7]
  
      # __/`\__
      spectrum[70:75] = [0.7, 0.5, 0.7, 0.5, 0.7]
  
      # ___/
      spectrum[97:100] = [0.3, 0.4, 0.5]
  
      speaks = SpectralPeaks(
          sampleRate=99 * 2,
          maxPeaks=100,
          maxFrequency=99,
          minFrequency=0,
          magnitudeThreshold=1e-6,
          orderBy="frequency",
      )
  
      (freqs, mags) = speaks(spectrum)
      peaks = zip(freqs, mags)
  
      expected = [
          (0, 0.5),
          (11, 0.6),
          (22, 0.95),
          (33.625, 0.75625),
          (42.625, 0.75625),
          (50.375, 0.75625),
          (60.375, 0.75625),
          (63.625, 0.75625),
          (70.2778, 0.734722),
          (72, 0.7),
          (73.7222, 0.734722),
          (99, 0.5),
      ]
  
      for exp, found in zip(expected, peaks):
          self.assertAlmostEqual(found[0], exp[0], 1e-6)
          self.assertAlmostEqual(found[1], exp[1], 1e-6)
  
file_path: essentia/test/src/unittests/spectral/test_spectralpeaks.py
imports: from essentia_test import *
label_desc: Use image node_id 1 for calling the TestSpectralPeaks obj's underlying member method code with example usage: obj.testRegression() without return types