code: def _call_configure_model(trainer: "pl.Trainer") -> None:
      # legacy hook
      if is_overridden(
          "configure_sharded_model", trainer.lightning_module
      ):
          with trainer.strategy.model_sharded_context():
              _call_lightning_module_hook(
                  trainer, "configure_sharded_model"
              )
  
      # we don't normally check for this before calling the hook. it is done here to avoid instantiating the context
      # managers
      if is_overridden("configure_model", trainer.lightning_module):
          with trainer.strategy.tensor_init_context(), trainer.strategy.model_sharded_context(), trainer.precision_plugin.module_init_context():  # noqa: E501
              _call_lightning_module_hook(trainer, "configure_model")
  
imports: import logging
  from copy import deepcopy
  from typing import Any, Callable, Dict, Optional, Type, Union
  from packaging.version import Version
  import lightning.pytorch
  from lightning.fabric.utilities.device_dtype_mixin import _DeviceDtypeModuleMixin
  from lightning.pytorch.callbacks import Checkpoint, EarlyStopping
  from lightning.pytorch.trainer.states import TrainerStatus
  from lightning.pytorch.utilities.exceptions import _TunerExitException
  from lightning.pytorch.utilities.model_helpers import is_overridden
  from lightning.pytorch.utilities.rank_zero import rank_zero_warn
label_desc: Use image node_id 3 for calling a global function with example usage: _call_configure_model(trainer) without return types