code: def test_generate_quantiles_histogram_low_bucket_partial_duplicate(
      self,
  ):
      # This test documents an edge case. If we generate 2 quantiles of the input
      # [1, 2] we get bin boundaries [1, 2, 2].
      # Because bins include their upper bound *and* the first bin includes its
      # lower bound, the first bin includes 1, 2 while the second includes 2.
      # So we split the count for 2 across the overlapping bins.
      result = quantiles_util.generate_quantiles_histogram(
          quantiles=np.array([1, 2, 2], dtype=np.float32),
          cumulative_counts=np.array([1, 2, 2]),
      )
      expected_result = text_format.Parse(
          """
          buckets {
            low_value: 1.0
            high_value: 2.0
            sample_count: 1.5
          }
          buckets {
            low_value: 2.0
            high_value: 2.0
            sample_count: 0.5
          }
          type: QUANTILES
          """,
          statistics_pb2.Histogram(),
      )
      _assert_buckets_almost_equal(
          self, result.buckets, expected_result.buckets
      )
  
imports: from typing import List
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from tensorflow_data_validation.utils import quantiles_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 3 for calling the QuantilesUtilTest obj's underlying member method code with example usage: obj.test_generate_quantiles_histogram_low_bucket_partial_duplicate() without return types