def get_privacy_spent(log_moments, target_eps=None, target_delta=None):
    'Compute delta (or eps) for given eps (or delta) from log moments.\n\n  Args:\n    log_moments: array of (moment_order, log_moment) pairs.\n    target_eps: if not None, the epsilon for which we would like to compute\n      corresponding delta value.\n    target_delta: if not None, the delta for which we would like to compute\n      corresponding epsilon value. Exactly one of target_eps and target_delta\n      is None.\n  Returns:\n    eps, delta pair\n  '
    assert ((target_eps is None) ^ (target_delta is None))
    assert (not ((target_eps is None) and (target_delta is None)))
    if (target_eps is not None):
        return (target_eps, _compute_delta(log_moments, target_eps))
    else:
        return (_compute_eps(log_moments, target_delta), target_delta)
Compute delta (or eps) for given eps (or delta) from log moments.

Args:
  log_moments: array of (moment_order, log_moment) pairs.
  target_eps: if not None, the epsilon for which we would like to compute
    corresponding delta value.
  target_delta: if not None, the delta for which we would like to compute
    corresponding epsilon value. Exactly one of target_eps and target_delta
    is None.
Returns:
  eps, delta pair
def get_privacy_spent(log_moments, target_eps=None, target_delta=None):
    'Compute delta (or eps) for given eps (or delta) from log moments.\n\n  Args:\n    log_moments: array of (moment_order, log_moment) pairs.\n    target_eps: if not None, the epsilon for which we would like to compute\n      corresponding delta value.\n    target_delta: if not None, the delta for which we would like to compute\n      corresponding epsilon value. Exactly one of target_eps and target_delta\n      is None.\n  Returns:\n    eps, delta pair\n  '
    assert ((target_eps is None) ^ (target_delta is None))
    assert (not ((target_eps is None) and (target_delta is None)))
    if (target_eps is not None):
        return (target_eps, _compute_delta(log_moments, target_eps))
    else:
        return (_compute_eps(log_moments, target_delta), target_delta)