code: def _list_to_contribution_histograms(
      histograms: List[hist.Histogram],
  ) -> hist.DatasetHistograms:
      """Packs histograms from a list to ContributionHistograms."""
      l0_contributions = l1_contributions = None
      linf_contributions = linf_sum_contributions = None
      count_per_partition = privacy_id_per_partition_count = None
      sum_per_partition_histogram = None
      for histogram in histograms:
          if histogram.name == hist.HistogramType.L0_CONTRIBUTIONS:
              l0_contributions = histogram
          if histogram.name == hist.HistogramType.L1_CONTRIBUTIONS:
              l1_contributions = histogram
          elif histogram.name == hist.HistogramType.LINF_CONTRIBUTIONS:
              linf_contributions = histogram
          elif (
              histogram.name
              == hist.HistogramType.LINF_SUM_CONTRIBUTIONS
          ):
              linf_sum_contributions = histogram
          elif histogram.name == hist.HistogramType.COUNT_PER_PARTITION:
              count_per_partition = histogram
          elif (
              histogram.name
              == hist.HistogramType.COUNT_PRIVACY_ID_PER_PARTITION
          ):
              privacy_id_per_partition_count = histogram
          elif histogram.name == hist.HistogramType.SUM_PER_PARTITION:
              sum_per_partition_histogram = histogram
  
      return hist.DatasetHistograms(
          l0_contributions,
          l1_contributions,
          linf_contributions,
          linf_sum_contributions,
          count_per_partition,
          privacy_id_per_partition_count,
          sum_per_partition_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 8 for calling a global function with example usage: _list_to_contribution_histograms(histograms) and returns: hist