code: def test_upgrade_model_progress():
      old_model_progress = {
          "batch_size": 64,
          "best_eval_metric": 0.5,
          "best_increase_batch_size_eval_metric": math.inf,
          "best_reduce_learning_rate_eval_metric": math.inf,
          "epoch": 2,
          "last_improvement": 1,
          "last_improvement_epoch": 1,
          "best_eval_metric_epoch": 1,
          "last_increase_batch_size": 0,
          "last_increase_batch_size_epoch": 0,
          "last_increase_batch_size_eval_metric_improvement": 0,
          "last_learning_rate_reduction": 0,
          "last_learning_rate_reduction_epoch": 0,
          "last_reduce_learning_rate_eval_metric_improvement": 0,
          "learning_rate": 0.001,
          "num_increases_batch_size": 0,
          "num_reductions_learning_rate": 0,
          "steps": 224,
          "test_metrics": {
              "combined": {"loss": [0.59, 0.56]},
              "delinquent": {
                  "accuracy": [0.77, 0.78],
              },
          },
          "train_metrics": {
              "combined": {"loss": [0.58, 0.55]},
              "delinquent": {"roc_auc": [0.53, 0.54]},
          },
          "vali_metrics": {
              "combined": {"loss": [0.59, 0.60]},
              "delinquent": {"roc_auc": [0.53, 0.44]},
          },
      }
  
      new_model_progress = upgrade_model_progress(old_model_progress)
  
      assert new_model_progress == {
          "batch_size": 64,
          "best_eval_metric_value": 0.5,
          "best_increase_batch_size_eval_metric": float("inf"),
          "epoch": 2,
          "last_improvement_steps": 64,
          "best_eval_metric_steps": 0,
          "best_eval_metric_epoch": 1,
          "last_increase_batch_size": 0,
          "last_increase_batch_size_eval_metric_improvement": 0,
          "last_learning_rate_reduction": 0,
          "learning_rate": 0.001,
          "num_increases_batch_size": 0,
          "num_reductions_learning_rate": 0,
          "steps": 224,
          "test_metrics": {
              "combined": {
                  "loss": [
                      TrainerMetric(epoch=1, step=64, value=0.59),
                      TrainerMetric(epoch=2, step=128, value=0.56),
                  ]
              },
              "delinquent": {
                  "accuracy": [
                      TrainerMetric(epoch=1, step=64, value=0.77),
                      TrainerMetric(epoch=2, step=128, value=0.78),
                  ]
              },
          },
          "train_metrics": {
              "combined": {
                  "loss": [
                      TrainerMetric(epoch=1, step=64, value=0.58),
                      TrainerMetric(epoch=2, step=128, value=0.55),
                  ]
              },
              "delinquent": {
                  "roc_auc": [
                      TrainerMetric(epoch=1, step=64, value=0.53),
                      TrainerMetric(epoch=2, step=128, value=0.54),
                  ]
              },
          },
          "last_learning_rate_reduction_steps": 0,
          "last_increase_batch_size_steps": 0,
          "validation_metrics": {
              "combined": {
                  "loss": [
                      TrainerMetric(epoch=1, step=64, value=0.59),
                      TrainerMetric(epoch=2, step=128, value=0.6),
                  ]
              },
              "delinquent": {
                  "roc_auc": [
                      TrainerMetric(epoch=1, step=64, value=0.53),
                      TrainerMetric(epoch=2, step=128, value=0.44),
                  ]
              },
          },
          "tune_checkpoint_num": 0,
          "checkpoint_number": 0,
          "best_eval_metric_checkpoint_number": 0,
          "best_eval_train_metrics": {},
          "best_eval_validation_metrics": {},
          "best_eval_test_metrics": {},
      }
  
      # Verify that we don't make changes to already-valid model progress dicts.
      # To do so, we modify the batch size value and re-run the upgrade on the otherwise-valid `new_model_progress` dict.
      new_model_progress["batch_size"] = 1
      unchanged_model_progress = upgrade_model_progress(
          new_model_progress
      )
      assert unchanged_model_progress == new_model_progress
  
imports: import copy
  import math
  from typing import Any, Dict
  import pytest
  from ludwig.constants import BATCH_SIZE, BFILL, CLASS_WEIGHTS, DEFAULTS, EVAL_BATCH_SIZE, EXECUTOR, HYPEROPT, INPUT_FEATURES, LEARNING_RATE_SCHEDULER, LOSS, NUMBER, OUTPUT_FEATURES, PREPROCESSING, SCHEDULER, SPLIT, TRAINER, TYPE
  from ludwig.schema.model_config import ModelConfig
  from ludwig.schema.trainer import ECDTrainerConfig
  from ludwig.utils.backward_compatibility import _update_backend_cache_credentials, _upgrade_encoder_decoder_params, _upgrade_feature, _upgrade_preprocessing_split, upgrade_config_dict_to_latest_version, upgrade_missing_value_strategy, upgrade_model_progress
  from ludwig.utils.trainer_utils import TrainerMetric
label_desc: Use image node_id 11 for calling a global function with example usage: test_upgrade_model_progress() without return types