code: def build_resource_usage_diff(
      base_path: str,
      experimental_path: str,
      base_experiment_name: Optional[str] = None,
      experimental_experiment_name: Optional[str] = None,
  ) -> List[ResourceUsageDiff]:
      """Build and return a ResourceUsageDiff object to diff resource usage metrics between two experiments.
  
      :param base_path: corresponds to the `output_dir` argument in the base ResourceUsageTracker run.
      :param experimental_path: corresponds to the `output_dir` argument in the experimental ResourceUsageTracker run.
      """
      base_summary_list = summarize_resource_usage(base_path)
      experimental_summary_list = summarize_resource_usage(
          experimental_path
      )
  
      summaries_list = []
      for base_summary in base_summary_list:
          for experimental_summary in experimental_summary_list:
              if (
                  base_summary.code_block_tag
                  == experimental_summary.code_block_tag
              ):
                  summaries_list.append(
                      (base_summary, experimental_summary)
                  )
  
      diffs = []
      for base_summary, experimental_summary in summaries_list:
          metrics_in_common = set(
              base_summary.metric_names
          ).intersection(set(experimental_summary.metric_names))
          metrics: List[MetricDiff] = [
              build_diff(
                  name,
                  base_summary.metric_to_values[name],
                  experimental_summary.metric_to_values[name],
              )
              for name in metrics_in_common
          ]
          diff = ResourceUsageDiff(
              code_block_tag=base_summary.code_block_tag,
              base_experiment_name=base_experiment_name
              if base_experiment_name
              else "experiment_1",
              experimental_experiment_name=experimental_experiment_name
              if experimental_experiment_name
              else "experiment_2",
              metrics=metrics,
          )
          diffs.append(diff)
      return diffs
  
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 8 for calling a global function with example usage: build_resource_usage_diff(base_path, experimental_path, base_experiment_name, experimental_experiment_name) and returns: diffs