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: Request a budget.
  
  Constructs a mechanism spec based on the parameters.
  Adds the mechanism to the pipeline for future calculation.
  
  Args:
      mechanism_type: The type of noise distribution for the mechanism.
      sensitivity: The sensitivity for the mechanism.
      weight: The weight for the mechanism.
      count: The number of times the mechanism will be applied.
      noise_standard_deviation: The standard deviation for the mechanism.
  
  
  Returns:
      A "lazy" mechanism spec object that doesn't contain the noise
      standard deviation until compute_budgets is called.
docstr_tok: ["Request","a","budget",".","Constructs","a","mechanism","spec","based","on","the","parameters",".","Adds","the","mechanism","to","the","pipeline","for","future","calculation",".","Args",":","mechanism_type",":","The","type","of","noise","distribution","for","the","mechanism",".","sensitivity",":","The","sensitivity","for","the","mechanism",".","weight",":","The","weight","for","the","mechanism",".","count",":","The","number","of","times","the","mechanism","will","be","applied",".","noise_standard_deviation",":","The","standard","deviation","for","the","mechanism",".","Returns",":","A","``","lazy","''","mechanism","spec","object","that","does","n't","contain","the","noise","standard","deviation","until","compute_budgets","is","called","."]
code: def request_budget(
      self,
      mechanism_type: agg_params.MechanismType,
      sensitivity: float = 1,
      weight: float = 1,
      count: int = 1,
      noise_standard_deviation: Optional[float] = None,
  ) -> MechanismSpec:
      """Request a budget.
  
      Constructs a mechanism spec based on the parameters.
      Adds the mechanism to the pipeline for future calculation.
  
      Args:
          mechanism_type: The type of noise distribution for the mechanism.
          sensitivity: The sensitivity for the mechanism.
          weight: The weight for the mechanism.
          count: The number of times the mechanism will be applied.
          noise_standard_deviation: The standard deviation for the mechanism.
  
  
      Returns:
          A "lazy" mechanism spec object that doesn't contain the noise
          standard deviation until compute_budgets is called.
      """
      if self._finalized:
          raise Exception(
              "request_budget() is called after compute_budgets(). "
              "Please ensure that compute_budgets() is called after DP "
              "aggregations."
          )
  
      if count != 1 or noise_standard_deviation is not None:
          raise NotImplementedError(
              "Count and noise standard deviation have not been implemented yet."
          )
      if (
          mechanism_type == agg_params.MechanismType.GAUSSIAN
          and self._total_delta == 0
      ):
          raise AssertionError(
              "The Gaussian mechanism requires that the pipeline delta is greater than 0"
          )
      mechanism_spec = MechanismSpec(mechanism_type=mechanism_type)
      mechanism_spec_internal = MechanismSpecInternal(
          mechanism_spec=mechanism_spec,
          sensitivity=sensitivity,
          weight=weight,
      )
      self._register_mechanism(mechanism_spec_internal)
      return mechanism_spec
  
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 2 for calling the PLDBudgetAccountant obj's underlying member method code with example usage: obj.request_budget(mechanism_type, sensitivity, weight, count, noise_standard_deviation) and returns: mechanism_spec