code: def _pulseTrain(self, bpm, sr, offset, dur):
      period = floor(sr / (bpm / 60.0))
      size = floor(sr * dur)
      phase = floor(offset * sr)
  
      if phase > period:
          phase = 0
  
      impulse = [1.0 if i % period == phase else 0 for i in range(size)]
      return impulse
  
imports: from essentia_test import *
  from essentia.standard import MonoLoader, RhythmExtractor2013
  from math import fabs
  from math import floor
label_desc: Use image node_id 4 for calling the TestRhythmExtractor2013 obj's underlying member method code with example usage: obj._pulseTrain(bpm, sr, offset, dur) and returns: impulse