code: def _compute_local_sens_gnmax(logq, sigma, num_classes, order):
      """Implements Algorithm 3 (computes an upper bound on local sensitivity).
  
      (See Proposition 13 for proof of correctness.)
      """
      logq0 = _compute_logq0(sigma, order)
      logq1 = _compute_logq1(sigma, order, num_classes)
      if logq1 <= logq <= logq0:
          logq = logq1
  
      beta = _compute_rdp_gnmax(sigma, logq, order)
      beta_bu_q = _compute_rdp_gnmax(
          sigma,
          math.log(
              _compute_bu_gnmax(math.exp(logq), sigma, num_classes)
          ),
          order,
      )
      beta_bl_q = _compute_rdp_gnmax(
          sigma,
          math.log(
              _compute_bl_gnmax(math.exp(logq), sigma, num_classes)
          ),
          order,
      )
      return max(beta_bu_q - beta, beta - beta_bl_q)
  
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
  import sympy
  import core
label_desc: Use image node_id 9 for calling a global function with example usage: _compute_local_sens_gnmax(logq, sigma, num_classes, order) and returns: max