code: def export_resource_usage_diff_to_csv(
      resource_usage_diff: ResourceUsageDiff, path: str
  ):
      """Export resource usage metrics report to .csv.
  
      :param resource_usage_diff: ResourceUsageDiff object containing the diff for two experiments on a dataset.
      :param path: file name of the exported csv.
      """
      with open(path, "w", newline="") as f:
          writer = csv.DictWriter(
              f,
              fieldnames=[
                  "Code Block Tag",
                  "Metric Name",
                  resource_usage_diff.base_experiment_name,
                  resource_usage_diff.experimental_experiment_name,
                  "Diff",
                  "Diff Percentage",
              ],
          )
          writer.writeheader()
  
          for metric in sorted(
              resource_usage_diff.metrics, key=lambda m: m.name
          ):
              diff_percentage = metric.diff_percentage
              if isinstance(metric.diff_percentage, float):
                  diff_percentage = round(metric.diff_percentage, 3)
              writer.writerow(
                  {
                      "Code Block Tag": resource_usage_diff.code_block_tag,
                      "Metric Name": metric.name,
                      resource_usage_diff.base_experiment_name: metric.base_value_str,
                      resource_usage_diff.experimental_experiment_name: metric.experimental_value_str,
                      "Diff": metric.diff_str,
                      "Diff Percentage": diff_percentage,
                  }
              )
          logger.info(f"Exported a CSV report to {path}\n")
  
imports: import csv
  import logging
  import os
  from dataclasses import dataclass
  from statistics import mean
  from typing import Dict, List, Optional, Set, Union
  import ludwig.modules.metric_modules
  from ludwig.benchmarking.utils import format_memory, format_time
  from ludwig.globals import MODEL_HYPERPARAMETERS_FILE_NAME
  from ludwig.modules.metric_registry import get_metric_classes, metric_feature_type_registry
  from ludwig.types import ModelConfigDict
  from ludwig.utils.data_utils import load_json
label_desc: Use image node_id 5 for calling a global function with example usage: export_resource_usage_diff_to_csv(resource_usage_diff, path) without return types