code: def test_old_class_weights_default():
      old_config = {
          "input_features": [
              {
                  "name": "input_feature_1",
                  "type": "category",
              }
          ],
          "output_features": [
              {
                  "name": "output_feature_1",
                  "type": "category",
                  "loss": {"class_weights": 1},
              },
          ],
      }
  
      new_config = {
          "input_features": [
              {
                  "name": "input_feature_1",
                  "type": "category",
              }
          ],
          "output_features": [
              {
                  "name": "output_feature_1",
                  "type": "category",
                  "loss": {"class_weights": None},
              },
          ],
      }
  
      upgraded_config = upgrade_config_dict_to_latest_version(
          old_config
      )
      del upgraded_config["ludwig_version"]
      assert new_config == upgraded_config
  
      old_config[OUTPUT_FEATURES][0][LOSS][CLASS_WEIGHTS] = [
          0.5,
          0.8,
          1,
      ]
      new_config[OUTPUT_FEATURES][0][LOSS][CLASS_WEIGHTS] = [
          0.5,
          0.8,
          1,
      ]
  
      upgraded_config = upgrade_config_dict_to_latest_version(
          old_config
      )
      del upgraded_config["ludwig_version"]
      assert new_config == upgraded_config
  
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 10 for calling a global function with example usage: test_old_class_weights_default() without return types