code: def _requiresComet(method):
      @functools.wraps(method)
      def wrapper(*args, **kwargs):
          self = args[0]
          global comet_installed
          if self._logging is None and comet_installed:
              self._logging = False
              try:
                  if "api_key" not in self._comet_config.keys():
                      comet_ml.init()
                  if comet_ml.get_global_experiment() is not None:
                      logger.warning(
                          "You have already created a comet \
                                          experiment manually, which might \
                                          cause clashes"
                      )
                  self._experiment = comet_ml.Experiment(
                      **self._comet_config
                  )
                  self._logging = True
                  self._experiment.log_other(
                      "Created from", "tensorboardX"
                  )
              except Exception as e:
                  logger.warning(e)
  
          if self._logging is True:
              return method(*args, **kwargs)
  
      return wrapper
  
imports: import logging
  import json
  import functools
  from io import BytesIO
  from google.protobuf.json_format import MessageToJson
  import numpy
  from .summary import _clean_tag
label_desc: Use image node_id 2 for calling the CometLogger obj's underlying member method code with example usage: obj._requiresComet(method) and returns: wrapper, method