code: def gen_metrics_from_csv(csv_dict, stats_file_path):
      if csv_dict is None:
          return
  
      metrics_dict_list = []
      for k, v in csv_dict.items():
          if k in STATS_METRICS_CONFIG:
              metric_config = STATS_METRICS_CONFIG[k]
              metrics_dict_list.append(
                  {
                      "MetricName": "{}_{}".format(
                          csv_dict["Model"], metric_config["name"]
                      ),
                      "Dimensions": [
                          {
                              "Name": "batch_size",
                              "Value": csv_dict["Batch size"],
                          }
                      ],
                      "Unit": metric_config["unit"],
                      "Value": float(v),
                  }
              )
  
      with open(stats_file_path, "w") as stats_file:
          json.dump(metrics_dict_list, stats_file, indent=4)
  
file_path: serve/benchmarks/utils/gen_metrics_json.py
imports: import argparse
  import csv
  import json
  import re
label_desc: Use image node_id 1 for calling a global function with example usage: gen_metrics_from_csv(csv_dict, stats_file_path) without return types