code: def test_error_with_multiple_optimizers(tmpdir):
      """Check that error is thrown when more than 1 optimizer is passed."""
  
      class CustomBoringModel(BoringModel):
          def __init__(self, lr):
              super().__init__()
              self.save_hyperparameters()
              self.automatic_optimization = False
  
          def configure_optimizers(self):
              optimizer1 = torch.optim.SGD(
                  self.parameters(), lr=self.hparams.lr
              )
              optimizer2 = torch.optim.Adam(
                  self.parameters(), lr=self.hparams.lr
              )
              return [optimizer1, optimizer2]
  
      model = CustomBoringModel(lr=1e-2)
  
      trainer = Trainer(default_root_dir=tmpdir, max_epochs=1)
      tuner = Tuner(trainer)
  
      with pytest.raises(
          MisconfigurationException,
          match="only works with single optimizer",
      ):
          tuner.lr_find(model)
  
imports: import logging
  import math
  import os
  from copy import deepcopy
  from typing import Any
  from unittest import mock
  import pytest
  import torch
  from lightning.pytorch import Trainer, seed_everything
  from lightning.pytorch.callbacks.lr_finder import LearningRateFinder
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.tuner.lr_finder import _LRFinder
  from lightning.pytorch.tuner.tuning import Tuner
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.types import STEP_OUTPUT
  from lightning_utilities.test.warning import no_warning_call
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
  from tests_pytorch.helpers.utils import getattr_recursive
label_desc: Use image node_id 1 for calling a global function with example usage: test_error_with_multiple_optimizers(tmpdir) and returns: list