code: def wilcoxon(x, y=None, zero_method="wilcox", correction=False):
      """
      Calculate the Wilcoxon signed-rank test.
  
      The Wilcoxon signed-rank test tests the null hypothesis that two
      related paired samples come from the same distribution. In particular,
      it tests whether the distribution of the differences x - y is symmetric
      about zero. It is a non-parametric version of the paired T-test.
  
      Parameters
      ----------
      x : array_like
          The first set of measurements.
      y : array_like, optional
          The second set of measurements.  If `y` is not given, then the `x`
          array is considered to be the differences between the two sets of
          measurements.
      zero_method : string, {"pratt", "wilcox", "zsplit"}, optional
          "pratt":
              Pratt treatment: includes zero-differences in the ranking process
              (more conservative)
          "wilcox":
              Wilcox treatment: discards all zero-differences
          "zsplit":
              Zero rank split: just like Pratt, but splitting the zero rank
              between positive and negative ones
      correction : bool, optional
          If True, apply continuity correction by adjusting the Wilcoxon rank
          statistic by 0.5 towards the mean value when computing the
          z-statistic.  Default is False.
  
      Returns
      -------
      statistic : float
          The sum of the ranks of the differences above or below zero, whichever
          is smaller.
      pvalue : float
          The two-sided p-value for the test.
  
      Notes
      -----
      Because the normal approximation is used for the calculations, the
      samples used should be large.  A typical rule is to require that
      n > 20.
  
      References
      ----------
      .. [1] https://en.wikipedia.org/wiki/Wilcoxon_signed-rank_test
  
      """
  
      if zero_method not in ["wilcox", "pratt", "zsplit"]:
          raise ValueError(
              "Zero method should be either 'wilcox' "
              "or 'pratt' or 'zsplit'"
          )
  
      if y is None:
          d = asarray(x)
      else:
          x, y = map(asarray, (x, y))
          if len(x) != len(y):
              raise ValueError("Unequal N in wilcoxon.  Aborting.")
          d = x - y
  
      if zero_method == "wilcox":
          # Keep all non-zero differences
          d = compress(np.not_equal(d, 0), d, axis=-1)
  
      count = len(d)
      if count < 10:
          warnings.warn(
              "Warning: sample size too small for normal approximation."
          )
  
      r = stats.rankdata(abs(d))
      r_plus = np.sum((d > 0) * r, axis=0)
      r_minus = np.sum((d < 0) * r, axis=0)
  
      if zero_method == "zsplit":
          r_zero = np.sum((d == 0) * r, axis=0)
          r_plus += r_zero / 2.0
          r_minus += r_zero / 2.0
  
      T = min(r_plus, r_minus)
      mn = count * (count + 1.0) * 0.25
      se = count * (count + 1.0) * (2.0 * count + 1.0)
  
      if zero_method == "pratt":
          r = r[d != 0]
  
      replist, repnum = find_repeats(r)
      if repnum.size != 0:
          # Correction for repeated elements.
          se -= 0.5 * (repnum * (repnum * repnum - 1)).sum()
  
      se = sqrt(se / 24)
      correction = 0.5 * int(bool(correction)) * np.sign(T - mn)
      z = (T - mn - correction) / se
      prob = 2.0 * distributions.norm.sf(abs(z))
  
      return WilcoxonResult(T, prob)
  
imports: from __future__ import division, print_function, absolute_import
  import math
  import warnings
  from collections import namedtuple
  import numpy
  from numpy import isscalar, r_, log, around, unique, asarray, zeros, arange, sort, amin, amax, any, atleast_1d, sqrt, ceil, floor, array, compress, pi, exp, ravel, count_nonzero, sin, cos, arctan2, hypot
  from scipy._lib.six import string_types
  from scipy import optimize
  from scipy import special
  from .None import statlib
  from .None import stats
  from .stats import find_repeats, _contains_nan
  from .contingency import chi2_contingency
  from .None import distributions
  from ._distn_infrastructure import rv_generic
label_desc: Use image node_id 34 for calling a global function with example usage: wilcoxon(x, y, zero_method, correction) and returns: WilcoxonResult