code: def _tauAP_b_ties(x, y):
      n = len(x)
      rx = rankdata(x)
      ry = rankdata(y, method="ordinal")
      p = rankdata(y, method="min")
      c_all = 0
      not_top = np.argwhere(p != 1)
      for i in not_top:
          c_above = 0
          for j in np.argwhere(p < p[i]):
              sx = np.sign(rx[i] - rx[j])
              sy = np.sign(ry[i] - ry[j])
              if sx == sy:
                  c_above = c_above + 1
          c_all = c_all + c_above / (p[i] - 1)
      return 2 / len(not_top) * c_all - 1
  
imports: import numpy
  from scipy.stats import rankdata
label_desc: Use image node_id 2 for calling a global function with example usage: _tauAP_b_ties(x, y) and returns: unknown