code: def test_calculate_private_contribution_works_on_beam(self):
      with test_pipeline.TestPipeline() as p:
          # Arrange
          engine = pipeline_dp.DPEngine(
              budget_accountant=None, backend=pipeline_dp.BeamBackend()
          )
          params = pipeline_dp.CalculatePrivateContributionBoundsParams(
              aggregation_eps=0.9,
              aggregation_delta=0.001,
              calculation_eps=0.1,
              aggregation_noise_kind=pipeline_dp.NoiseKind.LAPLACE,
              max_partitions_contributed_upper_bound=2,
          )
          # user 0 contributes only 1 partitions, others contribute to both
          data = [("pk0", 0)]
          for i in range(10000):
              data += [("pk0", i + 1), ("pk1", i + 1)]
          col = p | "Create input" >> beam.Create(data)
          data_extractors = pipeline_dp.DataExtractors(
              partition_extractor=lambda x: x[0],
              privacy_id_extractor=lambda x: x[1],
              value_extractor=lambda _: 1,
          )
          partitions = ["pk0", "pk1"]
  
          # Act
          result = engine.calculate_private_contribution_bounds(
              col, params, data_extractors, partitions
          )
  
          beam_util.assert_that(
              result,
              beam_util.equal_to(
                  [
                      pipeline_dp.PrivateContributionBounds(
                          max_partitions_contributed=2
                      )
                  ]
              ),
          )
  
imports: import sys
  import unittest
  from typing import List, Optional, Tuple
  from unittest.mock import patch
  import numpy
  import apache_beam
  import apache_beam.testing.test_pipeline
  import apache_beam.testing.util
  import pydp.algorithms.partition_selection
  from absl.testing import absltest
  from absl.testing import parameterized
  import pipeline_dp
  from pipeline_dp import aggregate_params
  from pipeline_dp import budget_accounting
  from pipeline_dp import dp_computations
  from pipeline_dp.budget_accounting import NaiveBudgetAccountant
  from pipeline_dp.pipeline_backend import PipelineBackend
  from pipeline_dp.pipeline_functions import collect_to_container
  from pipeline_dp.report_generator import ReportGenerator
label_desc: Use image node_id 8 for calling the DpEngineTest obj's underlying member method code with example usage: obj.test_calculate_private_contribution_works_on_beam() without return types