code: def test_lr_monitor_param_groups(tmpdir):
      """Test that learning rates are extracted and logged for single lr scheduler."""
  
      class CustomClassificationModel(ClassificationModel):
          def configure_optimizers(self):
              param_groups = [
                  {
                      "params": list(self.parameters())[:2],
                      "lr": self.lr * 0.1,
                  },
                  {
                      "params": list(self.parameters())[2:],
                      "lr": self.lr,
                  },
              ]
  
              optimizer = optim.Adam(param_groups)
              lr_scheduler = optim.lr_scheduler.StepLR(
                  optimizer, 1, gamma=0.1
              )
              return [optimizer], [lr_scheduler]
  
      model = CustomClassificationModel()
      dm = ClassifDataModule()
  
      lr_monitor = LearningRateMonitor()
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=2,
          limit_val_batches=0.1,
          limit_train_batches=0.5,
          callbacks=[lr_monitor],
          logger=CSVLogger(tmpdir),
      )
      trainer.fit(model, datamodule=dm)
  
      assert lr_monitor.lrs, "No learning rates logged"
      assert len(lr_monitor.lrs) == 2 * len(
          trainer.lr_scheduler_configs
      )
      assert list(lr_monitor.lrs) == [
          "lr-Adam/pg1",
          "lr-Adam/pg2",
      ], "Names of learning rates not set correctly"
  
imports: import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import EarlyStopping, LearningRateMonitor
  from lightning.pytorch.callbacks.callback import Callback
  from lightning.pytorch.callbacks.finetuning import BackboneFinetuning
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import CSVLogger
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from torch import optim
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
label_desc: Use image node_id 10 for calling a global function with example usage: test_lr_monitor_param_groups(tmpdir) and returns: list,  list