code: def get_privacy_spent(
      orders, rdp, target_eps=None, target_delta=None
  ):
      """Computes delta (or eps) for given eps (or delta) from RDP values.
  
      Args:
        orders: An array (or a scalar) of RDP orders.
        rdp: An array of RDP values. Must be of the same length as the orders list.
        target_eps: If not `None`, the epsilon for which we compute the
          corresponding delta.
        target_delta: If not `None`, the delta for which we compute the
          corresponding epsilon. Exactly one of `target_eps` and `target_delta` must
          be `None`.
  
      Returns:
        A tuple of epsilon, delta, and the optimal order.
  
      Raises:
        ValueError: If target_eps and target_delta are messed up.
      """
      if target_eps is None and target_delta is None:
          raise ValueError(
              "Exactly one out of eps and delta must be None. (Both are)."
          )
  
      if target_eps is not None and target_delta is not None:
          raise ValueError(
              "Exactly one out of eps and delta must be None. (None is)."
          )
  
      if target_eps is not None:
          delta, opt_order = _compute_delta(orders, rdp, target_eps)
          return target_eps, delta, opt_order
      else:
          eps, opt_order = _compute_eps(orders, rdp, target_delta)
          return eps, target_delta, opt_order
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import sys
  import numpy
  from scipy import special
  import six
label_desc: Use image node_id 20 for calling a global function with example usage: get_privacy_spent(orders, rdp, target_eps, target_delta) and returns: target_eps,  delta,  opt_order, eps,  target_delta,  opt_order