code: def _get_metric_histogram(histogram_proto):
      """Convert a histogram proto into a dict.
  
      Args:
        histogram_proto: a proto containing a Sampler metric's result histogram.
  
      Returns:
        A dict containing summary statistics and the raw histogram values.
      """
      ret = dict()
      ret["min"] = histogram_proto.min
      ret["max"] = histogram_proto.max
      ret["num"] = histogram_proto.num
      ret["sum"] = histogram_proto.sum
  
      bucket_limits = histogram_proto.bucket_limit
      bucket_vals = histogram_proto.bucket
      ret["histogram"] = {}
      # Add lower limit as 0, since all these metrics are durations
      bucket_limits.insert(0, 0)
      for lb, ub, val in zip(
          bucket_limits[:-1], bucket_limits[1:], bucket_vals
      ):
          ret["histogram"][(lb, ub)] = val
      return ret
  
file_path: tensorflow-upstream/tensorflow/python/distribute/coordinator/metric_utils.py
imports: import time
  from tensorflow.python.eager import monitoring
  from tensorflow.python.util import tf_contextlib
label_desc: Use image node_id 5 for calling a global function with example usage: _get_metric_histogram(histogram_proto) and returns: ret