code: def test_lr_monitor_duplicate_custom_pg_names(tmpdir):
      class TestModel(BoringModel):
          def __init__(self):
              super().__init__()
              self.linear_a = torch.nn.Linear(32, 16)
              self.linear_b = torch.nn.Linear(16, 2)
  
          def forward(self, x):
              x = self.linear_a(x)
              x = self.linear_b(x)
              return x
  
          def configure_optimizers(self):
              param_groups = [
                  {
                      "params": list(self.linear_a.parameters()),
                      "name": "linear",
                  },
                  {
                      "params": list(self.linear_b.parameters()),
                      "name": "linear",
                  },
              ]
              optimizer = torch.optim.SGD(param_groups, lr=0.1)
              lr_scheduler = torch.optim.lr_scheduler.StepLR(
                  optimizer, step_size=1
              )
              return [optimizer], [lr_scheduler]
  
      lr_monitor = LearningRateMonitor()
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=2,
          limit_val_batches=2,
          limit_train_batches=2,
          callbacks=[lr_monitor],
          logger=CSVLogger(tmpdir),
          enable_progress_bar=False,
          enable_model_summary=False,
      )
  
      with pytest.raises(
          MisconfigurationException,
          match="A single `Optimizer` cannot have multiple parameter groups with identical",
      ):
          trainer.fit(TestModel())
  
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 13 for calling a global function with example usage: test_lr_monitor_duplicate_custom_pg_names(tmpdir) and returns: x, list,  list