code: def generate_quantiles_histogram(
      quantiles: np.ndarray, cumulative_counts: np.ndarray
  ) -> statistics_pb2.Histogram:
      """Generate quantiles histogram from the quantile boundaries.
  
      Args:
        quantiles: A numpy array containing the quantile boundaries.
        cumulative_counts: A numpy array of the same length as quantiles containing
          the cumulative quantile counts (sum of weights).
  
      Returns:
        A statistics_pb2.Histogram proto.
      """
      result = statistics_pb2.Histogram()
      result.type = statistics_pb2.Histogram.QUANTILES
      low_bounds, high_bounds, bin_weights = _get_bin_weights(
          quantiles, cumulative_counts
      )
      for i in range(low_bounds.size):
          result.buckets.add(
              low_value=low_bounds[i],
              high_value=high_bounds[i],
              sample_count=bin_weights[i],
          )
      return result
  
file_path: data-validation/tensorflow_data_validation/utils/quantiles_util.py
imports: from typing import Tuple
  import numpy
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 4 for calling a global function with example usage: generate_quantiles_histogram(quantiles, cumulative_counts) and returns: result