code: def _group_utility_reports(
      configuration_index: int, reports: List[metrics.UtilityReport]
  ) -> metrics.UtilityReport:
      """Groups utility reports for one configuration.
  
      'reports' contains the global report, i.e. which corresponds to all
      partitions and reports that corresponds to partitions of some size range.
      This function creates UtilityReport histogram from reports by size range and
      sets it to the global report.
      """
      global_report = None
      histogram_reports = []
      for lower_bucket_bound, report in reports:
          #  Apache Beam does not allow input data to be changed during a map
          #  stage. So 'report' has to be copied.
          report = copy.deepcopy(report)
          report.configuration_index = configuration_index
          if lower_bucket_bound is None:
              # only the report which corresponds to all partitions does not have
              # the bucket.
              global_report = report
          else:
              histogram_reports.append((lower_bucket_bound, report))
      if global_report is None:
          # it should not happen, but it better to process gracefully in case
          # if it happens and return None.
          return None
  
      if not histogram_reports:
          # It happens in SelectPartitions case.
          # TODO(dvadym): cover SelectPartitions case as well.
          return global_report
      histogram_reports.sort()  # sort by lower_bucket_bound
      utility_report_histogram = [
          metrics.UtilityReportBin(
              lower_bound, _get_upper_bound(lower_bound), report
          )
          for lower_bound, report in histogram_reports
      ]
      global_report.utility_report_histogram = utility_report_histogram
      return global_report
  
file_path: pipelinedp/analysis/utility_analysis.py
imports: from typing import Any, Iterable, List, Tuple, Union
  import pipeline_dp
  from pipeline_dp import pipeline_backend
  import analysis
  from analysis import data_structures
  from analysis import metrics
  from analysis import utility_analysis_engine
  from analysis import cross_partition_combiners
  import copy
  import bisect
label_desc: Use image node_id 7 for calling a global function with example usage: _group_utility_reports(configuration_index, reports) and returns: global_report, None, global_report