code: def calc_curdistance(
      curlastz, meanx, sigmax, idx, profile_len, m, curdistance
  ):
      tmp_a = curlastz[idx : profile_len + 1]
      tmp_b = meanx[idx:profile_len]
      tmp_c = meanx[0 : profile_len - idx]
      tmp_d = sigmax[idx:profile_len]
      tmp_e = sigmax[0 : profile_len - idx]
      tmp_f = tmp_b * tmp_c
      tmp_g = m - (tmp_a - m * tmp_f) / (tmp_d * tmp_e)
      curdistance[idx:profile_len] = np.sqrt(np.abs(2 * tmp_g))
  
      return curdistance
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import math
  import time
  import warnings
  import numpy
label_desc: Use image node_id 21 for calling a global function with example usage: calc_curdistance(curlastz, meanx, sigmax, idx, profile_len, m, curdistance) and returns: curdistance