code: def check_validation_metric_exists(
      config: "ModelConfig",
  ) -> None:  # noqa: F821
      """Checks that the specified validation metric exists."""
      validation_metric_name = config.trainer.validation_metric
  
      # Get all valid metrics.
      feature_to_metric_names_map = (
          get_feature_to_metric_names_map_from_feature_collection(
              config.output_features
          )
      )
      all_valid_metrics = set()
      for metric_names in feature_to_metric_names_map.values():
          all_valid_metrics.update(metric_names)
  
      if validation_metric_name not in all_valid_metrics:
          raise ConfigValidationError(
              f"User-specified trainer.validation_metric '{validation_metric_name}' is not valid. "
              f"Available metrics are: {all_valid_metrics}"
          )
  
imports: from abc import ABC, abstractmethod
  from re import findall
  from typing import Callable, TYPE_CHECKING
  from transformers import AutoConfig
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import AUDIO, BINARY, CATEGORY, IMAGE, IN_MEMORY, MIN_QUANTIZATION_BITS_FOR_MERGE_AND_UNLOAD, MODEL_ECD, MODEL_GBM, MODEL_LLM, NUMBER, SEQUENCE, SET, TEXT, TIMESERIES, VECTOR
  from ludwig.error import ConfigValidationError
  from ludwig.utils.metric_utils import get_feature_to_metric_names_map_from_feature_collection
  from ludwig.utils.misc_utils import merge_dict
label_desc: Use image node_id 13 for calling a global function with example usage: check_validation_metric_exists(config) without return types