code: def _verify_loop_configurations(trainer: "pl.Trainer") -> None:
      r"""Checks that the model is configured correctly before the run is started.
  
      Args:
          trainer: Lightning Trainer. Its `lightning_module` (the model) to check the configuration.
  
      """
      model = trainer.lightning_module
  
      if trainer.state.fn is None:
          raise ValueError(
              "Unexpected: Trainer state fn must be set before validating loop configuration."
          )
      if trainer.state.fn == TrainerFn.FITTING:
          __verify_train_val_loop_configuration(trainer, model)
          __verify_manual_optimization_support(trainer, model)
      elif trainer.state.fn == TrainerFn.VALIDATING:
          __verify_eval_loop_configuration(model, "val")
      elif trainer.state.fn == TrainerFn.TESTING:
          __verify_eval_loop_configuration(model, "test")
      elif trainer.state.fn == TrainerFn.PREDICTING:
          __verify_eval_loop_configuration(model, "predict")
  
      __verify_batch_transfer_support(trainer)
  
      __verify_configure_model_configuration(model)
  
      __warn_dataloader_iter_limitations(model)
  
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 1 for calling a global function with example usage: _verify_loop_configurations(trainer) without return types