class_docstr: Base class for budget accountants.
class_docstr_tok: ["Base","class","for","budget","accountants","."]
code: def _check_aggregation_restrictions(self):
      if self._expected_num_aggregations:
          actual_num_aggregations = len(
              self._actual_aggregation_weights
          )
          if actual_num_aggregations != self._expected_num_aggregations:
              raise ValueError(
                  f"'num_aggregations'({self._expected_num_aggregations}) in "
                  f"the constructor of BudgetAccountant is different from the"
                  f" actual number of aggregations in the pipeline"
                  f"({actual_num_aggregations}). If 'n_aggregations' is "
                  f"specified, you must have that many aggregations in the "
                  f"pipeline."
              )
          weights = self._actual_aggregation_weights
          if not all([w == 1 for w in weights]):
              raise ValueError(
                  f"Aggregation weights = {weights}. If 'num_aggregations' is"
                  f" set in the constructor of BudgetAccountant, all "
                  f"aggregation weights have to be 1. If you'd like to have "
                  f"different weights use 'aggregation_weights'."
              )
      if self._expected_aggregation_weights:
          actual_weights = self._actual_aggregation_weights
          expected_weights = self._expected_aggregation_weights
          if len(actual_weights) != len(expected_weights):
              raise ValueError(
                  f"Length of 'aggregation_weights' in the constructor of "
                  f"BudgetAccountant is {len(expected_weights)} != "
                  f"{len(actual_weights)} the actual number of aggregations."
              )
          if not all(
              [
                  w1 == w2
                  for w1, w2 in zip(actual_weights, expected_weights)
              ]
          ):
              raise ValueError(
                  f"'aggregation_weights' in the constructor of is "
                  f"({expected_weights}) is different from actual aggregation"
                  f" weights ({actual_weights}).If 'aggregation_weights' is "
                  f"specified, they must be the same."
              )
  
imports: import abc
  import collections
  import logging
  import math
  from typing import Optional
  from dataclasses import dataclass
  import pipeline_dp.aggregate_params
  from pipeline_dp import input_validators
label_desc: Use image node_id 6 for calling the BudgetAccountant obj's underlying member method code with example usage: obj._check_aggregation_restrictions() without return types