code: def test_multi_optimizer_with_scheduling(tmpdir):
      """Verify that learning rate scheduling is working."""
  
      class Model(BoringModel):
          init_lr = 5e-4
  
          def training_step(self, batch, batch_idx):
              opt1, opt2 = self.optimizers()
              loss = self.loss(self.step(batch))
              opt1.zero_grad()
              opt2.zero_grad()
              self.manual_backward(loss)
              opt1.step()
              opt2.step()
  
          def on_train_epoch_end(self):
              scheduler1, scheduler2 = self.lr_schedulers()
              scheduler1.step()
              scheduler2.step()
  
          def configure_optimizers(self):
              optimizer1 = optim.Adam(
                  self.parameters(), lr=self.init_lr
              )
              optimizer2 = optim.Adam(
                  self.parameters(), lr=self.init_lr
              )
              lr_scheduler1 = optim.lr_scheduler.StepLR(
                  optimizer1, step_size=1
              )
              lr_scheduler2 = optim.lr_scheduler.StepLR(
                  optimizer2, step_size=1
              )
              return [optimizer1, optimizer2], [
                  lr_scheduler1,
                  lr_scheduler2,
              ]
  
      model = Model()
      model.automatic_optimization = False
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=1,
          limit_val_batches=0.1,
          limit_train_batches=0.2,
      )
      trainer.fit(model)
  
      adjusted_lr1 = [
          pg["lr"] for pg in trainer.optimizers[0].param_groups
      ]
      adjusted_lr2 = [
          pg["lr"] for pg in trainer.optimizers[1].param_groups
      ]
  
      assert len(trainer.lr_scheduler_configs) == 2
      assert all(a == adjusted_lr1[0] for a in adjusted_lr1)
      assert all(a == adjusted_lr2[0] for a in adjusted_lr2)
      assert model.init_lr * 0.1 == adjusted_lr1[0]
      assert model.init_lr * 0.1 == adjusted_lr2[0]
  
imports: from unittest import mock
  from unittest.mock import call
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.core.optimizer import _configure_optimizers, _configure_schedulers_automatic_opt, _init_optimizers_and_lr_schedulers
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.types import LRSchedulerConfig
  from torch import optim
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 2 for calling a global function with example usage: test_multi_optimizer_with_scheduling(tmpdir) and returns: list,  list