code: def test_lr_finder_training_step_none_output(tmpdir):
      # add some nans into the skipped steps (first 10) but also into the steps used to compute the lr
      none_steps = [5, 12, 17]
  
      class CustomBoringModel(BoringModel):
          def __init__(self):
              super().__init__()
              self.lr = 0.123
  
          def training_step(
              self, batch: Any, batch_idx: int
          ) -> STEP_OUTPUT:
              if self.trainer.global_step in none_steps:
                  return None
  
              return super().training_step(batch, batch_idx)
  
      seed_everything(1)
      model = CustomBoringModel()
  
      trainer = Trainer(default_root_dir=tmpdir)
  
      tuner = Tuner(trainer)
      # restrict number of steps for faster test execution
      # and disable early stopping to easily check expected number of lrs and losses
      lr_finder = tuner.lr_find(
          model=model,
          update_attr=True,
          num_training=20,
          early_stop_threshold=None,
      )
      assert (
          len(lr_finder.results["lr"])
          == len(lr_finder.results["loss"])
          == 20
      )
      assert torch.isnan(
          torch.tensor(lr_finder.results["loss"])[none_steps]
      ).all()
  
      suggested_lr = lr_finder.suggestion()
      assert math.isfinite(suggested_lr)
      assert math.isclose(model.lr, suggested_lr)
  
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 20 for calling a global function with example usage: test_lr_finder_training_step_none_output(tmpdir) and returns: super, None