code: def update_datasets_config(
      config: DictConfig | ListConfig,
  ) -> DictConfig | ListConfig:
      """Updates the dataset section of the config.
  
      Args:
          config (DictConfig | ListConfig): Configurable parameters for the current run.
  
      Returns:
          DictConfig | ListConfig: Updated config
      """
      if "format" not in config.dataset.keys():
          config.dataset.format = "mvtec"
  
      if "create_validation_set" in config.dataset.keys():
          warn(
              DeprecationWarning(
                  "The 'create_validation_set' parameter is deprecated and will be removed in a future release. Please "
                  "use 'validation_split_mode' instead."
              )
          )
          config.dataset.val_split_mode = (
              "from_test"
              if config.dataset.create_validation_set
              else "same_as_test"
          )
  
      if "test_batch_size" in config.dataset.keys():
          warn(
              DeprecationWarning(
                  "The 'test_batch_size' parameter is deprecated and will be removed in a future release. Please use "
                  "'eval_batch_size' instead."
              )
          )
          config.dataset.eval_batch_size = (
              config.dataset.test_batch_size
          )
  
      if (
          "transform_config" in config.dataset.keys()
          and "val" in config.dataset.transform_config.keys()
      ):
          warn(
              DeprecationWarning(
                  "The 'transform_config.val' parameter is deprecated and will be removed in a future release. Please "
                  "use 'transform_config.eval' instead."
              )
          )
          config.dataset.transform_config.eval = (
              config.dataset.transform_config.val
          )
  
      config = update_input_size_config(config)
  
      if (
          "clip_length_in_frames" in config.dataset.keys()
          and config.dataset.clip_length_in_frames > 1
      ):
          warn(
              "Anomalib's models and visualizer are currently not compatible with video datasets with a clip length > 1. "
              "Custom changes to these modules will be needed to prevent errors and/or unpredictable behaviour."
          )
  
      if (
          config.dataset.format == "folder"
          and "split_ratio" in config.dataset.keys()
      ):
          warn(
              DeprecationWarning(
                  "The 'split_ratio' parameter is deprecated and will be removed in a future release. Please use "
                  "'test_split_ratio' instead."
              )
          )
          config.dataset.test_split_ratio = config.dataset.split_ratio
  
      if config.dataset.get(
          "test_split_mode"
      ) == TestSplitMode.NONE and config.dataset.get(
          "val_split_mode"
      ) in (
          ValSplitMode.SAME_AS_TEST,
          ValSplitMode.FROM_TEST,
      ):
          warn(
              f"val_split_mode {config.dataset.val_split_mode} not allowed for test_split_mode = 'none'. "
              "Setting val_split_mode to 'none'."
          )
          config.dataset.val_split_mode = ValSplitMode.NONE
  
      if (
          config.dataset.get("val_split_mode") == ValSplitMode.NONE
          and config.trainer.limit_val_batches != 0.0
      ):
          warn(
              "Running without validation set. Setting trainer.limit_val_batches to 0."
          )
          config.trainer.limit_val_batches = 0.0
      return config
  
file_path: anomalib/src/anomalib/config/config.py
imports: from __future__ import annotations
  import time
  import warnings
  from datetime import datetime
  from pathlib import Path
  from warnings import warn
  from omegaconf import DictConfig, ListConfig, OmegaConf
  from anomalib.data.utils import TestSplitMode, ValSplitMode
label_desc: Use image node_id 5 for calling a global function with example usage: update_datasets_config(config) and returns: config