class_docstr: A Raw Metric Data Object
class_docstr_tok: ["A","Raw","Metric","Data","Object"]
docstr: Construct a `_RawMetricData` instance.
  
  Args:
      metric_name (str): The name of the metric.
      value (float): The value of the metric.
      timestamp (datetime.datetime or float or str): Timestamp of the metric.
          If not specified, the current UTC time will be used.
      step (int):  Iteration number of the metric (default: None).
docstr_tok: ["Construct","a","`","_RawMetricData","`","instance",".","Args",":","metric_name","(","str",")",":","The","name","of","the","metric",".","value","(","float",")",":","The","value","of","the","metric",".","timestamp","(","datetime.datetime","or","float","or","str",")",":","Timestamp","of","the","metric",".","If","not","specified",",","the","current","UTC","time","will","be","used",".","step","(","int",")",":","Iteration","number","of","the","metric","(","default",":","None",")","."]
code: def __init__(self, metric_name, value, timestamp=None, step=None):
      """Construct a `_RawMetricData` instance.
  
      Args:
          metric_name (str): The name of the metric.
          value (float): The value of the metric.
          timestamp (datetime.datetime or float or str): Timestamp of the metric.
              If not specified, the current UTC time will be used.
          step (int):  Iteration number of the metric (default: None).
      """
      if timestamp is None:
          timestamp = time.time()
      elif isinstance(timestamp, datetime.datetime):
          # If the input is a datetime then convert it to UTC time.
          # Assume a naive datetime is in local timezone
          if not timestamp.tzinfo:
              timestamp = timestamp.replace(
                  tzinfo=dateutil.tz.tzlocal()
              )
          timestamp = (timestamp - timestamp.utcoffset()).replace(
              tzinfo=datetime.timezone.utc
          )
          timestamp = timestamp.timestamp()
      else:
          timestamp = float(timestamp)
  
      if timestamp < (
          time.time() - METRIC_TS_LOWER_BOUND_TO_NOW
      ) or timestamp > (time.time() + METRIC_TS_UPPER_BOUND_FROM_NOW):
          raise ValueError(
              "Supplied timestamp %f is invalid."
              " Timestamps must be between two weeks before and two hours from now."
              % timestamp
          )
      value = float(value)
  
      self.MetricName = metric_name
      self.Value = float(value)
      self.Timestamp = timestamp
      if step is not None:
          if not isinstance(step, int):
              raise ValueError("step must be int.")
          self.Step = step
  
imports: from __future__ import absolute_import
  import datetime
  import logging
  import os
  import time
  import threading
  import queue
  import dateutil.tz
  from sagemaker.session import Session
label_desc: Use image node_id 1 to create a new _RawMetricData object from inherited base classes: object with example: obj = _RawMetricData(metric_name, value, timestamp, step)