code: def test_get_latest_metrics_dict():
      progress_tracker_metrics = OrderedDict(
          [
              (
                  "category_92E9E",
                  OrderedDict(
                      [
                          (
                              "loss",
                              [
                                  TrainerMetric(
                                      epoch=0,
                                      step=1,
                                      value=0.7929425835609436,
                                  ),
                                  TrainerMetric(
                                      epoch=1,
                                      step=2,
                                      value=0.7906522750854492,
                                  ),
                              ],
                          ),
                          (
                              "accuracy",
                              [
                                  TrainerMetric(
                                      epoch=0,
                                      step=1,
                                      value=0.4117647111415863,
                                  ),
                                  TrainerMetric(
                                      epoch=1,
                                      step=2,
                                      value=0.4117647111415863,
                                  ),
                              ],
                          ),
                      ]
                  ),
              ),
              (
                  "combined",
                  {
                      "loss": [
                          TrainerMetric(
                              epoch=0, step=1, value=0.7929425835609436
                          ),
                          TrainerMetric(
                              epoch=1, step=2, value=0.7906522750854492
                          ),
                      ]
                  },
              ),
          ]
      )
  
      latest_metrics_dict = trainer_utils.get_latest_metrics_dict(
          progress_tracker_metrics
      )
  
      assert latest_metrics_dict == {
          "category_92E9E": {
              "accuracy": 0.4117647111415863,
              "loss": 0.7906522750854492,
          },
          "combined": {"loss": 0.7906522750854492},
      }
  
file_path: ludwig/tests/ludwig/utils/test_trainer_utils.py
imports: from collections import OrderedDict
  from typing import Union
  import pytest
  from ludwig.constants import AUTO, BATCH_SIZE, COMBINED, LOSS
  from ludwig.features.category_feature import CategoryOutputFeature
  from ludwig.features.feature_utils import LudwigFeatureDict
  from ludwig.schema.features.category_feature import ECDCategoryOutputFeatureConfig
  from ludwig.schema.trainer import ECDTrainerConfig
  from ludwig.schema.utils import load_config_with_kwargs
  from ludwig.utils import trainer_utils
  from ludwig.utils.metric_utils import TrainerMetric
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_latest_metrics_dict() without return types