code: def test_on_train_batch_start_return_minus_one(
      max_epochs, batch_idx_, tmpdir
  ):
      class CurrentModel(BoringModel):
          def on_train_batch_start(self, batch, batch_idx):
              if batch_idx == batch_idx_:
                  return -1
              return None
  
      model = CurrentModel()
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=max_epochs,
          limit_train_batches=10,
      )
      trainer.fit(model)
      if batch_idx_ > trainer.num_training_batches - 1:
          assert (
              trainer.fit_loop.batch_idx
              == trainer.num_training_batches - 1
          )
          assert (
              trainer.global_step
              == trainer.num_training_batches * max_epochs
          )
      else:
          assert trainer.fit_loop.batch_idx == batch_idx_
          assert trainer.global_step == batch_idx_ * max_epochs
  
file_path: pytorch-lightning/tests/tests_pytorch/loops/test_training_loop.py
imports: import logging
  from unittest.mock import Mock
  import pytest
  import torch
  from lightning.pytorch import Trainer, seed_everything
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loops import _FitLoop
label_desc: Use image node_id 3 for calling a global function with example usage: test_on_train_batch_start_return_minus_one(max_epochs, batch_idx_, tmpdir) and returns: None, unknown