code: def _check_histograms_result(
      self, plugin, tag_name, run_name, downsample
  ):
      if downsample:
          downsample_to = 50
          expected_length = 50
      else:
          downsample_to = None
          expected_length = self._STEPS
  
      (data, mime_type) = plugin.histograms_impl(
          context.RequestContext(),
          tag_name,
          run_name,
          experiment="exp",
          downsample_to=downsample_to,
      )
      self.assertEqual("application/json", mime_type)
      self.assertEqual(
          expected_length,
          len(data),
          "expected %r, got %r (downsample=%r)"
          % (expected_length, len(data), downsample),
      )
      last_step_seen = None
      for i, datum in enumerate(data):
          [_unused_wall_time, step, buckets] = datum
          if last_step_seen is not None:
              self.assertGreater(step, last_step_seen)
          last_step_seen = step
          if not downsample:
              self.assertEqual(i, step)
          self.assertEqual(1 + step, buckets[0][0])  # first left-edge
          self.assertEqual(3 + step, buckets[-1][1])  # last right-edge
          self.assertAlmostEqual(
              3,  # three items across all buckets
              sum(bucket[2] for bucket in buckets),
          )
  
imports: import collections.abc
  import os.path
  import tensorflow
  from tensorboard import errors
  from tensorboard import context
  from tensorboard.backend.event_processing import data_provider
  from tensorboard.backend.event_processing import plugin_event_multiplexer
  from tensorboard.backend.event_processing import tag_types
  from tensorboard.plugins import base_plugin
  from tensorboard.plugins.histogram import histograms_plugin
  from tensorboard.plugins.histogram import summary
  from tensorboard.util import test_util
label_desc: Use image node_id 8 for calling the HistogramsPluginTest obj's underlying member method code with example usage: obj._check_histograms_result(plugin, tag_name, run_name, downsample) without return types