code: def _patch_comet_atexit(monkeypatch):
      """Prevent comet logger from trying to print at exit, since pytest's stdout/stderr redirection breaks it."""
      import atexit
  
      monkeypatch.setattr(atexit, "register", lambda _: None)
  
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 1 for calling a global function with example usage: _patch_comet_atexit(monkeypatch) without return types