code: def test_lr_scheduler_epoch_step_frequency(
      mocked_sched, check_val_every_n_epoch, tmpdir
  ):
      epochs = 4
      expected_steps = (
          epochs + 1
      )  # every LRScheduler gets called once at init
  
      model = BoringModel()
      trainer = Trainer(
          default_root_dir=tmpdir,
          limit_train_batches=2,
          limit_val_batches=2,
          check_val_every_n_epoch=check_val_every_n_epoch,
          max_epochs=epochs,
      )
      trainer.fit(model)
      assert mocked_sched.call_count == expected_steps
  
imports: from unittest import mock
  from unittest.mock import call
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.core.optimizer import _configure_optimizers, _configure_schedulers_automatic_opt, _init_optimizers_and_lr_schedulers
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.types import LRSchedulerConfig
  from torch import optim
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 22 for calling a global function with example usage: test_lr_scheduler_epoch_step_frequency(mocked_sched, check_val_every_n_epoch, tmpdir) without return types