code: def test_run_e2e_post_aggregation_thresholding(self):
      # High budget for low noise.
      engine, budget_accountant = self._create_dp_engine_default(
          return_accountant=True, epsilon=10, delta=1e-10
      )
      params = pipeline_dp.AggregateParams(
          noise_kind=pipeline_dp.NoiseKind.LAPLACE,
          metrics=[agg.Metrics.PRIVACY_ID_COUNT],
          max_partitions_contributed=1,
          max_contributions_per_partition=1,
          post_aggregation_thresholding=True,
      )
  
      # Generate input = [(partition_key, privacy_id)]
      input = []
      # 1000 partitions with 3 contributions, threshold ~= 3.2, some of them
      # should be kept.
      for i in range(1000):
          for k in range(3):
              input.append((i, 100 * i + k))
  
      data_extractors = pipeline_dp.DataExtractors(
          privacy_id_extractor=lambda x: x[1],
          partition_extractor=lambda x: x[0],
          value_extractor=lambda x: 0,
      )
  
      output = engine.aggregate(input, params, data_extractors)
      budget_accountant.compute_budgets()
      output = list(output)
      self.assertTrue(len(output) > 10)
      for partition, metrics in output:
          # Check that privacy_id_count > threshold.
          self.assertGreater(metrics.privacy_id_count, 3.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 37 for calling the DpEngineTest obj's underlying member method code with example usage: obj.test_run_e2e_post_aggregation_thresholding() without return types