code: def _convert_frequency_bins_into_histogram(
      col, backend: pipeline_backend.PipelineBackend, name
  ):
      """Converts (lower_bin_value, hist.FrequencyBin) into histogram.
  
      The input collection is not expected to have frequency bins reduced per
      lower values.
      """
      col = backend.reduce_per_key(
          col, operator.add, "Combine FrequencyBins"
      )
      # (lower_bin_value, hist.FrequencyBin)
      col = backend.values(col, "Drop keys")
      # (hist.FrequencyBin)
      col = backend.to_list(col, "To 1 element collection")
  
      # 1 element collection: [hist.FrequencyBin]
  
      def bins_to_histogram(bins):
          sorted_bins = sorted(bins, key=lambda bin: bin.lower)
          return hist.Histogram(name, sorted_bins)
  
      return backend.map(col, bins_to_histogram, "To histogram")
  
imports: import bisect
  import operator
  from typing import List, Tuple
  import numpy
  import pipeline_dp
  from pipeline_dp import pipeline_backend, pipeline_functions
  from pipeline_dp.dataset_histograms import histograms
label_desc: Use image node_id 7 for calling a global function with example usage: _convert_frequency_bins_into_histogram(col, backend, name) and returns: backend, hist