class_docstr: CometLoggerCallback for logging Tune results to Comet.
  
  Comet (https://comet.ml/site/) is a tool to manage and optimize the
  entire ML lifecycle, from experiment tracking, model optimization
  and dataset versioning to model production monitoring.
  
  This Ray Tune ``LoggerCallback`` sends metrics and parameters to
  Comet for tracking.
  
  In order to use the CometLoggerCallback you must first install Comet
  via ``pip install comet_ml``
  
  Then set the following environment variables
  ``export COMET_API_KEY=<Your API Key>``
  
  Alternatively, you can also pass in your API Key as an argument to the
  CometLoggerCallback constructor.
  
  ``CometLoggerCallback(api_key=<Your API Key>)``
  
  Args:
          online: Whether to make use of an Online or
              Offline Experiment. Defaults to True.
          tags: Tags to add to the logged Experiment.
              Defaults to None.
          save_checkpoints: If ``True``, model checkpoints will be saved to
              Comet ML as artifacts. Defaults to ``False``.
          **experiment_kwargs: Other keyword arguments will be passed to the
              constructor for comet_ml.Experiment (or OfflineExperiment if
              online=False).
  
  Please consult the Comet ML documentation for more information on the
  Experiment and OfflineExperiment classes: https://comet.ml/site/
  
  Example:
  
  .. code-block:: python
  
      from ray.air.integrations.comet import CometLoggerCallback
      tune.run(
          train,
          config=config
          callbacks=[CometLoggerCallback(
              True,
              ['tag1', 'tag2'],
              workspace='my_workspace',
              project_name='my_project_name'
              )]
      )
class_docstr_tok: ["CometLoggerCallback","for","logging","Tune","results","to","Comet",".","Comet","(","https",":","\/\/comet.ml\/site\/",")","is","a","tool","to","manage","and","optimize","the","entire","ML","lifecycle",",","from","experiment","tracking",",","model","optimization","and","dataset","versioning","to","model","production","monitoring",".","This","Ray","Tune","``","LoggerCallback","``","sends","metrics","and","parameters","to","Comet","for","tracking",".","In","order","to","use","the","CometLoggerCallback","you","must","first","install","Comet","via","``","pip","install","comet_ml","``","Then","set","the","following","environment","variables","``","export","COMET_API_KEY=","<","Your","API","Key",">","``","Alternatively",",","you","can","also","pass","in","your","API","Key","as","an","argument","to","the","CometLoggerCallback","constructor",".","``","CometLoggerCallback","(","api_key=","<","Your","API","Key",">",")","``","Args",":","online",":","Whether","to","make","use","of","an","Online","or","Offline","Experiment",".","Defaults","to","True",".","tags",":","Tags","to","add","to","the","logged","Experiment",".","Defaults","to","None",".","save_checkpoints",":","If","``","True","``",",","model","checkpoints","will","be","saved","to","Comet","ML","as","artifacts",".","Defaults","to","``","False","``",".","*","*","experiment_kwargs",":","Other","keyword","arguments","will","be","passed","to","the","constructor","for","comet_ml.Experiment","(","or","OfflineExperiment","if","online=False",")",".","Please","consult","the","Comet","ML","documentation","for","more","information","on","the","Experiment","and","OfflineExperiment","classes",":","https",":","\/\/comet.ml\/site\/","Example",":","..","code-block",":",":","python","from","ray.air.integrations.comet","import","CometLoggerCallback","tune.run","(","train",",","config=config","callbacks=","[","CometLoggerCallback","(","True",",","[","'tag1","'",",","'tag2","'","]",",","workspace='my_workspace","'",",","project_name='my_project_name'",")","]",")"]
docstr: Initialize an Experiment (or OfflineExperiment if self.online=False)
  and start logging to Comet.
  
  Args:
      trial: Trial object.
docstr_tok: ["Initialize","an","Experiment","(","or","OfflineExperiment","if","self.online=False",")","and","start","logging","to","Comet",".","Args",":","trial",":","Trial","object","."]
code: def log_trial_start(self, trial: "Trial"):
      """
      Initialize an Experiment (or OfflineExperiment if self.online=False)
      and start logging to Comet.
  
      Args:
          trial: Trial object.
  
      """
      _import_comet()  # is this necessary?
      from comet_ml import Experiment, OfflineExperiment
      from comet_ml.config import set_global_experiment
  
      if trial not in self._trial_experiments:
          experiment_cls = (
              Experiment if self.online else OfflineExperiment
          )
          experiment = experiment_cls(**self.experiment_kwargs)
          self._trial_experiments[trial] = experiment
          # Set global experiment to None to allow for multiple experiments.
          set_global_experiment(None)
      else:
          experiment = self._trial_experiments[trial]
  
      experiment.set_name(str(trial))
      experiment.add_tags(self.tags)
      experiment.log_other("Created from", "Ray")
  
      config = trial.config.copy()
      config.pop("callbacks", None)
      experiment.log_parameters(config)
  
file_path: ray/python/ray/air/integrations/comet.py
imports: import os
  from typing import Dict, List
  import pyarrow.fs
  from ray.tune.logger import LoggerCallback
  from ray.tune.experiment import Trial
  from ray.tune.utils import flatten_dict
label_desc: Use image node_id 4 for calling the CometLoggerCallback obj's underlying member method code with example usage: obj.log_trial_start(trial) without return types