code: def testHistogram(self):
      histo = statistics.Histogram("name_123", [1, 2, 10])
      self.assertEqual(
          histo.counters, {float("-inf"): 0, 1: 0, 2: 0, 10: 0}
      )
      histo.increment(1)
      self.assertEqual(
          histo.counters, {float("-inf"): 0, 1: 1, 2: 0, 10: 0}
      )
      histo.increment(3, 3)
      self.assertEqual(
          histo.counters, {float("-inf"): 0, 1: 1, 2: 3, 10: 0}
      )
      histo.increment(20)
      histo.increment(100)
      self.assertEqual(
          histo.counters, {float("-inf"): 0, 1: 1, 2: 3, 10: 2}
      )
      histo.increment(0)
      histo.increment(-10)
      self.assertEqual(
          histo.counters, {float("-inf"): 2, 1: 1, 2: 3, 10: 2}
      )
  
      histo_2 = statistics.Histogram("name_123", [1, 2, 10])
      histo_2.increment(0, 4)
      histo_2.increment(2, 10)
      histo_2.increment(10, 1)
      histo.merge_from(histo_2)
      self.assertEqual(
          histo.counters, {float("-inf"): 6, 1: 1, 2: 13, 10: 3}
      )
  
      histo_3 = statistics.Histogram("name_123", [1, 2, 7])
      with self.assertRaisesRegex(
          statistics.MergeStatisticsError,
          r"Histogram buckets do not match. "
          r"Expected \[-inf, 1, 2, 10\], got \[-inf, 1, 2, 7\]",
      ):
          histo.merge_from(histo_3)
  
      class ABC(object):
          pass
  
      with self.assertRaises(statistics.MergeStatisticsError):
          histo.merge_from(ABC())
  
      self.assertEqual(
          str(histo),
          "name_123:\n  [-inf,1): 6\n  [1,2): 1\n  [2,10): 13\n  [10,inf): 3",
      )
  
      histo_copy = histo.copy()
      self.assertEqual(
          histo_copy.counters, {float("-inf"): 6, 1: 1, 2: 13, 10: 3}
      )
      self.assertEqual(histo_copy.name, "name_123")
  
imports: from absl.testing import absltest
  from magenta.pipelines import statistics
label_desc: Use image node_id 2 for calling the StatisticsTest obj's underlying member method code with example usage: obj.testHistogram() without return types