code: def multicomp(pvals, alpha=0.05, method="holm"):
      """P-values correction for multiple comparisons.
  
      Parameters
      ----------
      pvals : array_like
          Uncorrected p-values.
      alpha : float
          Significance level.
      method : string
          Method used for testing and adjustment of p-values. Can be either the
          full name or initial letters. Available methods are:
  
          * ``'bonf'``: one-step Bonferroni correction
          * ``'sidak'``: one-step Sidak correction
          * ``'holm'``: step-down method using Bonferroni adjustments
          * ``'fdr_bh'``: Benjamini/Hochberg FDR correction
          * ``'fdr_by'``: Benjamini/Yekutieli FDR correction
          * ``'none'``: pass-through option (no correction applied)
  
      Returns
      -------
      reject : array, boolean
          True for hypothesis that can be rejected for given alpha.
      pvals_corrected : array
          P-values corrected for multiple testing.
  
      Notes
      -----
      This function is similar to the `p.adjust
      <https://stat.ethz.ch/R-manual/R-devel/library/stats/html/p.adjust.html>`_
      R function.
  
      The correction methods include the Bonferroni correction (``'bonf'``)
      in which the p-values are multiplied by the number of comparisons.
      Less conservative methods are also included such as Sidak (1967)
      (``'sidak'``), Holm (1979) (``'holm'``), Benjamini & Hochberg (1995)
      (``'fdr_bh'``), and Benjamini & Yekutieli (2001) (``'fdr_by'``),
      respectively.
  
      The first three methods are designed to give strong control of the
      family-wise error rate. Note that the Holm's method is usually preferred.
      The ``'fdr_bh'`` and ``'fdr_by'`` methods control the false discovery rate,
      i.e. the expected proportion of false discoveries amongst the rejected
      hypotheses. The false discovery rate is a less stringent condition than
      the family-wise error rate, so these methods are more powerful than the
      others.
  
      The **Bonferroni** [1]_ adjusted p-values are defined as:
  
      .. math::
          \\widetilde {p}_{{(i)}}= n \\cdot p_{{(i)}}
  
      where :math:`n` is the number of *finite* p-values (i.e. excluding NaN).
  
      The **Sidak** [2]_ adjusted p-values are defined as:
  
      .. math::
          \\widetilde {p}_{{(i)}}= 1 - (1 - p_{{(i)}})^{n}
  
      The **Holm** [3]_ adjusted p-values are the running maximum of the sorted
      p-values divided by the corresponding increasing alpha level:
  
      .. math::
          \\widetilde {p}_{{(i)}}=\\max _{{j\\leq i}}\\left\\{(n-j+1)p_{{(j)}}
          \\right\\}_{{1}}
  
      The **Benjamini–Hochberg** procedure (BH step-up procedure, [4]_)
      controls the false discovery rate (FDR) at level :math:`\\alpha`.
      It works as follows:
  
      1. For a given :math:`\\alpha`, find the largest :math:`k` such that
      :math:`P_{(k)}\\leq \\frac {k}{n}\\alpha.`
  
      2. Reject the null hypothesis for all
      :math:`H_{(i)}` for :math:`i = 1, \\ldots, k`.
  
      The BH procedure is valid when the :math:`n` tests are independent, and
      also in various scenarios of dependence, but is not universally valid.
  
      The **Benjamini–Yekutieli** procedure (BY, [5]_) controls the FDR under
      arbitrary dependence assumptions. This refinement modifies the threshold
      and finds the largest :math:`k` such that:
  
      .. math::
          P_{(k)} \\leq \\frac{k}{n \\cdot c(n)} \\alpha
  
      References
      ----------
      .. [1] Bonferroni, C. E. (1935). Il calcolo delle assicurazioni su gruppi
         di teste. Studi in onore del professore salvatore ortu carboni, 13-60.
  
      .. [2] Šidák, Z. K. (1967). "Rectangular Confidence Regions for the Means
         of Multivariate Normal Distributions". Journal of the American
         Statistical Association. 62 (318): 626–633.
  
      .. [3] Holm, S. (1979). A simple sequentially rejective multiple test
         procedure. Scandinavian Journal of Statistics, 6, 65–70.
  
      .. [4] Benjamini, Y., and Hochberg, Y. (1995). Controlling the false
         discovery rate: a practical and powerful approach to multiple testing.
         Journal of the Royal Statistical Society Series B, 57, 289–300.
  
      .. [5] Benjamini, Y., and Yekutieli, D. (2001). The control of the false
         discovery rate in multiple testing under dependency. Annals of
         Statistics, 29, 1165–1188.
  
      Examples
      --------
      FDR correction of an array of p-values
  
      >>> import pingouin as pg
      >>> pvals = [.50, .003, .32, .054, .0003]
      >>> reject, pvals_corr = pg.multicomp(pvals, method='fdr_bh')
      >>> print(reject, pvals_corr)
      [False  True False False  True] [0.5    0.0075 0.4    0.09   0.0015]
  
      Holm correction with missing values
  
      >>> import numpy as np
      >>> pvals[2] = np.nan
      >>> reject, pvals_corr = pg.multicomp(pvals, method='holm')
      >>> print(reject, pvals_corr)
      [False  True False False  True] [0.5    0.009     nan 0.108  0.0012]
      """
      # Safety check
      assert isinstance(
          pvals, (list, np.ndarray, Series)
      ), "pvals must be list or array"
      assert isinstance(alpha, float), "alpha must be a float."
      assert isinstance(method, str), "method must be a string."
      assert 0 < alpha < 1, "alpha must be between 0 and 1."
      pvals = np.asarray(pvals)
  
      if method.lower() in ["b", "bonf", "bonferroni"]:
          reject, pvals_corrected = bonf(pvals, alpha=alpha)
      elif method.lower() in ["h", "holm"]:
          reject, pvals_corrected = holm(pvals, alpha=alpha)
      elif method.lower() in ["s", "sidak"]:
          reject, pvals_corrected = sidak(pvals, alpha=alpha)
      elif method.lower() in ["fdr", "fdr_bh", "bh"]:
          reject, pvals_corrected = fdr(
              pvals, alpha=alpha, method="fdr_bh"
          )
      elif method.lower() in ["fdr_by", "by"]:
          reject, pvals_corrected = fdr(
              pvals, alpha=alpha, method="fdr_by"
          )
      elif method.lower() == "none":
          pvals_corrected = pvals
          with np.errstate(invalid="ignore"):
              reject = np.less(pvals_corrected, alpha)
      else:
          raise ValueError("Multiple comparison method not recognized")
      return reject, pvals_corrected
  
imports: import numpy
  from pandas import Series
label_desc: Use image node_id 5 for calling a global function with example usage: multicomp(pvals, alpha, method) and returns: reject,  pvals_corrected