def _ParseOutput(vm, spec_dir):
  """Retrieves the SPEC CPU2006 output from the VM and parses it.

  Args:
    vm: The vm instance where SPEC CPU2006 was run.
    spec_dir: string. Path of the directory on the remote machine where the SPEC
        files, including binaries and logs, are located.

  Returns:
    A list of samples to be published (in the same format as Run() returns).
  """
  results = []

  log_files = []
  # FIXME(liquncheng): Only reference runs generate SPEC scores. The log
  # id is hardcoded as 001, which might change with different runspec
  # parameters. SPEC CPU2006 will generate different logs for build, test
  # run, training run and ref run.
  if ('int', 'all') in FLAGS.benchmark_subset:
    log_files.append('CINT2006.001.ref.txt')
  if FLAGS.benchmark_subset in ('fp', 'all'):
    log_files.append('CFP2006.001.ref.txt')

  for log in log_files:
    stdout, _ = vm.RemoteCommand('cat %s/result/%s' % (spec_dir, log),
                                 should_log=True)
    results.extend(_ExtractScore(stdout, vm,
                                 FLAGS.runspec_keep_partial_results))

  return results
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/speccpu2006_benchmark.py/_ParseOutput/swapped operands of `in`