def _compute_eps(log_moments, delta):
    'Compute epsilon for given log_moments and delta.\n\n  Args:\n    log_moments: the log moments of privacy loss, in the form of pairs\n      of (moment_order, log_moment)\n    delta: the target delta.\n  Returns:\n    epsilon\n  '
    min_eps = float('inf')
    for (moment_order, log_moment) in log_moments:
        if (moment_order == 0):
            continue
        if (math.isinf(log_moment) or math.isnan(log_moment)):
            sys.stderr.write(('The %d-th order is inf or Nan\n' % moment_order))
            continue
        min_eps = min(min_eps, ((log_moment - math.log(delta)) / moment_order))
    return min_eps
Compute epsilon for given log_moments and delta.

Args:
  log_moments: the log moments of privacy loss, in the form of pairs
    of (moment_order, log_moment)
  delta: the target delta.
Returns:
  epsilon
def _compute_eps(log_moments, delta):
    'Compute epsilon for given log_moments and delta.\n\n  Args:\n    log_moments: the log moments of privacy loss, in the form of pairs\n      of (moment_order, log_moment)\n    delta: the target delta.\n  Returns:\n    epsilon\n  '
    min_eps = float('inf')
    for (moment_order, log_moment) in log_moments:
        if (moment_order == 0):
            continue
        if (math.isinf(log_moment) or math.isnan(log_moment)):
            sys.stderr.write(('The %d-th order is inf or Nan\n' % moment_order))
            continue
        min_eps = min(min_eps, ((log_moment - math.log(delta)) / moment_order))
    return min_eps