code: def empirical(ds, alpha, x):
      sds = np.sort(ds)
      ds_to_the_alpha = sds**alpha
      fractions = ds_to_the_alpha  # / sum (ds_to_the_alpha)
      thresholds = np.cumsum(fractions)
      thresholds /= thresholds[-1]
      i = find_first(thresholds, lambda u: x < u)
      return i
  
label_desc: Use image node_id 1 for calling a global function with example usage: empirical(ds, alpha, x) and returns: i