class_docstr: Specifies parameters for function DPEngine.aggregate()
  
  Attributes:
      metrics: A list of metrics to compute.
      noise_kind: The type of noise to use for the DP calculations.
      max_partitions_contributed: A bound on the number of partitions to
        which one unit of privacy (e.g., a user) can contribute.
      max_contributions_per_partition: A bound on the number of times one
        unit of privacy (e.g. a user) can contribute to a partition.
      max_contributions: A bound on the total number of times one unit of
        privacy (e.g., a user) can contribute.
      budget_weight: Relative weight of the privacy budget allocated to this
        aggregation.
      min_value: Lower bound on each value.
      max_value: Upper bound on each value.
      min_sum_per_partition: Lower bound on sum per partition. Used only for
      SUM metric calculations. It can not be set when min_value/max_value is
       set.
      max_sum_per_partition: Upper bound on sum per partition. Used only for
      SUM metric calculations. It can not be set when min_value/max_value is
       set.
      custom_combiners: Warning: experimental@ Combiners for computing custom
        metrics.
      vector_norm_kind: The type of norm. Used only for VECTOR_SUM metric
      calculations.
      vector_max_norm: Bound on each value of a vector. Used only for
       VECTOR_SUM metric calculations.
      vector_size: Number of coordinates in a vector. Used only for VECTOR_SUM
       metric calculations.
      contribution_bounds_already_enforced: assume that the input dataset
       complies with the bounds provided in max_partitions_contributed and
       max_contributions_per_partition. This option can be used if the dataset
       does not contain any identifiers that can be used to enforce
       contribution bounds automatically.
      public_partitions_already_filtered: if true, it is assumed that records
       with partition_key which are not in public_partitions are already
       removed from the dataset. It can only be used with public partitions.
      partition_selection_strategy: which strategy to use for private
       partition selection. It is ignored when public partitions are used.
      pre_threshold: the minimum amount of privacy units which are required
       for keeping a partition in private partition selection. Note that this
       is in addition to a differentially private partition selection, so a
       partition with pre_threshold privacy units isn't necessarily kept. It
       is ignored when public partitions are used.
       More details on pre-thresholding are in
       https://github.com/google/differential-privacy/blob/main/common_docs/pre_thresholding.md
code: def __post_init__(self):
      self._check_both_property_set_or_not("min_value", "max_value")
      self._check_both_property_set_or_not(
          "min_sum_per_partition", "max_sum_per_partition"
      )
  
      value_bound = self.min_value is not None
      partition_bound = self.min_sum_per_partition is not None
  
      if value_bound and partition_bound:
          raise ValueError(
              "min_value and min_sum_per_partition can not be both set."
          )
  
      if value_bound:
          self._check_range_correctness("min_value", "max_value")
  
      if partition_bound:
          self._check_range_correctness(
              "min_sum_per_partition", "max_sum_per_partition"
          )
  
      if self.metrics:
          if Metrics.VECTOR_SUM in self.metrics:
              if (
                  Metrics.SUM in self.metrics
                  or Metrics.MEAN in self.metrics
                  or Metrics.VARIANCE in self.metrics
              ):
                  raise ValueError(
                      "AggregateParams: vector sum can not be computed "
                      "together with scalar metrics such as sum, mean etc"
                  )
          elif partition_bound:
              all_allowed_metrics = set(
                  [Metrics.SUM, Metrics.PRIVACY_ID_COUNT, Metrics.COUNT]
              )
              not_allowed_metrics = set(self.metrics).difference(
                  all_allowed_metrics
              )
              if not_allowed_metrics:
                  raise ValueError(
                      f"AggregateParams: min_sum_per_partition is not "
                      f"compatible with metrics {not_allowed_metrics}. Please"
                      f"use min_value/max_value."
                  )
          elif not partition_bound and not value_bound:
              all_allowed_metrics = set(
                  [Metrics.PRIVACY_ID_COUNT, Metrics.COUNT]
              )
              not_allowed_metrics = set(self.metrics).difference(
                  all_allowed_metrics
              )
              if not_allowed_metrics:
                  raise ValueError(
                      f"AggregateParams: for metrics {not_allowed_metrics} "
                      f"bounds per partition are required (e.g. min_value,"
                      f"max_value)."
                  )
  
          if (
              self.contribution_bounds_already_enforced
              and Metrics.PRIVACY_ID_COUNT in self.metrics
          ):
              raise ValueError(
                  "AggregateParams: Cannot calculate PRIVACY_ID_COUNT when "
                  "contribution_bounds_already_enforced is set to True."
              )
      if self.custom_combiners:
          logging.warning(
              "Warning: custom combiners are used. This is an "
              "experimental feature. It might not work properly "
              "and it might be changed or removed without any "
              "notifications."
          )
      if self.metrics and self.custom_combiners:
          # TODO(dvadym): after implementation of custom combiners to verify
          # whether this check is required?
          raise ValueError(
              "Custom combiners can not be used with standard metrics"
          )
      if self.max_contributions is not None:
          _check_is_positive_int(
              self.max_contributions, "max_contributions"
          )
          if (self.max_partitions_contributed is not None) or (
              self.max_contributions_per_partition is not None
          ):
              raise ValueError(
                  "AggregateParams: only one in max_contributions or "
                  "both max_partitions_contributed and "
                  "max_contributions_per_partition must be set"
              )
      else:  # self.max_contributions is None
          n_not_none = _count_not_none(
              self.max_partitions_contributed,
              self.max_contributions_per_partition,
          )
          if n_not_none == 0:
              raise ValueError(
                  "AggregateParams: either max_contributions must be set or "
                  "both max_partitions_contributed and "
                  "max_contributions_per_partition must be set."
              )
          elif n_not_none == 1:
              raise ValueError(
                  "AggregateParams: either none or both "
                  "max_partitions_contributed and "
                  "max_contributions_per_partition must be set."
              )
          _check_is_positive_int(
              self.max_partitions_contributed,
              "max_partitions_contributed",
          )
          _check_is_positive_int(
              self.max_contributions_per_partition,
              "max_contributions_per_partition",
          )
      if self.pre_threshold is not None:
          _check_is_positive_int(self.pre_threshold, "pre_threshold")
  
imports: import logging
  import math
  from dataclasses import dataclass
  from enum import Enum
  from typing import Any, Sequence, Callable, Optional, List
  import numpy
  from pipeline_dp import input_validators
label_desc: Use image node_id 4 for calling the AggregateParams obj's underlying member method code with example usage: obj.__post_init__() without return types