code: def test_optimizer_with_scheduling(tmpdir):
      """Verify that learning rate scheduling is working."""
      model = BoringModel()
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=1,
          limit_val_batches=0.1,
          limit_train_batches=0.2,
          val_check_interval=0.5,
      )
      trainer.fit(model)
  
      init_lr = 0.1
      adjusted_lr = [
          pg["lr"] for pg in trainer.optimizers[0].param_groups
      ]
  
      assert len(trainer.lr_scheduler_configs) == 1
      assert all(a == adjusted_lr[0] for a in adjusted_lr)
      assert init_lr * 0.1 == adjusted_lr[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 1 for calling a global function with example usage: test_optimizer_with_scheduling(tmpdir) without return types