code: def test_configure_sharded_model():
      class MyModel(BoringModel):
          def configure_sharded_model(self) -> None:
              ...
  
      model = MyModel()
      trainer = Trainer(devices=1, accelerator="cpu", fast_dev_run=1)
      with pytest.deprecated_call(
          match="overridden `MyModel.configure_sharded_model"
      ):
          trainer.fit(model)
  
      class MyModelBoth(MyModel):
          def configure_model(self):
              ...
  
      model = MyModelBoth()
      with pytest.raises(
          RuntimeError,
          match="Both `MyModelBoth.configure_model`, and `MyModelBoth.configure_sharded_model`",
      ):
          trainer.fit(model)
  
imports: import sys
  from unittest.mock import Mock
  import lightning.fabric
  import pytest
  import torch.nn
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.plugins.precision.double import LightningDoublePrecisionModule
  from lightning.pytorch.strategies import DDPStrategy, FSDPStrategy
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 1 for calling a global function with example usage: test_configure_sharded_model() without return types