code: def run(**parameters):
      """Run rocksdb benchmark and return throughput"""
      bench_type = parameters["benchmarks"]
      # recover args
      args = ["--{}={}".format(k, v) for k, v in parameters.items()]
      # subprocess communicate
      process = subprocess.Popen(
          ["db_bench"] + args, stdout=subprocess.PIPE
      )
      out, err = process.communicate()
      # split into lines
      lines = out.decode("utf8").splitlines()
  
      match_lines = []
      for line in lines:
          # find the line with matched str
          if bench_type not in line:
              continue
          else:
              match_lines.append(line)
              break
  
      results = {}
      for line in match_lines:
          key, _, value = line.partition(":")
          key = key.strip()
          value = value.split("op")[1]
          results[key] = float(value)
  
      return results[bench_type]
  
imports: import nni
  import subprocess
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: run() and returns: results