code: def test_multiple_optimizers_manual(tmpdir):
      class TestModel(MultiOptModel):
          def __init__(self):
              super().__init__()
              self.automatic_optimization = False
  
          def training_step(self, batch, batch_idx):
              self.training_step_called = True
  
              # manual optimization
              opt_a, opt_b = self.optimizers()
              loss_1 = self.step(batch[0])
  
              # fake generator
              self.manual_backward(loss_1)
              opt_a.step()
              opt_a.zero_grad()
  
              # fake discriminator
              loss_2 = self.step(batch[0])
              self.manual_backward(loss_2)
              opt_b.step()
              opt_b.zero_grad()
  
      model = TestModel()
      model.val_dataloader = None
  
      trainer = pl.Trainer(
          default_root_dir=tmpdir,
          limit_train_batches=2,
          max_epochs=1,
          log_every_n_steps=1,
          enable_model_summary=False,
      )
      trainer.fit(model)
  
      assert model.training_step_called
  
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 2 for calling a global function with example usage: test_multiple_optimizers_manual(tmpdir) without return types