code: def tauAP_b(x, y, decreasing=True):
      """
      Weighted kendall tau correlation metric, which handles ties.
      Proposed in "The Treatment of Ties in AP Correlation" by
      Urbano and Marrero (2017). This is the python implementation
      of ircor::tauAP_b from R.
  
      Parameters
      ----------
      x: array-like of shape (n,)
          Numeric vector.
      y: array-like of shape (n,)
          Numeric vector of same length as x.
      decreasing: bool
          Should the sort order be increasing or decreasing (default)?
  
      Returns
      -------
      Scalar value between -1 and 1, quantifying how much the
      rankings of x and y agree with each other. A higher
      values indicates greater similarity.
  
      """
      if decreasing:
          return tauAP_b(-x, -y, decreasing=False)
      else:
          return (_tauAP_b_ties(x, y) + _tauAP_b_ties(y, x)) / 2
  
imports: import numpy
  from scipy.stats import rankdata
label_desc: Use image node_id 1 for calling a global function with example usage: tauAP_b(x, y, decreasing) and returns: tauAP_b, unknown