class_docstr: Base class for budget accountants.
class_docstr_tok: ["Base","class","for","budget","accountants","."]
docstr: Defines a scope for DP operations that should consume no more than "weight" proportion of the budget
  of the parent scope.
  
  The accountant will automatically scale the budgets of all sub-operations accordingly.
  
  Example usage:
    with accountant.scope(weight = 0.5):
       ... some code that consumes DP budget ...
  
  Args:
      weight: budget weight of all operations made within this scope as compared to.
  
  Returns:
      the scope that should be used in a "with" block enclosing the operations consuming the budget.
docstr_tok: ["Defines","a","scope","for","DP","operations","that","should","consume","no","more","than","``","weight","''","proportion","of","the","budget","of","the","parent","scope",".","The","accountant","will","automatically","scale","the","budgets","of","all","sub-operations","accordingly",".","Example","usage",":","with","accountant.scope","(","weight","=","0.5",")",":","...","some","code","that","consumes","DP","budget","...","Args",":","weight",":","budget","weight","of","all","operations","made","within","this","scope","as","compared","to",".","Returns",":","the","scope","that","should","be","used","in","a","``","with","''","block","enclosing","the","operations","consuming","the","budget","."]
code: def scope(self, weight: float):
      """Defines a scope for DP operations that should consume no more than "weight" proportion of the budget
      of the parent scope.
  
      The accountant will automatically scale the budgets of all sub-operations accordingly.
  
      Example usage:
        with accountant.scope(weight = 0.5):
           ... some code that consumes DP budget ...
  
      Args:
          weight: budget weight of all operations made within this scope as compared to.
  
      Returns:
          the scope that should be used in a "with" block enclosing the operations consuming the budget.
      """
      return BudgetAccountantScope(self, weight)
  
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 4 for calling the BudgetAccountant obj's underlying member method code with example usage: obj.scope(weight) and returns: BudgetAccountantScope