code: def ks_prob(testscore):
      """KS-probability corresponding ti KS test score
  
      Copyright ROOT:
      Formulas translated from c++ to python, but formulas otherwise not modified.
      Reference: https://root.cern.ch/doc/master/classTH1.html#TH1:KolmogorovTest
      GNU license: https://root.cern.ch/license
      All modifications copyright INGA WB.
  
      :param float testscore: Kolmogorov-Smirnov test score
  
      :return: approximate pvalue for the Kolmogorov-Smirnov test score
      :rtype: float
      """
      fj = np.array([-2, -8, -18, -32])
      r = np.zeros(4)
  
      w = 2.50662827
      c = np.array(
          [
              -1.2337005501361697,
              -11.103304951225528,
              -30.842513753404244,
          ]
      )
  
      u = abs(testscore)
      pvalue = np.nan
      if u < 0.2:
          pvalue = 1
      elif u < 0.755:
          v = np.power(u, -2)
          pvalue = 1 - w * np.exp(c * v).sum() / u
      elif u < 6.8116:
          v = np.power(u, 2)
          max_j = int(max(1, round(3.0 / u)))
          r[:max_j] = np.exp(fj[:max_j] * v)
          pvalue = 2 * (r[0] - r[1] + r[2] - r[3])
  
      return pvalue
  
file_path: popmon/popmon/analysis/comparison/comparisons.py
imports: import numpy
  from scipy import stats
  from popmon.base.registry import Registry
label_desc: Use image node_id 6 for calling a global function with example usage: ks_prob(testscore) and returns: pvalue