code: def gpd_var_calculator(
      threshold,
      scale_param,
      shape_param,
      probability,
      total_n,
      exceedance_n,
  ):
      result = 0
      if exceedance_n > 0 and shape_param > 0:
          # this formula is from Gilli and Kellezi pg. 12
          param_ratio = scale_param / shape_param
          prob_ratio = (total_n / exceedance_n) * probability
          result = threshold + (
              param_ratio * (pow(prob_ratio, -shape_param) - 1)
          )
      return result
  
imports: from __future__ import division
  import math
  import pandas
  import numpy
  from math import pow
  from scipy import stats, optimize
  from six import iteritems
  from sys import float_info
  from .utils import nanmean, nanstd, nanmin, up, down, roll, rolling_window
  from .periods import ANNUALIZATION_FACTORS, APPROX_BDAYS_PER_YEAR
  from .periods import DAILY, WEEKLY, MONTHLY, QUARTERLY, YEARLY
label_desc: Use image node_id 37 for calling a global function with example usage: gpd_var_calculator(threshold, scale_param, shape_param, probability, total_n, exceedance_n) and returns: result