code: def compute_local_sensitivity_bounds_threshold(
      counts, num_teachers, threshold, sigma, order
  ):
      """Computes a list of max-LS-at-distance-d for the threshold mechanism."""
  
      def _compute_ls(v):
          ls_step_up, ls_step_down = float("-inf"), float("-inf")
          if v > 0:
              ls_step_down = abs(rdp_list[v - 1] - rdp_list[v])
          if v < num_teachers:
              ls_step_up = abs(rdp_list[v + 1] - rdp_list[v])
          return max(
              ls_step_down, ls_step_up
          )  # Rely on max(x, None) = x.
  
      cur_max = int(round(max(counts)))
      rdp_list = _compute_rdp_list_threshold(
          num_teachers, threshold, sigma, order
      )
  
      ls = np.zeros(num_teachers)
      for d in range(max(cur_max, num_teachers - cur_max)):
          ls_up, ls_down = float("-inf"), float("-inf")
          if cur_max + d <= num_teachers:
              ls_up = _compute_ls(cur_max + d)
          if cur_max - d >= 0:
              ls_down = _compute_ls(cur_max - d)
          ls[d] = max(ls_up, ls_down)
      return ls
  
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 12 for calling a global function with example usage: compute_local_sensitivity_bounds_threshold(counts, num_teachers, threshold, sigma, order) and returns: ls, max