code: def _update_level_metadata(
      config: ModelConfigDict,
  ) -> ModelConfigDict:
      # Replace parameters represented as keys with params represented as values.
      # Precedence is defined by first in the dictionary order, so if multiple
      # provided keys map to the same value, the one that appears earlier in this
      # dictionary will take priority.
      drop_params = {
          "sequence_length_limit": "max_sequence_length",
          "word_most_common": "most_common",
          "word_sequence_length_limit": "max_sequence_length",
          "word_tokenizer": "tokenizer",
          "word_vocab_file": "vocab_file",
          "char_most_common": "most_common",
          "char_sequence_length_limit": "max_sequence_length",
          "char_tokenizer": "tokenizer",
          "char_vocab_file": "vocab_file",
      }
  
      def upgrade_params(params):
          for key, value in drop_params.items():
              if key in params:
                  if value in params:
                      warnings.warn(
                          f"Removing deprecated config preprocessing parameter {key} as new param {value} already "
                          f"present in the config",
                          DeprecationWarning,
                      )
                  else:
                      warnings.warn(
                          f"Renaming deprecated config preprocessing parameter {key} to {value}",
                          DeprecationWarning,
                      )
                      params[value] = params[key]
                  del params[key]
  
      sequence_types = [SEQUENCE, TEXT, AUDIO, TIMESERIES]
      for dtype in sequence_types:
          params = config.get(PREPROCESSING, {}).get(dtype, {})
          upgrade_params(params)
  
      for feature in config[INPUT_FEATURES]:
          if feature.get(TYPE) not in sequence_types:
              continue
          params = feature.get(PREPROCESSING, {})
          upgrade_params(params)
  
      return config
  
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 7 for calling a global function with example usage: _update_level_metadata(config) and returns: config