code: def _validate_callbacks_list(callbacks: List[Callback]) -> None:
      stateful_callbacks = [
          cb
          for cb in callbacks
          if is_overridden("state_dict", instance=cb)
      ]
      seen_callbacks = set()
      for callback in stateful_callbacks:
          if callback.state_key in seen_callbacks:
              raise RuntimeError(
                  f"Found more than one stateful callback of type `{type(callback).__name__}`. In the current"
                  " configuration, this callback does not support being saved alongside other instances of the same type."
                  f" Please consult the documentation of `{type(callback).__name__}` regarding valid settings for"
                  " the callback state to be checkpointable."
                  " HINT: The `callback.state_key` must be unique among all callbacks in the Trainer."
              )
          seen_callbacks.add(callback.state_key)
  
imports: import logging
  import os
  from datetime import timedelta
  from typing import Dict, List, Optional, Sequence, Union
  import lightning.pytorch
  from lightning.fabric.utilities.registry import _load_external_callbacks
  from lightning.pytorch.callbacks import Callback, Checkpoint, ModelCheckpoint, ModelSummary, ProgressBar, RichProgressBar, TQDMProgressBar
  from lightning.pytorch.callbacks.batch_size_finder import BatchSizeFinder
  from lightning.pytorch.callbacks.lr_finder import LearningRateFinder
  from lightning.pytorch.callbacks.rich_model_summary import RichModelSummary
  from lightning.pytorch.callbacks.timer import Timer
  from lightning.pytorch.trainer import call
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.model_helpers import is_overridden
  from lightning.pytorch.utilities.rank_zero import rank_zero_info
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_callbacks_list(callbacks) without return types