code: def test_logging_results_with_no_dataloader_idx(tmpdir):
      num_dataloaders = 2
      log_common_same_val = {"test_log_common": 789}
      log_common_diff_val = "test_log_common_diff_value"
      log_key_no_dl_idx = "test_log_no_dl_idx_{}"
      log_key_dl0 = {"test_log_a_class": 123}
      log_key_dl1 = {"test_log_b_class": 456}
  
      class CustomBoringModel(BoringModel):
          def test_step(self, batch, batch_idx, dataloader_idx):
              self.log_dict(log_common_same_val)
              self.log(log_common_diff_val, dataloader_idx + 1)
              self.log(
                  log_key_no_dl_idx.format(dataloader_idx),
                  321 * (dataloader_idx + 1),
                  add_dataloader_idx=False,
              )
              self.log_dict(
                  log_key_dl0 if dataloader_idx == 0 else log_key_dl1,
                  add_dataloader_idx=False,
              )
  
          def test_dataloader(self):
              return [
                  torch.utils.data.DataLoader(RandomDataset(32, 64))
                  for _ in range(num_dataloaders)
              ]
  
      model = CustomBoringModel()
      trainer = Trainer(default_root_dir=tmpdir, fast_dev_run=1)
      results = trainer.test(model)
  
      assert len(results) == num_dataloaders
      assert results[0] == {
          "test_log_common/dataloader_idx_0": 789.0,
          "test_log_common_diff_value/dataloader_idx_0": 1.0,
          "test_log_no_dl_idx_0": 321,
          "test_log_a_class": 123.0,
      }
      assert results[1] == {
          "test_log_common/dataloader_idx_1": 789.0,
          "test_log_common_diff_value/dataloader_idx_1": 2.0,
          "test_log_no_dl_idx_1": 321 * 2,
          "test_log_b_class": 456.0,
      }
  
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 13 for calling a global function with example usage: test_logging_results_with_no_dataloader_idx(tmpdir) and returns: unknown