# Path: tensorboardX/summary.py
# def _clean_tag(name):
#     # In the past, the first argument to summary ops was a tag, which allowed
#     # arbitrary characters. Now we are changing the first argument to be the node
#     # name. This has a number of advantages (users of summary ops now can
#     # take advantage of the tf name scope system) but risks breaking existing
#     # usage, because a much smaller set of characters are allowed in node names.
#     # This function replaces all illegal characters with _s, and logs a warning.
#     # It also strips leading slashes from the name.
#     if name is not None:
#         new_name = _INVALID_TAG_CHARACTERS.sub('_', name)
#         new_name = new_name.lstrip('/')  # Remove leading slashes
#         if new_name != name:
#             logging.info(
#                 'Summary name %s is illegal; using %s instead.' % (name, new_name))
#             name = new_name
#     return name


import logging
import json
import functools
import numpy as np
    import comet_ml
from io import BytesIO
from google.protobuf.json_format import MessageToJson
from .summary import _clean_tag
    from PIL import Image
                    self._logging = True
                    self._experiment.log_other("Created from", "tensorboardX")
                except Exception as e:
                    logging.warning(e)

            if self._logging is True:
                return method(*args, **kwargs)
        return wrapper

    @_requiresComet
    def end(self):
        """Ends an experiment."""
        self._experiment.end()
        comet_ml.config.experiment = None

    @_requiresComet
    def log_metric(self, tag, display_name, value, step=None, epoch=None,
                   include_context=True):
        """Logs a general metric (i.e accuracy, f1)..

        Args:
            tag: String - Data identifier
            display_name: The title of the plot. If empty string is passed,
              `tag` will be used.
            value: Float/Integer/Boolean/String
            step: Optional. Used as the X axis when plotting on comet.ml
            epoch: Optional. Used as the X axis when plotting on comet.ml
            include_context: Optional. If set to True (the default),
                the current context will be logged along the metric.
        """

# Path: tensorboardX/summary.py
# def _clean_tag(name):
#     # In the past, the first argument to summary ops was a tag, which allowed
#     # arbitrary characters. Now we are changing the first argument to be the node
#     # name. This has a number of advantages (users of summary ops now can
#     # take advantage of the tf name scope system) but risks breaking existing
#     # usage, because a much smaller set of characters are allowed in node names.
#     # This function replaces all illegal characters with _s, and logs a warning.
#     # It also strips leading slashes from the name.
#     if name is not None:
#         new_name = _INVALID_TAG_CHARACTERS.sub('_', name)
#         new_name = new_name.lstrip('/')  # Remove leading slashes
#         if new_name != name:
#             logging.info(
#                 'Summary name %s is illegal; using %s instead.' % (name, new_name))
#             name = new_name
#     return name


# Path: tensorboardX/comet_utils.py
import logging
import json
import functools
import numpy as np
    import comet_ml
from io import BytesIO
from google.protobuf.json_format import MessageToJson
from .summary import _clean_tag
    from PIL import Image

                    self._logging = True
                    self._experiment.log_other("Created from", "tensorboardX")
                except Exception as e:
                    logging.warning(e)

            if self._logging is True:
                return method(*args, **kwargs)
        return wrapper

    @_requiresComet
    def end(self):
        """Ends an experiment."""
        self._experiment.end()
        comet_ml.config.experiment = None

    @_requiresComet
    def log_metric(self, tag, display_name, value, step=None, epoch=None,
                   include_context=True):
        """Logs a general metric (i.e accuracy, f1)..

        Args:
            tag: String - Data identifier
            display_name: The title of the plot. If empty string is passed,
              `tag` will be used.
            value: Float/Integer/Boolean/String
            step: Optional. Used as the X axis when plotting on comet.ml
            epoch: Optional. Used as the X axis when plotting on comet.ml
            include_context: Optional. If set to True (the default),
                the current context will be logged along the metric.
        """

        name = _clean_tag(tag) if display_name == "" else display_name