code: def sign_test(samp, mu0=0):
      """
      Signs test
  
      Parameters
      ----------
      samp : array_like
          1d array. The sample for which you want to perform the sign test.
      mu0 : float
          See Notes for the definition of the sign test. mu0 is 0 by
          default, but it is common to set it to the median.
  
      Returns
      -------
      M
      p-value
  
      Notes
      -----
      The signs test returns
  
      M = (N(+) - N(-))/2
  
      where N(+) is the number of values above `mu0`, N(-) is the number of
      values below.  Values equal to `mu0` are discarded.
  
      The p-value for M is calculated using the binomial distribution
      and can be interpreted the same as for a t-test. The test-statistic
      is distributed Binom(min(N(+), N(-)), n_trials, .5) where n_trials
      equals N(+) + N(-).
  
      See Also
      --------
      scipy.stats.wilcoxon
      """
      samp = np.asarray(samp)
      pos = np.sum(samp > mu0)
      neg = np.sum(samp < mu0)
      M = (pos - neg) / 2.0
      try:
          p = stats.binomtest(min(pos, neg), pos + neg, 0.5).pvalue
      except AttributeError:
          # Remove after min SciPy >= 1.7
          p = stats.binom_test(min(pos, neg), pos + neg, 0.5)
      return M, p
  
imports: from statsmodels.compat.pandas import PD_LT_2, Appender, is_numeric_dtype
  from statsmodels.compat.scipy import SP_LT_19
  from typing import Union
  from collections.abc import Sequence
  import numpy
  import pandas
  from scipy import stats
  from statsmodels.iolib.table import SimpleTable
  from statsmodels.stats.stattools import jarque_bera
  from statsmodels.tools.decorators import cache_readonly
  from statsmodels.tools.docstring import Docstring, Parameter
  from statsmodels.tools.validation import array_like, bool_like, float_like, int_like
label_desc: Use image node_id 10 for calling a global function with example usage: sign_test(samp, mu0) and returns: M,  p