We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
use bibtex in multi_comp.py
convert references in `mne/stats/multi_comp.py` to use footcite / footbibliography


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mne/stats/multi_comp.py`
Content:
```
1 # Authors: Josef Pktd and example from H Raja and rewrite from Vincent Davis
2 #          Alexandre Gramfort <alexandre.gramfort@inria.fr>
3 #
4 # Code borrowed from statsmodels
5 #
6 # License: BSD (3-clause)
7 
8 import numpy as np
9 
10 
11 def _ecdf(x):
12     """No frills empirical cdf used in fdrcorrection."""
13     nobs = len(x)
14     return np.arange(1, nobs + 1) / float(nobs)
15 
16 
17 def fdr_correction(pvals, alpha=0.05, method='indep'):
18     """P-value correction with False Discovery Rate (FDR).
19 
20     Correction for multiple comparison using FDR [1]_.
21 
22     This covers Benjamini/Hochberg for independent or positively correlated and
23     Benjamini/Yekutieli for general or negatively correlated tests.
24 
25     Parameters
26     ----------
27     pvals : array_like
28         Set of p-values of the individual tests.
29     alpha : float
30         Error rate.
31     method : 'indep' | 'negcorr'
32         If 'indep' it implements Benjamini/Hochberg for independent or if
33         'negcorr' it corresponds to Benjamini/Yekutieli.
34 
35     Returns
36     -------
37     reject : array, bool
38         True if a hypothesis is rejected, False if not.
39     pval_corrected : array
40         P-values adjusted for multiple hypothesis testing to limit FDR.
41 
42     References
43     ----------
44     .. [1] Genovese CR, Lazar NA, Nichols T. Thresholding of statistical maps
45            in functional neuroimaging using the false discovery rate.
46            Neuroimage. 2002 Apr;15(4):870-8.
47     """
48     pvals = np.asarray(pvals)
49     shape_init = pvals.shape
50     pvals = pvals.ravel()
51 
52     pvals_sortind = np.argsort(pvals)
53     pvals_sorted = pvals[pvals_sortind]
54     sortrevind = pvals_sortind.argsort()
55 
56     if method in ['i', 'indep', 'p', 'poscorr']:
57         ecdffactor = _ecdf(pvals_sorted)
58     elif method in ['n', 'negcorr']:
59         cm = np.sum(1. / np.arange(1, len(pvals_sorted) + 1))
60         ecdffactor = _ecdf(pvals_sorted) / cm
61     else:
62         raise ValueError("Method should be 'indep' and 'negcorr'")
63 
64     reject = pvals_sorted < (ecdffactor * alpha)
65     if reject.any():
66         rejectmax = max(np.nonzero(reject)[0])
67     else:
68         rejectmax = 0
69     reject[:rejectmax] = True
70 
71     pvals_corrected_raw = pvals_sorted / ecdffactor
72     pvals_corrected = np.minimum.accumulate(pvals_corrected_raw[::-1])[::-1]
73     pvals_corrected[pvals_corrected > 1.0] = 1.0
74     pvals_corrected = pvals_corrected[sortrevind].reshape(shape_init)
75     reject = reject[sortrevind].reshape(shape_init)
76     return reject, pvals_corrected
77 
78 
79 def bonferroni_correction(pval, alpha=0.05):
80     """P-value correction with Bonferroni method.
81 
82     Parameters
83     ----------
84     pval : array_like
85         Set of p-values of the individual tests.
86     alpha : float
87         Error rate.
88 
89     Returns
90     -------
91     reject : array, bool
92         True if a hypothesis is rejected, False if not.
93     pval_corrected : array
94         P-values adjusted for multiple hypothesis testing to limit FDR.
95     """
96     pval = np.asarray(pval)
97     pval_corrected = pval * float(pval.size)
98     # p-values must not be larger than 1.
99     pval_corrected = pval_corrected.clip(max=1.)
100     reject = pval_corrected < alpha
101     return reject, pval_corrected
102
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mne/stats/multi_comp.py b/mne/stats/multi_comp.py
--- a/mne/stats/multi_comp.py
+++ b/mne/stats/multi_comp.py
@@ -17,7 +17,7 @@
 def fdr_correction(pvals, alpha=0.05, method='indep'):
     """P-value correction with False Discovery Rate (FDR).
 
-    Correction for multiple comparison using FDR [1]_.
+    Correction for multiple comparison using FDR :footcite:`GenoveseEtAl2002`.
 
     This covers Benjamini/Hochberg for independent or positively correlated and
     Benjamini/Yekutieli for general or negatively correlated tests.
@@ -41,9 +41,7 @@
 
     References
     ----------
-    .. [1] Genovese CR, Lazar NA, Nichols T. Thresholding of statistical maps
-           in functional neuroimaging using the false discovery rate.
-           Neuroimage. 2002 Apr;15(4):870-8.
+    .. footbibliography::
     """
     pvals = np.asarray(pvals)
     shape_init = pvals.shape

{"golden_diff": "diff --git a/mne/stats/multi_comp.py b/mne/stats/multi_comp.py\n--- a/mne/stats/multi_comp.py\n+++ b/mne/stats/multi_comp.py\n@@ -17,7 +17,7 @@\n def fdr_correction(pvals, alpha=0.05, method='indep'):\n     \"\"\"P-value correction with False Discovery Rate (FDR).\n \n-    Correction for multiple comparison using FDR [1]_.\n+    Correction for multiple comparison using FDR :footcite:`GenoveseEtAl2002`.\n \n     This covers Benjamini/Hochberg for independent or positively correlated and\n     Benjamini/Yekutieli for general or negatively correlated tests.\n@@ -41,9 +41,7 @@\n \n     References\n     ----------\n-    .. [1] Genovese CR, Lazar NA, Nichols T. Thresholding of statistical maps\n-           in functional neuroimaging using the false discovery rate.\n-           Neuroimage. 2002 Apr;15(4):870-8.\n+    .. footbibliography::\n     \"\"\"\n     pvals = np.asarray(pvals)\n     shape_init = pvals.shape\n", "issue": "use bibtex in multi_comp.py\nconvert references in `mne/stats/multi_comp.py` to use footcite / footbibliography\r\n\n", "before_files": [{"content": "# Authors: Josef Pktd and example from H Raja and rewrite from Vincent Davis\n#          Alexandre Gramfort <alexandre.gramfort@inria.fr>\n#\n# Code borrowed from statsmodels\n#\n# License: BSD (3-clause)\n\nimport numpy as np\n\n\ndef _ecdf(x):\n    \"\"\"No frills empirical cdf used in fdrcorrection.\"\"\"\n    nobs = len(x)\n    return np.arange(1, nobs + 1) / float(nobs)\n\n\ndef fdr_correction(pvals, alpha=0.05, method='indep'):\n    \"\"\"P-value correction with False Discovery Rate (FDR).\n\n    Correction for multiple comparison using FDR [1]_.\n\n    This covers Benjamini/Hochberg for independent or positively correlated and\n    Benjamini/Yekutieli for general or negatively correlated tests.\n\n    Parameters\n    ----------\n    pvals : array_like\n        Set of p-values of the individual tests.\n    alpha : float\n        Error rate.\n    method : 'indep' | 'negcorr'\n        If 'indep' it implements Benjamini/Hochberg for independent or if\n        'negcorr' it corresponds to Benjamini/Yekutieli.\n\n    Returns\n    -------\n    reject : array, bool\n        True if a hypothesis is rejected, False if not.\n    pval_corrected : array\n        P-values adjusted for multiple hypothesis testing to limit FDR.\n\n    References\n    ----------\n    .. [1] Genovese CR, Lazar NA, Nichols T. Thresholding of statistical maps\n           in functional neuroimaging using the false discovery rate.\n           Neuroimage. 2002 Apr;15(4):870-8.\n    \"\"\"\n    pvals = np.asarray(pvals)\n    shape_init = pvals.shape\n    pvals = pvals.ravel()\n\n    pvals_sortind = np.argsort(pvals)\n    pvals_sorted = pvals[pvals_sortind]\n    sortrevind = pvals_sortind.argsort()\n\n    if method in ['i', 'indep', 'p', 'poscorr']:\n        ecdffactor = _ecdf(pvals_sorted)\n    elif method in ['n', 'negcorr']:\n        cm = np.sum(1. / np.arange(1, len(pvals_sorted) + 1))\n        ecdffactor = _ecdf(pvals_sorted) / cm\n    else:\n        raise ValueError(\"Method should be 'indep' and 'negcorr'\")\n\n    reject = pvals_sorted < (ecdffactor * alpha)\n    if reject.any():\n        rejectmax = max(np.nonzero(reject)[0])\n    else:\n        rejectmax = 0\n    reject[:rejectmax] = True\n\n    pvals_corrected_raw = pvals_sorted / ecdffactor\n    pvals_corrected = np.minimum.accumulate(pvals_corrected_raw[::-1])[::-1]\n    pvals_corrected[pvals_corrected > 1.0] = 1.0\n    pvals_corrected = pvals_corrected[sortrevind].reshape(shape_init)\n    reject = reject[sortrevind].reshape(shape_init)\n    return reject, pvals_corrected\n\n\ndef bonferroni_correction(pval, alpha=0.05):\n    \"\"\"P-value correction with Bonferroni method.\n\n    Parameters\n    ----------\n    pval : array_like\n        Set of p-values of the individual tests.\n    alpha : float\n        Error rate.\n\n    Returns\n    -------\n    reject : array, bool\n        True if a hypothesis is rejected, False if not.\n    pval_corrected : array\n        P-values adjusted for multiple hypothesis testing to limit FDR.\n    \"\"\"\n    pval = np.asarray(pval)\n    pval_corrected = pval * float(pval.size)\n    # p-values must not be larger than 1.\n    pval_corrected = pval_corrected.clip(max=1.)\n    reject = pval_corrected < alpha\n    return reject, pval_corrected\n", "path": "mne/stats/multi_comp.py"}], "after_files": [{"content": "# Authors: Josef Pktd and example from H Raja and rewrite from Vincent Davis\n#          Alexandre Gramfort <alexandre.gramfort@inria.fr>\n#\n# Code borrowed from statsmodels\n#\n# License: BSD (3-clause)\n\nimport numpy as np\n\n\ndef _ecdf(x):\n    \"\"\"No frills empirical cdf used in fdrcorrection.\"\"\"\n    nobs = len(x)\n    return np.arange(1, nobs + 1) / float(nobs)\n\n\ndef fdr_correction(pvals, alpha=0.05, method='indep'):\n    \"\"\"P-value correction with False Discovery Rate (FDR).\n\n    Correction for multiple comparison using FDR :footcite:`GenoveseEtAl2002`.\n\n    This covers Benjamini/Hochberg for independent or positively correlated and\n    Benjamini/Yekutieli for general or negatively correlated tests.\n\n    Parameters\n    ----------\n    pvals : array_like\n        Set of p-values of the individual tests.\n    alpha : float\n        Error rate.\n    method : 'indep' | 'negcorr'\n        If 'indep' it implements Benjamini/Hochberg for independent or if\n        'negcorr' it corresponds to Benjamini/Yekutieli.\n\n    Returns\n    -------\n    reject : array, bool\n        True if a hypothesis is rejected, False if not.\n    pval_corrected : array\n        P-values adjusted for multiple hypothesis testing to limit FDR.\n\n    References\n    ----------\n    .. footbibliography::\n    \"\"\"\n    pvals = np.asarray(pvals)\n    shape_init = pvals.shape\n    pvals = pvals.ravel()\n\n    pvals_sortind = np.argsort(pvals)\n    pvals_sorted = pvals[pvals_sortind]\n    sortrevind = pvals_sortind.argsort()\n\n    if method in ['i', 'indep', 'p', 'poscorr']:\n        ecdffactor = _ecdf(pvals_sorted)\n    elif method in ['n', 'negcorr']:\n        cm = np.sum(1. / np.arange(1, len(pvals_sorted) + 1))\n        ecdffactor = _ecdf(pvals_sorted) / cm\n    else:\n        raise ValueError(\"Method should be 'indep' and 'negcorr'\")\n\n    reject = pvals_sorted < (ecdffactor * alpha)\n    if reject.any():\n        rejectmax = max(np.nonzero(reject)[0])\n    else:\n        rejectmax = 0\n    reject[:rejectmax] = True\n\n    pvals_corrected_raw = pvals_sorted / ecdffactor\n    pvals_corrected = np.minimum.accumulate(pvals_corrected_raw[::-1])[::-1]\n    pvals_corrected[pvals_corrected > 1.0] = 1.0\n    pvals_corrected = pvals_corrected[sortrevind].reshape(shape_init)\n    reject = reject[sortrevind].reshape(shape_init)\n    return reject, pvals_corrected\n\n\ndef bonferroni_correction(pval, alpha=0.05):\n    \"\"\"P-value correction with Bonferroni method.\n\n    Parameters\n    ----------\n    pval : array_like\n        Set of p-values of the individual tests.\n    alpha : float\n        Error rate.\n\n    Returns\n    -------\n    reject : array, bool\n        True if a hypothesis is rejected, False if not.\n    pval_corrected : array\n        P-values adjusted for multiple hypothesis testing to limit FDR.\n    \"\"\"\n    pval = np.asarray(pval)\n    pval_corrected = pval * float(pval.size)\n    # p-values must not be larger than 1.\n    pval_corrected = pval_corrected.clip(max=1.)\n    reject = pval_corrected < alpha\n    return reject, pval_corrected\n", "path": "mne/stats/multi_comp.py"}]}