code: def test_mean_with_public_partitions_returns_sensible_result(self):
      with TestPipeline() as pipeline:
          # Arrange
          col = [(f"{u}", "pubK1", -100.0) for u in range(30)]
          col += [(f"{u + 30}", "pubK1", 100.0) for u in range(10)]
          col += [(f"{u + 40}", "privK1", 100.0) for u in range(30)]
          pcol = pipeline | "Create produce" >> beam.Create(col)
          # Use very high epsilon and delta to minimize noise and test
          # flakiness.
          budget_accountant = budget_accounting.NaiveBudgetAccountant(
              total_epsilon=800, total_delta=0.999, num_aggregations=1
          )
          private_collection = (
              pcol
              | "Create private collection"
              >> private_beam.MakePrivate(
                  budget_accountant=budget_accountant,
                  privacy_id_extractor=lambda x: x[0],
              )
          )
  
          mean_params = aggregate_params.MeanParams(
              noise_kind=pipeline_dp.NoiseKind.GAUSSIAN,
              max_partitions_contributed=1,
              max_contributions_per_partition=1,
              min_value=1.55,  # -100 should be clipped to this value
              max_value=2.7889,  # 100 should be clipped to this value
              budget_weight=1,
              partition_extractor=lambda x: x[1],
              value_extractor=lambda x: x[2],
          )
  
          # Act
          result = private_collection | private_beam.Mean(
              mean_params=mean_params,
              public_partitions=["pubK1", "pubK2"],
          )
          budget_accountant.compute_budgets()
  
          # Assert
          # This is a health check to validate that the result is sensible.
          # Hence, we use a very large tolerance to reduce test flakiness.
          beam_util.assert_that(
              result,
              # pubK2 has no data points therefore the dataset is assumed to be {min_value, max_value}
              beam_util.equal_to(
                  [("pubK1", 1.859), ("pubK2", 2.1695)],
                  equals_fn=lambda e, a: PrivateBeamTest.value_per_key_within_tolerance(
                      e, a, 0.1
                  ),
              ),
          )
  
imports: import unittest
  import apache_beam
  from apache_beam.runners.portability import fn_api_runner
  from apache_beam import pvalue
  from unittest.mock import patch
  import apache_beam.testing.util
  from apache_beam.testing.test_pipeline import TestPipeline
  import pipeline_dp
  from pipeline_dp import private_beam
  from pipeline_dp import aggregate_params, budget_accounting
label_desc: Use image node_id 13 for calling the PrivateBeamTest obj's underlying member method code with example usage: obj.test_mean_with_public_partitions_returns_sensible_result() without return types