code: def set_xlabels_sample2time(ax, latest_sample, samplerate):
      ax.axis(xmin=0, xmax=latest_sample)
      if latest_sample / float(samplerate) > 60:
          ax.set_xlabel("time (mm:ss)")
          ax.set_xticklabels(
              [
                  "%02d:%02d"
                  % (
                      t / float(samplerate) / 60,
                      (t / float(samplerate)) % 60,
                  )
                  for t in ax.get_xticks()[:-1]
              ],
              rotation=50,
          )
      else:
          ax.set_xlabel("time (ss.mm)")
          ax.set_xticklabels(
              [
                  "%02d.%02d"
                  % (
                      t / float(samplerate),
                      100 * ((t / float(samplerate)) % 1),
                  )
                  for t in ax.get_xticks()[:-1]
              ],
              rotation=50,
          )
  
imports: import sys
  from aubio import source
  from numpy import zeros, hstack
label_desc: Use image node_id 2 for calling a global function with example usage: set_xlabels_sample2time(ax, latest_sample, samplerate) without return types