code: def generate(self):
      sample_n = 0
  
      # in samples
      cycle_length = self.sample_rate / float(self.freq)
      pulse_length = cycle_length * self.duty_cycle
  
      while True:
          if (sample_n % cycle_length) < pulse_length:
              yield 1.0
          else:
              yield -1.0
          sample_n += 1
  
imports: import math
  import array
  import itertools
  import random
  from .audio_segment import AudioSegment
  from .utils import db_to_float, get_frame_width, get_array_type, get_min_max_value
label_desc: Use image node_id 2 for calling the Pulse obj's underlying member method code with example usage: obj.generate() without return types