code: def test_lr_monitor_no_lr_scheduler_multi_lrs(
      tmpdir, logging_interval: str
  ):
      """Test that learning rates are extracted and logged for multi optimizers but no lr scheduler."""
  
      class CustomBoringModel(BoringModel):
          def __init__(self):
              super().__init__()
              self.automatic_optimization = False
  
          def training_step(self, batch, batch_idx):
              opt1, opt2 = self.optimizers()
  
              loss = self.loss(self.step(batch))
              opt1.zero_grad()
              self.manual_backward(loss)
              opt1.step()
  
              loss = self.loss(self.step(batch))
              opt2.zero_grad()
              self.manual_backward(loss)
              opt2.step()
  
          def configure_optimizers(self):
              optimizer1 = optim.Adam(self.parameters(), lr=1e-2)
              optimizer2 = optim.Adam(self.parameters(), lr=1e-2)
  
              return [optimizer1, optimizer2]
  
      model = CustomBoringModel()
  
      lr_monitor = LearningRateMonitor(
          logging_interval=logging_interval
      )
      log_every_n_steps = 2
  
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=2,
          log_every_n_steps=log_every_n_steps,
          limit_train_batches=7,
          limit_val_batches=0.1,
          callbacks=[lr_monitor],
          logger=CSVLogger(tmpdir),
      )
      trainer.fit(model)
  
      assert lr_monitor.lrs, "No learning rates logged"
      assert len(lr_monitor.lrs) == len(trainer.optimizers)
      assert list(lr_monitor.lrs) == [
          "lr-Adam",
          "lr-Adam-1",
      ], "Names of learning rates not set correctly"
  
      if logging_interval == "step":
          # divide by 2 because we have 2 optimizers
          expected_number_logged = (
              trainer.global_step // 2 // log_every_n_steps
          )
      if logging_interval == "epoch":
          expected_number_logged = trainer.max_epochs
  
      assert all(
          len(lr) == expected_number_logged
          for lr in lr_monitor.lrs.values()
      )
  
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 9 for calling a global function with example usage: test_lr_monitor_no_lr_scheduler_multi_lrs(tmpdir, logging_interval) and returns: list