class_docstr: Manages the privacy budget for privacy loss distributions.
  
  It manages the privacy budget for the pipeline using the
  Privacy Loss Distribution (PLD) implementation from Google's
  dp_accounting library.
  
  This class is experimental. It is not yet compatible with DPEngine.
class_docstr_tok: ["Manages","the","privacy","budget","for","privacy","loss","distributions",".","It","manages","the","privacy","budget","for","the","pipeline","using","the","Privacy","Loss","Distribution","(","PLD",")","implementation","from","Google's","dp_accounting","library",".","This","class","is","experimental",".","It","is","not","yet","compatible","with","DPEngine","."]
docstr: Computes the budget for the pipeline.
  
  Composes the mechanisms and adjusts the amount of
  noise based on given epsilon. Sets the noise for the
  entire pipeline.
docstr_tok: ["Computes","the","budget","for","the","pipeline",".","Composes","the","mechanisms","and","adjusts","the","amount","of","noise","based","on","given","epsilon",".","Sets","the","noise","for","the","entire","pipeline","."]
code: def compute_budgets(self):
      """Computes the budget for the pipeline.
  
      Composes the mechanisms and adjusts the amount of
      noise based on given epsilon. Sets the noise for the
      entire pipeline.
      """
      self._check_aggregation_restrictions()
      self._finalize()
  
      if not self._mechanisms:
          logging.warning("No budgets were requested.")
          return
  
      if self._scopes_stack:
          raise Exception(
              "Cannot call compute_budgets from within a budget scope."
          )
  
      if self._total_delta == 0:
          sum_weights = 0
          for mechanism in self._mechanisms:
              sum_weights += mechanism.weight
          minimum_noise_std = (
              sum_weights / self._total_epsilon * math.sqrt(2)
          )
      else:
          minimum_noise_std = self._find_minimum_noise_std()
  
      self.minimum_noise_std = minimum_noise_std
      for mechanism in self._mechanisms:
          mechanism_noise_std = (
              mechanism.sensitivity
              * minimum_noise_std
              / mechanism.weight
          )
          mechanism.mechanism_spec._noise_standard_deviation = (
              mechanism_noise_std
          )
          if (
              mechanism.mechanism_spec.mechanism_type
              == agg_params.MechanismType.GENERIC
          ):
              epsilon_0 = math.sqrt(2) / mechanism_noise_std
              delta_0 = (
                  epsilon_0 / self._total_epsilon * self._total_delta
              )
              mechanism.mechanism_spec.set_eps_delta(epsilon_0, delta_0)
  
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 3 for calling the PLDBudgetAccountant obj's underlying member method code with example usage: obj.compute_budgets() without return types