code: def _compute_rdp_sample_without_replacement_int(q, sigma, alpha):
      """Compute log(A_alpha) for integer alpha, subsampling without replacement.
  
      When alpha is smaller than max_alpha, compute the bound Theorem 27 exactly,
        otherwise compute the bound with Stirling approximation.
  
      Args:
        q: The sampling proportion = m / n.  Assume m is an integer <= n.
        sigma: The std of the additive Gaussian noise.
        alpha: The order at which RDP is computed.
  
      Returns:
        RDP at alpha, can be np.inf.
      """
  
      max_alpha = 256
      assert isinstance(alpha, six.integer_types)
  
      if np.isinf(alpha):
          return np.inf
      elif alpha == 1:
          return 0
  
      def cgf(x):
          # Return rdp(x+1)*x, the rdp of Gaussian mechanism is alpha/(2*sigma**2)
          return x * 1.0 * (x + 1) / (2.0 * sigma**2)
  
      def func(x):
          # Return the rdp of Gaussian mechanism
          return 1.0 * x / (2.0 * sigma**2)
  
      # Initialize with 1 in the log space.
      log_a = 0
      # Calculates the log term when alpha = 2
      log_f2m1 = func(2.0) + np.log(1 - np.exp(-func(2.0)))
      if alpha <= max_alpha:
          # We need forward differences of exp(cgf)
          # The following line is the numerically stable way of implementing it.
          # The output is in polar form with logarithmic magnitude
          deltas, _ = _get_forward_diffs(cgf, alpha)
          # Compute the bound exactly requires book keeping of O(alpha**2)
  
          for i in range(2, alpha + 1):
              if i == 2:
                  s = (
                      2 * np.log(q)
                      + _log_comb(alpha, 2)
                      + np.minimum(
                          np.log(4) + log_f2m1, func(2.0) + np.log(2)
                      )
                  )
              elif i > 2:
                  delta_lo = deltas[int(2 * np.floor(i / 2.0)) - 1]
                  delta_hi = deltas[int(2 * np.ceil(i / 2.0)) - 1]
                  s = np.log(4) + 0.5 * (delta_lo + delta_hi)
                  s = np.minimum(s, np.log(2) + cgf(i - 1))
                  s += i * np.log(q) + _log_comb(alpha, i)
              log_a = _log_add(log_a, s)
          return float(log_a)
      else:
          # Compute the bound with stirling approximation. Everything is O(x) now.
          for i in range(2, alpha + 1):
              if i == 2:
                  s = (
                      2 * np.log(q)
                      + _log_comb(alpha, 2)
                      + np.minimum(
                          np.log(4) + log_f2m1, func(2.0) + np.log(2)
                      )
                  )
              else:
                  s = (
                      np.log(2)
                      + cgf(i - 1)
                      + i * np.log(q)
                      + _log_comb(alpha, i)
                  )
              log_a = _log_add(log_a, s)
  
          return log_a
  
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 18 for calling a global function with example usage: _compute_rdp_sample_without_replacement_int(q, sigma, alpha) and returns: np, unknown, unknown, float, log_a, int