code: def update_input_size_config(
      config: DictConfig | ListConfig,
  ) -> DictConfig | ListConfig:
      """Update config with image size as tuple, effective input size and tiling stride.
  
      Convert integer image size parameters into tuples, calculate the effective input size based on image size
      and crop size, and set tiling stride if undefined.
  
      Args:
          config (DictConfig | ListConfig): Configurable parameters object
  
      Returns:
          DictConfig | ListConfig: Configurable parameters with updated values
      """
      # Image size: Ensure value is in the form [height, width]
      image_size = config.dataset.get("image_size")
      if isinstance(image_size, int):
          config.dataset.image_size = (image_size,) * 2
      elif isinstance(image_size, ListConfig):
          assert (
              len(image_size) == 2
          ), "image_size must be a single integer or tuple of length 2 for width and height."
      else:
          raise ValueError(
              f"image_size must be either int or ListConfig, got {type(image_size)}"
          )
  
      # Center crop: Ensure value is in the form [height, width], and update input_size
      center_crop = config.dataset.get("center_crop")
      if center_crop is None:
          config.model.input_size = config.dataset.image_size
      elif isinstance(center_crop, int):
          config.dataset.center_crop = (center_crop,) * 2
          config.model.input_size = config.dataset.center_crop
      elif isinstance(center_crop, ListConfig):
          assert (
              len(center_crop) == 2
          ), "center_crop must be a single integer or tuple of length 2 for width and height."
          config.model.input_size = center_crop
      else:
          raise ValueError(
              f"center_crop must be either int or ListConfig, got {type(center_crop)}"
          )
  
      if (
          "tiling" in config.dataset.keys()
          and config.dataset.tiling.apply
      ):
          if isinstance(config.dataset.tiling.tile_size, int):
              config.dataset.tiling.tile_size = (
                  config.dataset.tiling.tile_size,
              ) * 2
          if config.dataset.tiling.stride is None:
              config.dataset.tiling.stride = (
                  config.dataset.tiling.tile_size
              )
  
      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 2 for calling a global function with example usage: update_input_size_config(config) and returns: config