code: def rdp_pure_eps(logq, pure_eps, orders):
      """Computes the RDP value given logq and pure privacy eps.
  
      Implementation of https://arxiv.org/abs/1610.05755, Theorem 3.
  
      The bound used is the min of three terms. The first term is from
      https://arxiv.org/pdf/1605.02065.pdf.
      The second term is based on the fact that when event has probability (1-q) for
      q close to zero, q can only change by exp(eps), which corresponds to a
      much smaller multiplicative change in (1-q)
      The third term comes directly from the privacy guarantee.
  
      Args:
        logq: Natural logarithm of the probability of a non-optimal outcome.
        pure_eps: eps parameter for DP
        orders: array_like list of moments to compute.
  
      Returns:
        Array of upper bounds on rdp (a scalar if orders is a scalar).
      """
      orders_vec = np.atleast_1d(orders)
      q = math.exp(logq)
      log_t = np.full_like(orders_vec, np.inf)
      if q <= 1 / (math.exp(pure_eps) + 1):
          logt_one = math.log1p(-q) + (
              math.log1p(-q) - _log1mexp(pure_eps + logq)
          ) * (orders_vec - 1)
          logt_two = logq + pure_eps * (orders_vec - 1)
          log_t = np.logaddexp(logt_one, logt_two)
  
      ret = np.minimum(
          np.minimum(
              0.5 * pure_eps * pure_eps * orders_vec,
              log_t / (orders_vec - 1),
          ),
          pure_eps,
      )
      if np.isscalar(orders):
          return ret.item()
      else:
          return ret
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from absl import app
  import numpy
  import scipy.stats
label_desc: Use image node_id 13 for calling a global function with example usage: rdp_pure_eps(logq, pure_eps, orders) and returns: ret, ret