class_docstr: Metrics Plugin for TensorBoard.
docstr: Instantiates MetricsPlugin.
  
  Args:
      context: A base_plugin.TBContext instance. MetricsLoader checks that
          it contains a valid `data_provider`.
docstr_tok: ["Instantiates","MetricsPlugin",".","Args",":","context",":","A","base_plugin.TBContext","instance",".","MetricsLoader","checks","that","it","contains","a","valid","`","data_provider","`","."]
code: def __init__(self, context):
      """Instantiates MetricsPlugin.
  
      Args:
          context: A base_plugin.TBContext instance. MetricsLoader checks that
              it contains a valid `data_provider`.
      """
      self._data_provider = context.data_provider
  
      # For histograms, use a round number + 1 since sampling includes both start
      # and end steps, so N+1 samples corresponds to dividing the step sequence
      # into N intervals.
      sampling_hints = context.sampling_hints or {}
      self._plugin_downsampling = {
          "scalars": sampling_hints.get(
              scalar_metadata.PLUGIN_NAME, 1000
          ),
          "histograms": sampling_hints.get(
              histogram_metadata.PLUGIN_NAME, 51
          ),
          "images": sampling_hints.get(image_metadata.PLUGIN_NAME, 10),
      }
      self._scalar_version_checker = (
          plugin_util._MetadataVersionChecker(
              data_kind="scalar time series",
              latest_known_version=0,
          )
      )
      self._histogram_version_checker = (
          plugin_util._MetadataVersionChecker(
              data_kind="histogram time series",
              latest_known_version=0,
          )
      )
      self._image_version_checker = plugin_util._MetadataVersionChecker(
          data_kind="image time series",
          latest_known_version=0,
      )
  
imports: import collections
  import imghdr
  import json
  from werkzeug import wrappers
  from tensorboard import errors
  from tensorboard import plugin_util
  from tensorboard.backend import http_util
  from tensorboard.data import provider
  from tensorboard.plugins import base_plugin
  from tensorboard.plugins.histogram import metadata
  from tensorboard.plugins.image import metadata
  from tensorboard.plugins.metrics import metadata
  from tensorboard.plugins.scalar import metadata
label_desc: Use image node_id 1 to create a new MetricsPlugin object from inherited base classes: base_plugin with example: obj = MetricsPlugin(context)