class_docstr: A class for managing Neptune experiment.
  
  Each time User creates new experiment instance of this class is created.
  It lets you manage experiment, :meth:`~neptune.experiments.Experiment.log_metric`,
  :meth:`~neptune.experiments.Experiment.log_text`,
  :meth:`~neptune.experiments.Experiment.log_image`,
  :meth:`~neptune.experiments.Experiment.set_property`,
  and much more.
  
  
  Args:
      backend (:obj:`neptune.ApiClient`): A ApiClient object
      project (:obj:`neptune.Project`): The project this experiment belongs to
      _id (:obj:`str`): Experiment id
      internal_id (:obj:`str`): internal ID
  
  Example:
      Assuming that `project` is an instance of :class:`~neptune.projects.Project`.
  
      .. code:: python3
  
          experiment = project.create_experiment()
  
  Warning:
      User should never create instances of this class manually.
      Always use: :meth:`~neptune.projects.Project.create_experiment`.
class_docstr_tok: ["A","class","for","managing","Neptune","experiment",".","Each","time","User","creates","new","experiment","instance","of","this","class","is","created",".","It","lets","you","manage","experiment",",",":","meth",":","`","~neptune.experiments.Experiment.log_metric","`",",",":","meth",":","`","~neptune.experiments.Experiment.log_text","`",",",":","meth",":","`","~neptune.experiments.Experiment.log_image","`",",",":","meth",":","`","~neptune.experiments.Experiment.set_property","`",",","and","much","more",".","Args",":","backend","(",":","obj",":","`","neptune.ApiClient","`",")",":","A","ApiClient","object","project","(",":","obj",":","`","neptune.Project","`",")",":","The","project","this","experiment","belongs","to","_id","(",":","obj",":","`","str","`",")",":","Experiment","id","internal_id","(",":","obj",":","`","str","`",")",":","internal","ID","Example",":","Assuming","that","`","project","`","is","an","instance","of",":","class",":","`","~neptune.projects.Project","`",".","..","code",":",":","python3","experiment","=","project.create_experiment","(",")","Warning",":","User","should","never","create","instances","of","this","class","manually",".","Always","use",":",":","meth",":","`","~neptune.projects.Project.create_experiment","`","."]
docstr: Log metrics (numeric values) in Neptune
  
  | If a log with provided ``log_name`` does not exist, it is created automatically.
  | If log exists (determined by ``log_name``), then new value is appended to it.
  
  Args:
      log_name (:obj:`str`): The name of log, i.e. `mse`, `loss`, `accuracy`.
      x (:obj:`double`): Depending, whether ``y`` parameter is passed:
  
          * ``y`` not passed: The value of the log (data-point).
          * ``y`` passed: Index of log entry being appended. Must be strictly increasing.
  
      y (:obj:`double`, optional, default is ``None``): The value of the log (data-point).
      timestamp (:obj:`time`, optional, default is ``None``):
          Timestamp to be associated with log entry. Must be Unix time.
          If ``None`` is passed, `time.time() <https://docs.python.org/3.6/library/time.html#time.time>`_
          (Python 3.6 example) is invoked to obtain timestamp.
  
  Example:
      Assuming that `experiment` is an instance of :class:`~neptune.experiments.Experiment` and
      'accuracy' log does not exists:
  
      .. code:: python3
  
          # Both calls below have the same effect
  
          # Common invocation, providing log name and value
          experiment.log_metric('accuracy', 0.5)
          experiment.log_metric('accuracy', 0.65)
          experiment.log_metric('accuracy', 0.8)
  
          # Providing both x and y params
          experiment.log_metric('accuracy', 0, 0.5)
          experiment.log_metric('accuracy', 1, 0.65)
          experiment.log_metric('accuracy', 2, 0.8)
  
          # Common invocation, logging loss tensor in PyTorch
          loss = torch.Tensor([0.89])
          experiment.log_metric('log-loss', loss)
  
          # Common invocation, logging metric tensor in Tensorflow
          acc = tf.constant([0.93])
          experiment.log_metric('accuracy', acc)
          f1_score = tf.constant(0.78)
          experiment.log_metric('f1_score', f1_score)
  
  Note:
      For efficiency, logs are uploaded in batches via a queue.
      Hence, if you log a lot of data, you may experience slight delays in Neptune web application.
  Note:
      Passing either ``x`` or ``y`` coordinate as NaN or +/-inf causes this log entry to be ignored.
      Warning is printed to ``stdout``.
docstr_tok: ["Log","metrics","(","numeric","values",")","in","Neptune","|","If","a","log","with","provided","``","log_name","``","does","not","exist",",","it","is","created","automatically",".","|","If","log","exists","(","determined","by","``","log_name","``",")",",","then","new","value","is","appended","to","it",".","Args",":","log_name","(",":","obj",":","`","str","`",")",":","The","name","of","log",",","i.e",".","`","mse","`",",","`","loss","`",",","`","accuracy","`",".","x","(",":","obj",":","`","double","`",")",":","Depending",",","whether","``","y","``","parameter","is","passed",":","*","``","y","``","not","passed",":","The","value","of","the","log","(","data-point",")",".","*","``","y","``","passed",":","Index","of","log","entry","being","appended",".","Must","be","strictly","increasing",".","y","(",":","obj",":","`","double","`",",","optional",",","default","is","``","None","``",")",":","The","value","of","the","log","(","data-point",")",".","timestamp","(",":","obj",":","`","time","`",",","optional",",","default","is","``","None","``",")",":","Timestamp","to","be","associated","with","log","entry",".","Must","be","Unix","time",".","If","``","None","``","is","passed",",","`","time.time","(",")","<","https",":","\/\/docs.python.org\/3.6\/library\/time.html","#","time.time",">","`","_","(","Python","3.6","example",")","is","invoked","to","obtain","timestamp",".","Example",":","Assuming","that","`","experiment","`","is","an","instance","of",":","class",":","`","~neptune.experiments.Experiment","`","and","'accuracy","'","log","does","not","exists",":","..","code",":",":","python3","#","Both","calls","below","have","the","same","effect","#","Common","invocation",",","providing","log","name","and","value","experiment.log_metric","(","'accuracy","'",",","0.5",")","experiment.log_metric","(","'accuracy","'",",","0.65",")","experiment.log_metric","(","'accuracy","'",",","0.8",")","#","Providing","both","x","and","y","params","experiment.log_metric","(","'accuracy","'",",","0",",","0.5",")","experiment.log_metric","(","'accuracy","'",",","1",",","0.65",")","experiment.log_metric","(","'accuracy","'",",","2",",","0.8",")","#","Common","invocation",",","logging","loss","tensor","in","PyTorch","loss","=","torch.Tensor","(","[","0.89","]",")","experiment.log_metric","(","'log-loss","'",",","loss",")","#","Common","invocation",",","logging","metric","tensor","in","Tensorflow","acc","=","tf.constant","(","[","0.93","]",")","experiment.log_metric","(","'accuracy","'",",","acc",")","f1_score","=","tf.constant","(","0.78",")","experiment.log_metric","(","'f1_score","'",",","f1_score",")","Note",":","For","efficiency",",","logs","are","uploaded","in","batches","via","a","queue",".","Hence",",","if","you","log","a","lot","of","data",",","you","may","experience","slight","delays","in","Neptune","web","application",".","Note",":","Passing","either","``","x","``","or","``","y","``","coordinate","as","NaN","or","+\/-inf","causes","this","log","entry","to","be","ignored",".","Warning","is","printed","to","``","stdout","``","."]
code: def log_metric(self, log_name, x, y=None, timestamp=None):
      """Log metrics (numeric values) in Neptune
  
      | If a log with provided ``log_name`` does not exist, it is created automatically.
      | If log exists (determined by ``log_name``), then new value is appended to it.
  
      Args:
          log_name (:obj:`str`): The name of log, i.e. `mse`, `loss`, `accuracy`.
          x (:obj:`double`): Depending, whether ``y`` parameter is passed:
  
              * ``y`` not passed: The value of the log (data-point).
              * ``y`` passed: Index of log entry being appended. Must be strictly increasing.
  
          y (:obj:`double`, optional, default is ``None``): The value of the log (data-point).
          timestamp (:obj:`time`, optional, default is ``None``):
              Timestamp to be associated with log entry. Must be Unix time.
              If ``None`` is passed, `time.time() <https://docs.python.org/3.6/library/time.html#time.time>`_
              (Python 3.6 example) is invoked to obtain timestamp.
  
      Example:
          Assuming that `experiment` is an instance of :class:`~neptune.experiments.Experiment` and
          'accuracy' log does not exists:
  
          .. code:: python3
  
              # Both calls below have the same effect
  
              # Common invocation, providing log name and value
              experiment.log_metric('accuracy', 0.5)
              experiment.log_metric('accuracy', 0.65)
              experiment.log_metric('accuracy', 0.8)
  
              # Providing both x and y params
              experiment.log_metric('accuracy', 0, 0.5)
              experiment.log_metric('accuracy', 1, 0.65)
              experiment.log_metric('accuracy', 2, 0.8)
  
              # Common invocation, logging loss tensor in PyTorch
              loss = torch.Tensor([0.89])
              experiment.log_metric('log-loss', loss)
  
              # Common invocation, logging metric tensor in Tensorflow
              acc = tf.constant([0.93])
              experiment.log_metric('accuracy', acc)
              f1_score = tf.constant(0.78)
              experiment.log_metric('f1_score', f1_score)
  
      Note:
          For efficiency, logs are uploaded in batches via a queue.
          Hence, if you log a lot of data, you may experience slight delays in Neptune web application.
      Note:
          Passing either ``x`` or ``y`` coordinate as NaN or +/-inf causes this log entry to be ignored.
          Warning is printed to ``stdout``.
      """
      x, y = self._get_valid_x_y(x, y)
  
      if not is_float(y):
          raise InvalidChannelValue(
              expected_type="float", actual_type=type(y).__name__
          )
  
      if is_nan_or_inf(y):
          _logger.warning(
              "Invalid metric value: %s for channel %s. "
              "Metrics with nan or +/-inf values will not be sent to server",
              y,
              log_name,
          )
      elif x is not None and is_nan_or_inf(x):
          _logger.warning(
              "Invalid metric x-coordinate: %s for channel %s. "
              "Metrics with nan or +/-inf x-coordinates will not be sent to server",
              x,
              log_name,
          )
      else:
          value = ChannelValue(x, dict(numeric_value=y), timestamp)
          self._channels_values_sender.send(
              log_name, ChannelType.NUMERIC.value, value
          )
  
imports: import base64
  import logging
  import traceback
  import pandas
  import six
  from pandas.errors import EmptyDataError
  from neptune.common.experiments import LegacyExperiment
  from neptune.common.utils import align_channels_on_x, is_float, is_nan_or_inf
  from neptune.legacy.api_exceptions import ChannelDoesNotExist, ExperimentAlreadyFinished
  from neptune.legacy.exceptions import InvalidChannelValue, NeptuneIncorrectImportException, NoChannelValue
  from neptune.legacy.internal.channels.channels import ChannelNamespace, ChannelType, ChannelValue
  from neptune.legacy.internal.channels.channels_values_sender import ChannelsValuesSender
  from neptune.legacy.internal.execution.execution_context import ExecutionContext
  from neptune.legacy.internal.utils.deprecation import legacy_client_deprecation
  from neptune.legacy.internal.utils.image import get_image_content
label_desc: Use image node_id 20 for calling the Experiment obj's underlying member method code with example usage: obj.log_metric(log_name, x, y, timestamp) without return types