code: def __verify_manual_optimization_support(
      trainer: "pl.Trainer", model: "pl.LightningModule"
  ) -> None:
      if model.automatic_optimization:
          return
      if (
          trainer.gradient_clip_val is not None
          and trainer.gradient_clip_val > 0
      ):
          raise MisconfigurationException(
              "Automatic gradient clipping is not supported for manual optimization."
              f" Remove `Trainer(gradient_clip_val={trainer.gradient_clip_val})`"
              " or switch to automatic optimization."
          )
      if trainer.accumulate_grad_batches != 1:
          raise MisconfigurationException(
              "Automatic gradient accumulation is not supported for manual optimization."
              f" Remove `Trainer(accumulate_grad_batches={trainer.accumulate_grad_batches})`"
              " or switch to automatic optimization."
          )
  
file_path: pytorch-lightning/src/lightning/pytorch/trainer/configuration_validator.py
imports: import lightning.pytorch
  from lightning.fabric.utilities.warnings import PossibleUserWarning
  from lightning.pytorch.trainer.states import TrainerFn
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.imports import _graphcore_available_and_importable
  from lightning.pytorch.utilities.model_helpers import is_overridden
  from lightning.pytorch.utilities.rank_zero import rank_zero_deprecation, rank_zero_warn
  from lightning.pytorch.utilities.signature_utils import is_param_in_hook_signature
label_desc: Use image node_id 5 for calling a global function with example usage: __verify_manual_optimization_support(trainer, model) without return types