code: def test_comet_epoch_logging(comet_mock, tmp_path, monkeypatch):
      """Test that CometLogger removes the epoch key from the metrics dict and passes it as argument."""
      _patch_comet_atexit(monkeypatch)
      logger = CometLogger(project_name="test", save_dir=str(tmp_path))
      logger.log_metrics({"test": 1, "epoch": 1}, step=123)
      logger.experiment.log_metrics.assert_called_once_with(
          {"test": 1}, epoch=1, step=123
      )
  
imports: import os
  from unittest import mock
  from unittest.mock import DEFAULT, Mock, patch
  import pytest
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import CometLogger
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from torch import tensor
label_desc: Use image node_id 10 for calling a global function with example usage: test_comet_epoch_logging(comet_mock, tmp_path, monkeypatch) without return types