code: def test_per_partition_to_cross_partition_utility(
      self,
      public_partitions: bool,
      mock_sum_metrics_to_metric_utility,
      mock_create_for_private_partitions,
      mock_create_for_public_partitions,
  ):
      per_partition_utility = metrics.PerPartitionMetrics(
          partition_selection_probability_to_keep=0.2,
          raw_statistics=metrics.RawStatistics(
              privacy_id_count=10, count=15
          ),
          metric_errors=[
              _get_default_sum_metrics(
                  metric=pipeline_dp.Metrics.PRIVACY_ID_COUNT
              ),
              _get_default_sum_metrics(
                  metric=pipeline_dp.Metrics.COUNT
              ),
              _get_default_sum_metrics(metric=pipeline_dp.Metrics.SUM),
          ],
      )
      dp_metrics = [
          pipeline_dp.Metrics.PRIVACY_ID_COUNT,
          pipeline_dp.Metrics.COUNT,
          pipeline_dp.Metrics.SUM,
      ]
      cross_partition_combiners._per_partition_to_utility_report(
          per_partition_utility,
          dp_metrics,
          public_partitions,
          partition_weight=0.2,
      )
      if public_partitions:
          mock_create_for_public_partitions.assert_called_once_with(
              False
          )
          mock_create_for_private_partitions.assert_not_called()
      else:
          mock_create_for_public_partitions.assert_not_called()
          mock_create_for_private_partitions.assert_called_once_with(
              0.2
          )
  
      self.assertEqual(mock_sum_metrics_to_metric_utility.call_count, 3)
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import dataclasses
  import math
  from unittest import mock
  from unittest.mock import patch
  from analysis import metrics
  from analysis import cross_partition_combiners
  import pipeline_dp
label_desc: Use image node_id 4 for calling the PerPartitionToCrossPartitionMetrics obj's underlying member method code with example usage: obj.test_per_partition_to_cross_partition_utility(public_partitions, mock_sum_metrics_to_metric_utility, mock_create_for_private_partitions, mock_create_for_public_partitions) without return types