code: def test_multiple_dataloaders_reset(val_check_interval, tmpdir):
      class TestModel(BoringModel):
          val_outputs = [[], []]
  
          def training_step(self, batch, batch_idx):
              out = super().training_step(batch, batch_idx)
              value = 1 + batch_idx
              if self.current_epoch != 0:
                  value *= 10
              self.log(
                  "batch_idx",
                  value,
                  on_step=True,
                  on_epoch=True,
                  prog_bar=True,
              )
              return out
  
          def on_train_epoch_end(self):
              metrics = self.trainer.progress_bar_metrics
              v = 15 if self.current_epoch == 0 else 150
              assert metrics["batch_idx_epoch"] == (v / 5.0)
  
          def validation_step(self, batch, batch_idx, dataloader_idx):
              value = (1 + batch_idx) * (1 + dataloader_idx)
              if self.current_epoch != 0:
                  value *= 10
              self.val_outputs[dataloader_idx].append(value)
              self.log(
                  "val_loss",
                  value,
                  on_step=False,
                  on_epoch=True,
                  prog_bar=True,
                  logger=True,
              )
  
          def on_validation_epoch_end(self):
              outputs = self.val_outputs
              self.val_outputs = [[], []]
  
              if self.current_epoch == 0:
                  assert sum(outputs[0]) / 5 == 3
                  assert sum(outputs[1]) / 5 == 6
              else:
                  assert sum(outputs[0]) / 5 == 30
                  assert sum(outputs[1]) / 5 == 60
  
              tot_loss = torch.mean(
                  torch.tensor(outputs, dtype=torch.float)
              )
              if self.current_epoch == 0:
                  assert tot_loss == (3 + 6) / 2
              else:
                  assert tot_loss == (30 + 60) / 2
              assert (
                  self.trainer._results[
                      "validation_step.val_loss.0"
                  ].cumulated_batch_size
                  == 5
              )
              assert (
                  self.trainer._results[
                      "validation_step.val_loss.1"
                  ].cumulated_batch_size
                  == 5
              )
  
          def val_dataloader(self):
              return [
                  super().val_dataloader(),
                  super().val_dataloader(),
              ]
  
      model = TestModel()
      trainer = Trainer(
          default_root_dir=tmpdir,
          limit_train_batches=5,
          limit_val_batches=5,
          num_sanity_val_steps=0,
          val_check_interval=val_check_interval,
          max_epochs=3,
          log_every_n_steps=1,
          enable_model_summary=False,
      )
      trainer.fit(model)
  
imports: import collections
  import itertools
  import os
  from contextlib import redirect_stdout
  from io import StringIO
  from unittest import mock
  from unittest.mock import ANY, call
  import numpy
  import pytest
  import torch
  from lightning.fabric.utilities.imports import _PYTHON_GREATER_EQUAL_3_8_0
  from lightning.pytorch import Trainer, callbacks
  from lightning.pytorch.callbacks.progress.rich_progress import _RICH_AVAILABLE
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset
  from lightning.pytorch.loggers import TensorBoardLogger
  from lightning.pytorch.loops import _EvaluationLoop
  from lightning.pytorch.trainer.states import RunningStage
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from torch import Tensor
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 11 for calling a global function with example usage: test_multiple_dataloaders_reset(val_check_interval, tmpdir) and returns: out, list