code: def get_metrics_from_system_usage_profiler(
      system_usage_info: dict,
  ) -> SystemResourceMetrics:
      """Package system resource usage metrics (no torch operators) in a dataclass.
  
      :param system_usage_info: dictionary containing resource usage information.
      """
      device_usage_dict: Dict[str, DeviceUsageMetrics] = {}
      for key in system_usage_info:
          if "cuda_" in key and "_memory_used" in key:
              cuda_device_name = "_".join(key.split("_")[:2]) + "_"
              max_memory_used = max(system_usage_info[key], default=0)
              average_memory_used = mean(
                  system_usage_info.get(key, [0])
              )
              device_usage_dict[cuda_device_name] = DeviceUsageMetrics(
                  max_memory_used=max_memory_used,
                  average_memory_used=average_memory_used,
              )
      return SystemResourceMetrics(
          code_block_tag=system_usage_info["code_block_tag"],
          cpu_name=system_usage_info.get("cpu_name", "unknown"),
          cpu_architecture=system_usage_info["cpu_architecture"],
          num_cpu=system_usage_info["num_cpu"],
          total_cpu_memory_size=system_usage_info[
              "total_cpu_memory_size"
          ],
          ludwig_version=system_usage_info["ludwig_version"],
          total_execution_time=system_usage_info["end_time"]
          - system_usage_info["start_time"],
          disk_footprint=system_usage_info["end_disk_usage"]
          - system_usage_info["start_disk_usage"],
          max_cpu_utilization=max(
              system_usage_info["cpu_utilization"], default=0
          ),
          max_cpu_memory_usage=max(
              system_usage_info["cpu_memory_usage"], default=0
          ),
          min_global_cpu_memory_available=min(
              system_usage_info["global_cpu_memory_available"],
              default=0,
          ),
          max_global_cpu_utilization=max(
              system_usage_info["global_cpu_utilization"], default=0
          ),
          average_cpu_utilization=mean(
              system_usage_info.get("cpu_utilization", [0])
          ),
          average_cpu_memory_usage=mean(
              system_usage_info.get("cpu_memory_usage", [0])
          ),
          average_global_cpu_memory_available=mean(
              system_usage_info.get("global_cpu_memory_available", [0])
          ),
          average_global_cpu_utilization=mean(
              system_usage_info.get("global_cpu_utilization", [0])
          ),
          device_usage=device_usage_dict,
      )
  
file_path: ludwig/ludwig/benchmarking/reporting.py
imports: from collections import Counter, defaultdict
  from statistics import mean
  from typing import Any, Dict, List, Tuple, Union
  import torch
  from torch._C._autograd import _KinetoEvent
  from torch.autograd import DeviceType, profiler_util
  from ludwig.benchmarking.profiler_dataclasses import DeviceUsageMetrics, SystemResourceMetrics, TorchProfilerMetrics
  from ludwig.constants import LUDWIG_TAG
label_desc: Use image node_id 10 for calling a global function with example usage: get_metrics_from_system_usage_profiler(system_usage_info) and returns: SystemResourceMetrics