code: def test_logger_with_prefix_all(
      mlflow_mock,
      wandb_mock,
      comet_mock,
      neptune_mock,
      monkeypatch,
      tmp_path,
  ):
      """Test that prefix is added at the beginning of the metric keys."""
      prefix = "tmp"
  
      # Comet
      _patch_comet_atexit(monkeypatch)
      logger = _instantiate_logger(
          CometLogger, save_dir=tmp_path, prefix=prefix
      )
      logger.log_metrics({"test": 1.0}, step=0)
      logger.experiment.log_metrics.assert_called_once_with(
          {"tmp-test": 1.0}, epoch=None, step=0
      )
  
      # MLflow
      Metric = mlflow_mock.entities.Metric
      logger = _instantiate_logger(
          MLFlowLogger, save_dir=tmp_path, prefix=prefix
      )
      logger.log_metrics({"test": 1.0}, step=0)
      logger.experiment.log_batch.assert_called_once_with(
          run_id=ANY,
          metrics=[
              Metric(key="tmp-test", value=1.0, timestamp=ANY, step=0)
          ],
      )
  
      # Neptune
      logger = _instantiate_logger(
          NeptuneLogger,
          api_key="test",
          project="project",
          save_dir=tmp_path,
          prefix=prefix,
      )
      assert logger.experiment.__getitem__.call_count == 0
      logger.log_metrics({"test": 1.0}, step=0)
      assert logger.experiment.__getitem__.call_count == 1
      logger.experiment.__getitem__.assert_called_with("tmp/test")
      logger.experiment.__getitem__().append.assert_called_once_with(
          1.0, step=0
      )
  
      # TensorBoard
      if _TENSORBOARD_AVAILABLE:
          import torch.utils.tensorboard as tb
      else:
          import tensorboardX as tb
  
      monkeypatch.setattr(tb, "SummaryWriter", Mock())
      logger = _instantiate_logger(
          TensorBoardLogger, save_dir=tmp_path, prefix=prefix
      )
      logger.log_metrics({"test": 1.0}, step=0)
      logger.experiment.add_scalar.assert_called_once_with(
          "tmp-test", 1.0, 0
      )
  
      # WandB
      logger = _instantiate_logger(
          WandbLogger, save_dir=tmp_path, prefix=prefix
      )
      wandb_mock.run = None
      wandb_mock.init().step = 0
      logger.log_metrics({"test": 1.0}, step=0)
      logger.experiment.log.assert_called_once_with(
          {"tmp-test": 1.0, "trainer/global_step": 0}
      )
  
imports: import inspect
  import os
  import pickle
  from unittest import mock
  from unittest.mock import ANY, Mock
  import pytest
  import torch
  from lightning.pytorch import Callback, Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import CometLogger, CSVLogger, MLFlowLogger, NeptuneLogger, TensorBoardLogger, WandbLogger
  from lightning.pytorch.loggers.logger import DummyExperiment, Logger
  from lightning.pytorch.loggers.tensorboard import _TENSORBOARD_AVAILABLE
  from lightning.pytorch.tuner.tuning import Tuner
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.loggers.test_comet import _patch_comet_atexit
  from tests_pytorch.loggers.test_mlflow import mock_mlflow_run_creation
label_desc: Use image node_id 9 for calling a global function with example usage: test_logger_with_prefix_all(mlflow_mock, wandb_mock, comet_mock, neptune_mock, monkeypatch, tmp_path) without return types