code: def run_throughput_tests(max_threads):
      for task in throughput_tasks:
          print(task.__doc__)
          print()
          func, args = task()
          nthreads = 1
          baseline_speed = None
          while nthreads <= max_threads:
              results = run_throughput_test(func, args, nthreads)
              # Taking the max duration rather than average gives pessimistic
              # results rather than optimistic.
              speed = sum(r[0] for r in results) / max(
                  r[1] for r in results
              )
              print("threads=%d: %d" % (nthreads, speed), end="")
              if baseline_speed is None:
                  print(" iterations/s.")
                  baseline_speed = speed
              else:
                  print(" ( %d %%)" % (speed / baseline_speed * 100))
              nthreads += 1
          print()
  
imports: from __future__ import division
  from __future__ import print_function
  import time
  import os
  import sys
  import itertools
  import threading
  import subprocess
  import socket
  from optparse import OptionParser, SUPPRESS_HELP
  import platform
label_desc: Use image node_id 8 for calling a global function with example usage: run_throughput_tests(max_threads) without return types