code: def test_training_loop_dataloader_iter_multiple_dataloaders(tmp_path):
      trainer = Trainer(
          default_root_dir=tmp_path,
          limit_train_batches=3,
          limit_val_batches=0,
          max_epochs=1,
          enable_model_summary=False,
          enable_checkpointing=False,
          logger=False,
          devices=1,
      )
  
      class MyModel(BoringModel):
          batch_start_ins = []
          step_outs = []
          batch_end_ins = []
  
          def on_train_batch_start(
              self, batch, batch_idx, dataloader_idx=0
          ):
              self.batch_start_ins.append(
                  (batch, batch_idx, dataloader_idx)
              )
  
          def training_step(self, dataloader_iter):
              self.step_outs.append(next(dataloader_iter))
  
          def on_train_batch_end(
              self, outputs, batch, batch_idx, dataloader_idx=0
          ):
              self.batch_end_ins.append(
                  (batch, batch_idx, dataloader_idx)
              )
  
      model = MyModel()
      trainer.fit(model, {"a": [0, 1], "b": [2, 3]})
  
      assert (
          model.batch_start_ins == [(None, 0, 0)] + model.step_outs[:-1]
      )
      assert model.step_outs == [
          ({"a": 0, "b": 2}, 0, 0),
          ({"a": 1, "b": 3}, 1, 0),
      ]
      assert model.batch_end_ins == model.step_outs
  
file_path: pytorch-lightning/tests/tests_pytorch/loops/test_training_epoch_loop.py
imports: import logging
  from unittest.mock import Mock, patch
  import pytest
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.trainer.trainer import Trainer
label_desc: Use image node_id 4 for calling a global function with example usage: test_training_loop_dataloader_iter_multiple_dataloaders(tmp_path) without return types