code: def _upgrade_max_batch_size(
      trainer: TrainerConfigDict,
  ) -> TrainerConfigDict:
      if "increase_batch_size_on_plateau_max" in trainer:
          warnings.warn(
              'Config param "increase_batch_size_on_plateau_max" renamed to "max_batch_size" and will be '
              "removed in v0.8",
              DeprecationWarning,
          )
          increase_batch_size_on_plateau_max_val = trainer.pop(
              "increase_batch_size_on_plateau_max"
          )
          if "max_batch_size" in trainer:
              warnings.warn(
                  '"max_batch_size" config param already set. Discarding "increase_batch_size_on_plateau_max".'
              )
          else:
              warnings.warn(
                  f'Setting "max_batch_size" config param to "increase_batch_size_on_plateau_max" value '
                  f'({increase_batch_size_on_plateau_max_val}) and discarding "increase_batch_size_on_plateau_max"'
              )
              trainer[
                  "max_batch_size"
              ] = increase_batch_size_on_plateau_max_val
      return trainer
  
imports: import copy
  import logging
  import warnings
  from typing import Any, Callable, Dict, List, Union
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import AUDIO, BIAS, CLASS_WEIGHTS, COLUMN, CONV_BIAS, CONV_USE_BIAS, DECODER, DEFAULT_BIAS, DEFAULT_USE_BIAS, DEFAULTS, ENCODER, EVAL_BATCH_SIZE, EXECUTOR, FORCE_SPLIT, HEIGHT, HYPEROPT, IMAGE, INPUT_FEATURES, LOSS, MISSING_VALUE_STRATEGY, MODEL_ECD, MODEL_GBM, MODEL_TYPE, NAME, NUM_SAMPLES, NUMBER, OUTPUT_FEATURES, PARAMETERS, PREPROCESSING, PROBABILITIES, RANDOM, RAY, SAMPLER, SCHEDULER, SEARCH_ALG, SEQUENCE, SPLIT, SPLIT_PROBABILITIES, STRATIFY, TEXT, TIMESERIES, TRAINER, TRAINING, TYPE, USE_BIAS, WIDTH
  from ludwig.features.feature_registries import get_base_type_registry, get_input_type_registry, get_output_type_registry
  from ludwig.globals import LUDWIG_VERSION
  from ludwig.schema.defaults.gbm import GBMDefaultsConfig
  from ludwig.schema.encoders.utils import get_encoder_cls
  from ludwig.types import FeatureConfigDict, FeatureTypeDefaultsDict, HyperoptConfigDict, ModelConfigDict, PreprocessingConfigDict, TrainerConfigDict, TrainingSetMetadataDict
  from ludwig.utils.metric_utils import TrainerMetric
  from ludwig.utils.misc_utils import get_from_registry, merge_dict
  from ludwig.utils.version_transformation import VersionTransformation, VersionTransformationRegistry
label_desc: Use image node_id 21 for calling a global function with example usage: _upgrade_max_batch_size(trainer) and returns: trainer