code: def test_multiple_optimizers_automatic_optimization_raises():
      """Test that multiple optimizers in automatic optimization is not allowed."""
  
      class TestModel(BoringModel):
          def training_step(self, batch, batch_idx, optimizer_idx):
              return super().training_step(batch, batch_idx)
  
      model = TestModel()
      model.automatic_optimization = True
  
      trainer = pl.Trainer()
      with pytest.raises(
          RuntimeError,
          match="Remove the `optimizer_idx` argument from `training_step`",
      ):
          trainer.fit(model)
  
      class TestModel(BoringModel):
          def configure_optimizers(self):
              return torch.optim.Adam(
                  self.parameters()
              ), torch.optim.Adam(self.parameters())
  
      model = TestModel()
      model.automatic_optimization = True
  
      trainer = pl.Trainer()
      with pytest.raises(
          RuntimeError,
          match="multiple optimizers is only supported with manual optimization",
      ):
          trainer.fit(model)
  
file_path: pytorch-lightning/tests/tests_pytorch/trainer/optimization/test_multiple_optimizers.py
imports: import lightning.pytorch
  import pytest
  import torch
  from lightning.pytorch.demos.boring_classes import BoringModel
label_desc: Use image node_id 1 for calling a global function with example usage: test_multiple_optimizers_automatic_optimization_raises() and returns: super, torch,  torch