code: def test_speed(function, filename):
      times = []
      for _ in range(10):
          start = time.time()
          try:
              total_frames, samplerate = function(filename)
          except ImportError as e:
              print("error: failed importing {:s}".format(e))
              return
          elapsed = time.time() - start
          # print ("{:5f} ".format(elapsed)),
          times.append(elapsed)
  
      # print
      times = np.array(times)
      duration_min = int(total_frames / float(samplerate) // 60)
      str_format = "{:25s} took {:5f} seconds avg (±{:5f}) to run on a ~ {:d} minutes long file"
      print(
          str_format.format(
              function.__name__, times.mean(), times.std(), duration_min
          )
      )
  
file_path: aubio/python/demos/demo_reading_speed.py
imports: import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: test_speed(function, filename) without return types