code: def _cut_analyze(options):
      hopsize = options.hop_size
      bufsize = options.buf_size
      samplerate = options.samplerate
      source_uri = options.source_uri
  
      # analyze pass
      from aubio import onset, tempo, source
  
      s = source(source_uri, samplerate, hopsize)
      if samplerate == 0:
          samplerate = s.samplerate
          options.samplerate = samplerate
  
      if options.beat:
          o = tempo(
              options.onset_method,
              bufsize,
              hopsize,
              samplerate=samplerate,
          )
      else:
          o = onset(
              options.onset_method,
              bufsize,
              hopsize,
              samplerate=samplerate,
          )
          if options.minioi:
              if options.minioi.endswith("ms"):
                  o.set_minioi_ms(int(options.minioi[:-2]))
              elif options.minioi.endswith("s"):
                  o.set_minioi_s(int(options.minioi[:-1]))
              else:
                  o.set_minioi(int(options.minioi))
      o.set_threshold(options.threshold)
  
      timestamps = []
      total_frames = 0
      while True:
          samples, read = s()
          if o(samples):
              timestamps.append(o.get_last())
              if options.verbose:
                  print("%.4f" % o.get_last_s())
          total_frames += read
          if read < hopsize:
              break
      del s
      return timestamps, total_frames
  
imports: import sys
  from aubio.cmd import AubioArgumentParser, _cut_slice
label_desc: Use image node_id 2 for calling a global function with example usage: _cut_analyze(options) and returns: timestamps,  total_frames