code: def get_privacy_spent(
      *,
      orders: Union[List[float], float],
      rdp: Union[List[float], float],
      delta: float,
  ) -> Tuple[float, float]:
      r"""Computes epsilon given a list of Renyi Differential Privacy (RDP) values at
      multiple RDP orders and target ``delta``.
      The computation of epslion, i.e. conversion from RDP to (eps, delta)-DP,
      is based on the theorem presented in the following work:
      Borja Balle et al. "Hypothesis testing interpretations and Renyi differential privacy."
      International Conference on Artificial Intelligence and Statistics. PMLR, 2020.
      Particullary, Theorem 21 in the arXiv version https://arxiv.org/abs/1905.09982.
      Args:
          orders: An array (or a scalar) of orders (alphas).
          rdp: A list (or a scalar) of RDP guarantees.
          delta: The target delta.
      Returns:
          Pair of epsilon and optimal order alpha.
      Raises:
          ValueError
              If the lengths of ``orders`` and ``rdp`` are not equal.
      """
      orders_vec = np.atleast_1d(orders)
      rdp_vec = np.atleast_1d(rdp)
  
      if len(orders_vec) != len(rdp_vec):
          raise ValueError(
              f"Input lists must have the same length.\n"
              f"\torders_vec = {orders_vec}\n"
              f"\trdp_vec = {rdp_vec}\n"
          )
  
      eps = (
          rdp_vec
          - (np.log(delta) + np.log(orders_vec)) / (orders_vec - 1)
          + np.log((orders_vec - 1) / orders_vec)
      )
  
      # special case when there is no privacy
      if np.isnan(eps).all():
          return np.inf, np.nan
  
      idx_opt = np.nanargmin(eps)  # Ignore NaNs
      if idx_opt == 0 or idx_opt == len(eps) - 1:
          extreme = "smallest" if idx_opt == 0 else "largest"
          warnings.warn(
              f"Optimal order is the {extreme} alpha. Please consider expanding the range of alphas to get a tighter privacy bound."
          )
      return eps[idx_opt], orders_vec[idx_opt]
  
file_path: opacus/opacus/accountants/analysis/rdp.py
imports: import math
  import warnings
  from typing import List, Tuple, Union
  import numpy
  from scipy import special
label_desc: Use image node_id 9 for calling a global function with example usage: get_privacy_spent() and returns: eps,  orders_vec, np,  np