code: def testImpulseTrain(self):
      impulseTrain140 = self.pulseTrain(
          bpm=140, sr=44100.0, offset=0.1, dur=10
      )
  
      # expected values
      expectedTicks = [
          i / 44100.0
          for i in range(len(impulseTrain140))
          if impulseTrain140[i] != 0
      ]
      expectedBpm = 140.0
  
      result = self.runInstance(impulseTrain140)
  
      # bpm
      self.assertAlmostEqual(result[0], expectedBpm, 1e-2)
  
      # ticks
      self.assertVectorWithinVector(result[1], expectedTicks, 0.1)
  
      # estimated bpm
      for i in range(len(result[2])):
          self.assertAlmostEqual(result[2][i], expectedBpm, 1.0)
  
      # bpm intervals
      for i in range(len(result[3])):
          self.assertAlmostEqual(result[3][i], 60.0 / expectedBpm, 0.2)
  
      # impulse train at 90bpm no offset
      impulseTrain90 = self.pulseTrain(
          bpm=90.0, sr=44100.0, offset=0.0, dur=20.0
      )
  
      # impulse train at 200bpm with offset
      impulseTrain200 = self.pulseTrain(
          bpm=200.0, sr=44100.0, offset=0.2, dur=10.0
      )
  
      # impulse train at 200bpm with no offset
      impulseTrain200b = self.pulseTrain(
          bpm=200.0, sr=44100.0, offset=0.0, dur=25.0
      )
  
      ## make a new impulse train at 140-90-200-200 bpm
      impulseTrain = (
          impulseTrain140
          + impulseTrain90
          + impulseTrain200
          + impulseTrain200b
      )
  
      # expected values
  
      # ticks
      expectedTicks = [
          i / 44100.0
          for i in range(len(impulseTrain))
          if impulseTrain[i] != 0
      ]
  
      result = self.runInstance(impulseTrain, expectedTicks)
  
      # bpm
      expectedBpm = 200
      self.assertAlmostEqual(result[0], expectedBpm, 0.5)
  
      # ticks
      self.assertVectorWithinVector(result[1], expectedTicks, 0.03)
  
      # bpm estimates
      for i in range(len(result[2])):
          self.assertAlmostEqual(result[2][i], expectedBpm, 0.5)
  
      # bpm intervals: we may need to take into account also multiples of 90,
      # 140 and 200.
      expectedBpmIntervals = [60 / 90.0, 60 / 140.0, 60 / 200.0]
      self.assertVectorWithinVector(result[3], expectedBpmIntervals)
  
      ### run w/o tempoHints ###
  
      result = self.runInstance(impulseTrain)
  
      expectedBpmVector = [50, 100, 200]
  
      # bpm: here rhythmextractor is choosing 0.5*expected_bpm, that's why we are
      # comparing the resulting bpm with the expected_bpm_vector:
      self.assertVectorWithinVector([result[0]], expectedBpmVector, 1.0)
  
      # bpm estimates
      self.assertVectorWithinVector(result[2], expectedBpmVector, 0.5)
      self.assertVectorWithinVector(result[1], expectedTicks, 0.03)
      self.assertVectorWithinVector(
          result[3], expectedBpmIntervals, 0.5
      )
  
file_path: essentia/test/src/unittests/rhythm/test_rhythmextractor.py
imports: from essentia_test import *
  from essentia.streaming import RhythmExtractor
  from essentia.standard import MonoLoader, RhythmExtractor
  from math import fabs
label_desc: Use image node_id 14 for calling the TestRhythmExtractor obj's underlying member method code with example usage: obj.testImpulseTrain() without return types