parameters: (category: List[str], results: List[NetworkResult], nconfig: NNConfig)
return_statement: return headers, rows
docstring: Calculate and process results across multiple runs.
docstring_summary: Calculate and process results across multiple runs.
docstring_tokens: Calculate and process results across multiple runs .
function: def process_results(category: List[str], results: List[NetworkResult], nconfig: NNConfig):
      """
      Calculate and process results across multiple runs.
      """
      general_stats = ["script", "accuracy"]
      runtime_result_row_names = list(nconfig.NETWORK_SEGMENTS)
      if nconfig.NETWORK_FULL_NAME not in nconfig.NETWORK_SEGMENTS:
          runtime_result_row_names.append(nconfig.NETWORK_FULL_NAME)
  
      rows = []
      row_entry = []
      for cat, result in zip(category, results):
          # Process runtime results for each group
          runtime_results = defaultdict(list)
          for runtimes in [nr.median_runtime for nr in result.network_results]:
              for runtime in runtimes:
                  runtime_results[runtime.name].append(runtime.runtime)
  
          # Calculate average runtime for each group
          average_group_runtime = {k: mean(v) for k, v in runtime_results.items()}
          row_entry = [cat, result.accuracy] + [
              average_group_runtime[n] for n in runtime_result_row_names
          ]
          rows.append(row_entry)
  
      headers = general_stats + [r + " (sec)" for r in runtime_result_row_names]
      return headers, rows
function_tokens: def process_results ( category : List [ str ] , results : List [ NetworkResult ] , nconfig : NNConfig ) : general_stats = [ "script" , "accuracy" ] runtime_result_row_names = list ( nconfig . NETWORK_SEGMENTS ) if nconfig . NETWORK_FULL_NAME not in nconfig . NETWORK_SEGMENTS : runtime_result_row_names . append ( nconfig . NETWORK_FULL_NAME ) rows = [ ] row_entry = [ ] for cat , result in zip ( category , results ) : # Process runtime results for each group runtime_results = defaultdict ( list ) for runtimes in [ nr . median_runtime for nr in result . network_results ] : for runtime in runtimes : runtime_results [ runtime . name ] . append ( runtime . runtime ) # Calculate average runtime for each group average_group_runtime = { k : mean ( v ) for k , v in runtime_results . items ( ) } row_entry = [ cat , result . accuracy ] + [ average_group_runtime [ n ] for n in runtime_result_row_names ] rows . append ( row_entry ) headers = general_stats + [ r + " (sec)" for r in runtime_result_row_names ] return headers , rows