parameters: (self, spent_budget=None, slack=None)
return_statement: return Budget(
              min(total_epsilon_naive, total_epsilon_drv, total_epsilon_kov), total_delta
          )
docstring: Returns the total current privacy spend.
          `spent_budget` and `slack` can be specified as parameters, otherwise the class values will be used.
          Parameters
          ----------
          spent_budget : list of tuples of the form (epsilon, delta), optional
              List of tuples of budget spends.  If not provided, the accountant's spends will be used.
          slack : float, optional
              Slack in delta for composition.  If not provided, the accountant's slack will be used.
          Returns
          -------
          epsilon : float
              Total epsilon spend.
          delta : float
              Total delta spend.
docstring_summary: Returns the total current privacy spend.
          `spent_budget` and `slack` can be specified as parameters, otherwise the class values will be used.
          Parameters
          ----------
          spent_budget : list of tuples of the form (epsilon, delta), optional
              List of tuples of budget spends.  If not provided, the accountant's spends will be used.
          slack : float, optional
              Slack in delta for composition.  If not provided, the accountant's slack will be used.
          Returns
          -------
          epsilon : float
              Total epsilon spend.
          delta : float
              Total delta spend.
docstring_tokens: Returns the total current privacy spend . spent_budget and slack can be specified as parameters otherwise the class values will be used . Parameters ---------- spent_budget : list of tuples of the form ( epsilon delta ) optional List of tuples of budget spends . If not provided the accountant s spends will be used . slack : float optional Slack in delta for composition . If not provided the accountant s slack will be used . Returns ------- epsilon : float Total epsilon spend . delta : float Total delta spend .
function: def total(self, spent_budget=None, slack=None):
          """Returns the total current privacy spend.
          `spent_budget` and `slack` can be specified as parameters, otherwise the class values will be used.
          Parameters
          ----------
          spent_budget : list of tuples of the form (epsilon, delta), optional
              List of tuples of budget spends.  If not provided, the accountant's spends will be used.
          slack : float, optional
              Slack in delta for composition.  If not provided, the accountant's slack will be used.
          Returns
          -------
          epsilon : float
              Total epsilon spend.
          delta : float
              Total delta spend.
          """
          if spent_budget is None:
              spent_budget = self.spent_budget
          else:
              for epsilon, delta in spent_budget:
                  check_epsilon_delta(epsilon, delta)
  
          if slack is None:
              slack = self.slack
          elif not 0 <= slack <= self.delta:
              raise ValueError(
                  "Slack must be between 0 and delta ({}), inclusive. Got {}.".format(
                      self.delta, slack
                  )
              )
  
          epsilon_sum, epsilon_exp_sum, epsilon_sq_sum = 0, 0, 0
  
          for epsilon, _ in spent_budget:
              epsilon_sum += epsilon
              epsilon_exp_sum += (1 - np.exp(-epsilon)) * epsilon / (1 + np.exp(-epsilon))
              epsilon_sq_sum += epsilon ** 2
  
          total_epsilon_naive = epsilon_sum
          total_delta = self.__total_delta_safe(spent_budget, slack)
  
          if slack == 0:
              return Budget(total_epsilon_naive, total_delta)
  
          total_epsilon_drv = epsilon_exp_sum + np.sqrt(
              2 * epsilon_sq_sum * np.log(1 / slack)
          )
          total_epsilon_kov = epsilon_exp_sum + np.sqrt(
              2 * epsilon_sq_sum * np.log(np.exp(1) + np.sqrt(epsilon_sq_sum) / slack)
          )
  
          return Budget(
              min(total_epsilon_naive, total_epsilon_drv, total_epsilon_kov), total_delta
          )
function_tokens: def total ( self , spent_budget = None , slack = None ) : if spent_budget is None : spent_budget = self . spent_budget else : for epsilon , delta in spent_budget : check_epsilon_delta ( epsilon , delta ) if slack is None : slack = self . slack elif not 0 <= slack <= self . delta : raise ValueError ( "Slack must be between 0 and delta ({}), inclusive. Got {}." . format ( self . delta , slack ) ) epsilon_sum , epsilon_exp_sum , epsilon_sq_sum = 0 , 0 , 0 for epsilon , _ in spent_budget : epsilon_sum += epsilon epsilon_exp_sum += ( 1 - np . exp ( - epsilon ) ) * epsilon / ( 1 + np . exp ( - epsilon ) ) epsilon_sq_sum += epsilon ** 2 total_epsilon_naive = epsilon_sum total_delta = self . __total_delta_safe ( spent_budget , slack ) if slack == 0 : return Budget ( total_epsilon_naive , total_delta ) total_epsilon_drv = epsilon_exp_sum + np . sqrt ( 2 * epsilon_sq_sum * np . log ( 1 / slack ) ) total_epsilon_kov = epsilon_exp_sum + np . sqrt ( 2 * epsilon_sq_sum * np . log ( np . exp ( 1 ) + np . sqrt ( epsilon_sq_sum ) / slack ) ) return Budget ( min ( total_epsilon_naive , total_epsilon_drv , total_epsilon_kov ) , total_delta )