code: def _check_lr_find_configuration(trainer: "pl.Trainer") -> None:
      # local import to avoid circular import
      from lightning.pytorch.callbacks.lr_finder import (
          LearningRateFinder,
      )
  
      configured_callbacks = [
          cb
          for cb in trainer.callbacks
          if isinstance(cb, LearningRateFinder)
      ]
      if configured_callbacks:
          raise ValueError(
              "Trainer is already configured with a `LearningRateFinder` callback."
              "Please remove it if you want to use the Tuner."
          )
  
file_path: pytorch-lightning/src/lightning/pytorch/tuner/tuning.py
imports: from typing import TYPE_CHECKING, Literal, Optional, Union
  import lightning.pytorch
  from lightning.pytorch.callbacks.callback import Callback
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.types import EVAL_DATALOADERS, TRAIN_DATALOADERS
label_desc: Use image node_id 2 for calling a global function with example usage: _check_lr_find_configuration(trainer) without return types