code: def test_comet_logger_dirs_creation(
      comet_mock, tmp_path, monkeypatch
  ):
      """Test that the logger creates the folders and files in the right place."""
      _patch_comet_atexit(monkeypatch)
      comet_experiment = comet_mock.OfflineExperiment
  
      comet_mock.config.get_api_key.return_value = None
      comet_mock.generate_guid = Mock()
      comet_mock.generate_guid.return_value = "4321"
  
      logger = CometLogger(project_name="test", save_dir=str(tmp_path))
      assert not os.listdir(tmp_path)
      assert logger.mode == "offline"
      assert logger.save_dir == str(tmp_path)
      assert logger.name == "test"
      assert logger.version == "4321"
  
      _ = logger.experiment
      comet_experiment.assert_called_once_with(
          offline_directory=str(tmp_path), project_name="test"
      )
  
      # mock return values of experiment
      logger.experiment.id = "1"
      logger.experiment.project_name = "test"
  
      model = BoringModel()
      trainer = Trainer(
          default_root_dir=tmp_path,
          logger=logger,
          max_epochs=1,
          limit_train_batches=3,
          limit_val_batches=3,
      )
      assert trainer.log_dir == logger.save_dir
      trainer.fit(model)
  
      assert trainer.checkpoint_callback.dirpath == str(
          tmp_path / "test" / "1" / "checkpoints"
      )
      assert set(os.listdir(trainer.checkpoint_callback.dirpath)) == {
          "epoch=0-step=3.ckpt"
      }
      assert trainer.log_dir == logger.save_dir
  
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 6 for calling a global function with example usage: test_comet_logger_dirs_creation(comet_mock, tmp_path, monkeypatch) without return types