We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ENH?: News / updates
It seems like we should have a little news/updates section of one-liners on the website, including things like:
1. Release notifications
2. Upcoming MNE-Python workshops
3. Upcoming coding sprints

If people agree I can put some old ones (last couple of release dates), and we can add to it as announcement-worthy things come up.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `doc/sphinxext/cited_mne.py`
Content:
```
1 #!/usr/bin/env python
2 """Parse google scholar -> rst for MNE citations.
3 
4 Example usage::
5 
6     $ cited_mne --backend selenium --clear
7 
8 """
9 
10 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
11 # License : BSD 3-clause
12 
13 # Parts of this code were copied from google_scholar_parser
14 # (https://github.com/carlosp420/google_scholar_parser)
15 
16 import os
17 import os.path as op
18 import re
19 import time
20 import random
21 import requests
22 
23 import numpy as np
24 from joblib import Memory
25 from BeautifulSoup import BeautifulSoup
26 
27 from mne.externals.tempita import Template
28 from mne.commands.utils import get_optparser
29 
30 # cache to avoid making too many calls to Google Scholar
31 cachedir = 'cachedir'
32 if not os.path.exists(cachedir):
33     os.mkdir(cachedir)
34 mem = Memory(cachedir=cachedir, verbose=2)
35 
36 UA = ('Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.9) '
37       'Gecko/20100913 Firefox/3.6.9')
38 
39 # ##### Templates for citations #####
40 html = (u""".. _cited
41 
42 Publications from MNE users
43 ===========================
44 
45 Papers citing MNE as extracted from Google Scholar (on %s).
46 
47 """)
48 
49 cite_template = Template(u"""
50 {{for ii, publication in enumerate(publications)}}
51 {{ii + 1}}. {{publication}}.
52 {{endfor}}
53 
54 """)
55 
56 
57 def parse_soup_page(soup):
58     """Parse the page using BeautifulSoup.
59 
60     Parameters
61     ----------
62     soup : instance of BeautifulSoup
63         The page to be parsed.
64 
65     Returns
66     -------
67     titles : list
68         The article titles.
69     authors : list
70         The name of the authors.
71     links : list
72         Hyperlinks to the articles.
73     """
74     titles, authors, links = list(), list(), list()
75     for div in soup.findAll('div'):
76         if div.name == "div" and div.get('class') == "gs_ri":
77             links.append(div.a['href'])
78             div_pub = div.findAll('div')
79             for d in div_pub:
80                 if d.name == 'div' and d.get('class') == 'gs_a':
81                     authors.append(d.text)
82             titles.append(div.a.text)
83     return titles, authors, links
84 
85 
86 def get_total_citations(soup):
87     """Get total citations."""
88     results = soup.find('div', attrs={'id': 'gs_ab_md'}).contents[0]
89     matches = re.search("About\s(\d+)\s", results)
90     if matches:
91         hits = matches.groups()[0]
92         return hits
93 
94 
95 def _get_soup(url, backend='selenium'):
96     """Get BeautifulSoup object from url.
97 
98     Parameters
99     ----------
100     url : str
101         The url to fetch.
102     backend : 'selenium' | 'requests'
103         Use selenium by default because google can ask for captcha. For
104         'selenium' backend Firefox must be installed.
105 
106     Returns
107     -------
108     soup : instance of BeautifulSoup
109         The soup page from the url.
110     """
111     if backend == 'requests':
112         req = requests.get(url, headers={'User-Agent': UA})
113         html_doc = req.text
114         soup = BeautifulSoup(html_doc)
115         if soup.find('div', attrs={'id': 'gs_ab_md'}) is None:
116             print('Falling back on to selenium backend due to captcha.')
117             backend = 'selenium'
118 
119     if backend == 'selenium':
120         from selenium import webdriver
121         import selenium.webdriver.support.ui as ui
122 
123         driver = webdriver.Firefox()
124         # give enough time to solve captcha.
125         wait = ui.WebDriverWait(driver, 200)
126 
127         driver.get(url)
128         wait.until(lambda driver: driver.find_elements_by_id('gs_ab_md'))
129 
130         html_doc = driver.page_source
131         soup = BeautifulSoup(html_doc)
132         driver.close()
133 
134     return soup
135 
136 
137 @mem.cache
138 def get_citing_articles(cites_url, backend):
139     """Get the citing articles.
140 
141     Parameters
142     ----------
143     cites_url: str
144         A citation url from Google Scholar.
145     backend : 'selenium' | 'requests'
146         Use selenium by default because google can ask for captcha. For
147         'selenium' backend Firefox must be installed.
148 
149 
150     Returns
151     -------
152     titles : list
153         The article titles.
154     authors : list
155         The name of the authors.
156     links : list
157         Hyperlinks to the articles.
158     """
159     n = random.random() * 5
160     time.sleep(n)
161     print("\nSleeping: {0} seconds".format(n))
162 
163     # GS seems to allow only 20 hits per page!
164     cites_url += "&num=20"
165     soup = _get_soup(cites_url, backend=backend)
166     hits = get_total_citations(soup)
167     print("Got a total of {0} citations".format(hits))
168 
169     hits = int(hits)
170     index = 0
171     titles, authors, links = list(), list(), list()
172     while hits > 1:
173         n = random.random() * 2
174         time.sleep(n)
175         if index > 0:
176             url = cites_url + "&start=" + str(index)
177         else:
178             url = cites_url
179         index += 20
180         hits -= 20
181         print("{0} more citations to process".format(hits))
182         soup = soup = _get_soup(url, backend=backend)
183         title, author, link = parse_soup_page(soup)
184         for this_title, this_author, this_link in zip(title, author, link):
185             titles.append(this_title)
186             authors.append(this_author)
187             links.append(this_link)
188 
189     return titles, authors, links
190 
191 if __name__ == '__main__':
192     parser = get_optparser(__file__)
193     parser.add_option("-c", "--clear", dest="clear", action='store_true',
194                       help="if True, clear the cache.", default=False)
195     parser.add_option("-b", "--backend", dest="backend",
196                       help="backend for parsing (selenium | requests)",
197                       default='requests')
198     options, args = parser.parse_args()
199     backend, clear = options.backend, options.clear
200 
201     if clear:
202         mem.clear()
203 
204     random.seed()
205     gen_date = time.strftime("%B %d, %Y")
206     html = html % gen_date
207 
208     url_tails = ['1521584321377182930', '12188330066413208874']
209     papers = ['MEG and EEG data analysis with MNE-Python',
210               'MNE software for processing MEG and EEG data']
211 
212     publications = list()
213     for url_tail, paper in zip(url_tails, papers):
214         titles, authors, links = get_citing_articles(
215             'https://scholar.google.co.in/scholar?cites=%s'
216             % url_tail, backend=backend)
217 
218         this_publication = list()
219         for ii in range(len(titles)):
220             pub = '`%s. <%s>`_. %s' % (titles[ii], links[ii], authors[ii])
221             this_publication.append(pub)
222 
223         this_publication = [p.encode('utf8') for p in this_publication]
224         publications.append(this_publication)
225 
226     # get a union of the citations for the two papers, sorted in
227     # alphabetic order
228     publications = np.union1d(publications[1], publications[0]).tolist()
229 
230     # sort by year of publication
231     years = list()
232     for pub in publications:
233         m = re.search('\d{4} -', pub)
234         if m is None:
235             years.append(-1)
236         else:
237             years.append(int(m.group(0)[:-2]))
238     order = np.argsort(years)[::-1]
239     publications = [publications[idx] for idx in order]
240 
241     # filter out publications not containing (http://, https://, ftp://)
242     publications = [p for p in publications if
243                     any(sub in p for sub in ('http://', 'https://', 'ftp://'))]
244 
245     # create rst & cleanup
246     this_html = cite_template.substitute(publications=publications)
247     this_html = this_html.replace('&hellip;', '...')
248     html += this_html
249 
250     # output an rst file
251     with open(op.join('..', 'cited.rst'), 'w') as f:
252         f.write(html.encode('utf8'))
253
```
--- 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/doc/sphinxext/cited_mne.py b/doc/sphinxext/cited_mne.py
--- a/doc/sphinxext/cited_mne.py
+++ b/doc/sphinxext/cited_mne.py
@@ -39,8 +39,8 @@
 # ##### Templates for citations #####
 html = (u""".. _cited
 
-Publications from MNE users
-===========================
+Publications by users
+=====================
 
 Papers citing MNE as extracted from Google Scholar (on %s).

{"golden_diff": "diff --git a/doc/sphinxext/cited_mne.py b/doc/sphinxext/cited_mne.py\n--- a/doc/sphinxext/cited_mne.py\n+++ b/doc/sphinxext/cited_mne.py\n@@ -39,8 +39,8 @@\n # ##### Templates for citations #####\n html = (u\"\"\".. _cited\n \n-Publications from MNE users\n-===========================\n+Publications by users\n+=====================\n \n Papers citing MNE as extracted from Google Scholar (on %s).\n", "issue": "ENH?: News / updates\nIt seems like we should have a little news/updates section of one-liners on the website, including things like:\n1. Release notifications\n2. Upcoming MNE-Python workshops\n3. Upcoming coding sprints\n\nIf people agree I can put some old ones (last couple of release dates), and we can add to it as announcement-worthy things come up.\n\n", "before_files": [{"content": "#!/usr/bin/env python\n\"\"\"Parse google scholar -> rst for MNE citations.\n\nExample usage::\n\n    $ cited_mne --backend selenium --clear\n\n\"\"\"\n\n# Author: Mainak Jas <mainak.jas@telecom-paristech.fr>\n# License : BSD 3-clause\n\n# Parts of this code were copied from google_scholar_parser\n# (https://github.com/carlosp420/google_scholar_parser)\n\nimport os\nimport os.path as op\nimport re\nimport time\nimport random\nimport requests\n\nimport numpy as np\nfrom joblib import Memory\nfrom BeautifulSoup import BeautifulSoup\n\nfrom mne.externals.tempita import Template\nfrom mne.commands.utils import get_optparser\n\n# cache to avoid making too many calls to Google Scholar\ncachedir = 'cachedir'\nif not os.path.exists(cachedir):\n    os.mkdir(cachedir)\nmem = Memory(cachedir=cachedir, verbose=2)\n\nUA = ('Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.9) '\n      'Gecko/20100913 Firefox/3.6.9')\n\n# ##### Templates for citations #####\nhtml = (u\"\"\".. _cited\n\nPublications from MNE users\n===========================\n\nPapers citing MNE as extracted from Google Scholar (on %s).\n\n\"\"\")\n\ncite_template = Template(u\"\"\"\n{{for ii, publication in enumerate(publications)}}\n{{ii + 1}}. {{publication}}.\n{{endfor}}\n\n\"\"\")\n\n\ndef parse_soup_page(soup):\n    \"\"\"Parse the page using BeautifulSoup.\n\n    Parameters\n    ----------\n    soup : instance of BeautifulSoup\n        The page to be parsed.\n\n    Returns\n    -------\n    titles : list\n        The article titles.\n    authors : list\n        The name of the authors.\n    links : list\n        Hyperlinks to the articles.\n    \"\"\"\n    titles, authors, links = list(), list(), list()\n    for div in soup.findAll('div'):\n        if div.name == \"div\" and div.get('class') == \"gs_ri\":\n            links.append(div.a['href'])\n            div_pub = div.findAll('div')\n            for d in div_pub:\n                if d.name == 'div' and d.get('class') == 'gs_a':\n                    authors.append(d.text)\n            titles.append(div.a.text)\n    return titles, authors, links\n\n\ndef get_total_citations(soup):\n    \"\"\"Get total citations.\"\"\"\n    results = soup.find('div', attrs={'id': 'gs_ab_md'}).contents[0]\n    matches = re.search(\"About\\s(\\d+)\\s\", results)\n    if matches:\n        hits = matches.groups()[0]\n        return hits\n\n\ndef _get_soup(url, backend='selenium'):\n    \"\"\"Get BeautifulSoup object from url.\n\n    Parameters\n    ----------\n    url : str\n        The url to fetch.\n    backend : 'selenium' | 'requests'\n        Use selenium by default because google can ask for captcha. For\n        'selenium' backend Firefox must be installed.\n\n    Returns\n    -------\n    soup : instance of BeautifulSoup\n        The soup page from the url.\n    \"\"\"\n    if backend == 'requests':\n        req = requests.get(url, headers={'User-Agent': UA})\n        html_doc = req.text\n        soup = BeautifulSoup(html_doc)\n        if soup.find('div', attrs={'id': 'gs_ab_md'}) is None:\n            print('Falling back on to selenium backend due to captcha.')\n            backend = 'selenium'\n\n    if backend == 'selenium':\n        from selenium import webdriver\n        import selenium.webdriver.support.ui as ui\n\n        driver = webdriver.Firefox()\n        # give enough time to solve captcha.\n        wait = ui.WebDriverWait(driver, 200)\n\n        driver.get(url)\n        wait.until(lambda driver: driver.find_elements_by_id('gs_ab_md'))\n\n        html_doc = driver.page_source\n        soup = BeautifulSoup(html_doc)\n        driver.close()\n\n    return soup\n\n\n@mem.cache\ndef get_citing_articles(cites_url, backend):\n    \"\"\"Get the citing articles.\n\n    Parameters\n    ----------\n    cites_url: str\n        A citation url from Google Scholar.\n    backend : 'selenium' | 'requests'\n        Use selenium by default because google can ask for captcha. For\n        'selenium' backend Firefox must be installed.\n\n\n    Returns\n    -------\n    titles : list\n        The article titles.\n    authors : list\n        The name of the authors.\n    links : list\n        Hyperlinks to the articles.\n    \"\"\"\n    n = random.random() * 5\n    time.sleep(n)\n    print(\"\\nSleeping: {0} seconds\".format(n))\n\n    # GS seems to allow only 20 hits per page!\n    cites_url += \"&num=20\"\n    soup = _get_soup(cites_url, backend=backend)\n    hits = get_total_citations(soup)\n    print(\"Got a total of {0} citations\".format(hits))\n\n    hits = int(hits)\n    index = 0\n    titles, authors, links = list(), list(), list()\n    while hits > 1:\n        n = random.random() * 2\n        time.sleep(n)\n        if index > 0:\n            url = cites_url + \"&start=\" + str(index)\n        else:\n            url = cites_url\n        index += 20\n        hits -= 20\n        print(\"{0} more citations to process\".format(hits))\n        soup = soup = _get_soup(url, backend=backend)\n        title, author, link = parse_soup_page(soup)\n        for this_title, this_author, this_link in zip(title, author, link):\n            titles.append(this_title)\n            authors.append(this_author)\n            links.append(this_link)\n\n    return titles, authors, links\n\nif __name__ == '__main__':\n    parser = get_optparser(__file__)\n    parser.add_option(\"-c\", \"--clear\", dest=\"clear\", action='store_true',\n                      help=\"if True, clear the cache.\", default=False)\n    parser.add_option(\"-b\", \"--backend\", dest=\"backend\",\n                      help=\"backend for parsing (selenium | requests)\",\n                      default='requests')\n    options, args = parser.parse_args()\n    backend, clear = options.backend, options.clear\n\n    if clear:\n        mem.clear()\n\n    random.seed()\n    gen_date = time.strftime(\"%B %d, %Y\")\n    html = html % gen_date\n\n    url_tails = ['1521584321377182930', '12188330066413208874']\n    papers = ['MEG and EEG data analysis with MNE-Python',\n              'MNE software for processing MEG and EEG data']\n\n    publications = list()\n    for url_tail, paper in zip(url_tails, papers):\n        titles, authors, links = get_citing_articles(\n            'https://scholar.google.co.in/scholar?cites=%s'\n            % url_tail, backend=backend)\n\n        this_publication = list()\n        for ii in range(len(titles)):\n            pub = '`%s. <%s>`_. %s' % (titles[ii], links[ii], authors[ii])\n            this_publication.append(pub)\n\n        this_publication = [p.encode('utf8') for p in this_publication]\n        publications.append(this_publication)\n\n    # get a union of the citations for the two papers, sorted in\n    # alphabetic order\n    publications = np.union1d(publications[1], publications[0]).tolist()\n\n    # sort by year of publication\n    years = list()\n    for pub in publications:\n        m = re.search('\\d{4} -', pub)\n        if m is None:\n            years.append(-1)\n        else:\n            years.append(int(m.group(0)[:-2]))\n    order = np.argsort(years)[::-1]\n    publications = [publications[idx] for idx in order]\n\n    # filter out publications not containing (http://, https://, ftp://)\n    publications = [p for p in publications if\n                    any(sub in p for sub in ('http://', 'https://', 'ftp://'))]\n\n    # create rst & cleanup\n    this_html = cite_template.substitute(publications=publications)\n    this_html = this_html.replace('&hellip;', '...')\n    html += this_html\n\n    # output an rst file\n    with open(op.join('..', 'cited.rst'), 'w') as f:\n        f.write(html.encode('utf8'))\n", "path": "doc/sphinxext/cited_mne.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\"\"\"Parse google scholar -> rst for MNE citations.\n\nExample usage::\n\n    $ cited_mne --backend selenium --clear\n\n\"\"\"\n\n# Author: Mainak Jas <mainak.jas@telecom-paristech.fr>\n# License : BSD 3-clause\n\n# Parts of this code were copied from google_scholar_parser\n# (https://github.com/carlosp420/google_scholar_parser)\n\nimport os\nimport os.path as op\nimport re\nimport time\nimport random\nimport requests\n\nimport numpy as np\nfrom joblib import Memory\nfrom BeautifulSoup import BeautifulSoup\n\nfrom mne.externals.tempita import Template\nfrom mne.commands.utils import get_optparser\n\n# cache to avoid making too many calls to Google Scholar\ncachedir = 'cachedir'\nif not os.path.exists(cachedir):\n    os.mkdir(cachedir)\nmem = Memory(cachedir=cachedir, verbose=2)\n\nUA = ('Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.9) '\n      'Gecko/20100913 Firefox/3.6.9')\n\n# ##### Templates for citations #####\nhtml = (u\"\"\".. _cited\n\nPublications by users\n=====================\n\nPapers citing MNE as extracted from Google Scholar (on %s).\n\n\"\"\")\n\ncite_template = Template(u\"\"\"\n{{for ii, publication in enumerate(publications)}}\n{{ii + 1}}. {{publication}}.\n{{endfor}}\n\n\"\"\")\n\n\ndef parse_soup_page(soup):\n    \"\"\"Parse the page using BeautifulSoup.\n\n    Parameters\n    ----------\n    soup : instance of BeautifulSoup\n        The page to be parsed.\n\n    Returns\n    -------\n    titles : list\n        The article titles.\n    authors : list\n        The name of the authors.\n    links : list\n        Hyperlinks to the articles.\n    \"\"\"\n    titles, authors, links = list(), list(), list()\n    for div in soup.findAll('div'):\n        if div.name == \"div\" and div.get('class') == \"gs_ri\":\n            links.append(div.a['href'])\n            div_pub = div.findAll('div')\n            for d in div_pub:\n                if d.name == 'div' and d.get('class') == 'gs_a':\n                    authors.append(d.text)\n            titles.append(div.a.text)\n    return titles, authors, links\n\n\ndef get_total_citations(soup):\n    \"\"\"Get total citations.\"\"\"\n    results = soup.find('div', attrs={'id': 'gs_ab_md'}).contents[0]\n    matches = re.search(\"About\\s(\\d+)\\s\", results)\n    if matches:\n        hits = matches.groups()[0]\n        return hits\n\n\ndef _get_soup(url, backend='selenium'):\n    \"\"\"Get BeautifulSoup object from url.\n\n    Parameters\n    ----------\n    url : str\n        The url to fetch.\n    backend : 'selenium' | 'requests'\n        Use selenium by default because google can ask for captcha. For\n        'selenium' backend Firefox must be installed.\n\n    Returns\n    -------\n    soup : instance of BeautifulSoup\n        The soup page from the url.\n    \"\"\"\n    if backend == 'requests':\n        req = requests.get(url, headers={'User-Agent': UA})\n        html_doc = req.text\n        soup = BeautifulSoup(html_doc)\n        if soup.find('div', attrs={'id': 'gs_ab_md'}) is None:\n            print('Falling back on to selenium backend due to captcha.')\n            backend = 'selenium'\n\n    if backend == 'selenium':\n        from selenium import webdriver\n        import selenium.webdriver.support.ui as ui\n\n        driver = webdriver.Firefox()\n        # give enough time to solve captcha.\n        wait = ui.WebDriverWait(driver, 200)\n\n        driver.get(url)\n        wait.until(lambda driver: driver.find_elements_by_id('gs_ab_md'))\n\n        html_doc = driver.page_source\n        soup = BeautifulSoup(html_doc)\n        driver.close()\n\n    return soup\n\n\n@mem.cache\ndef get_citing_articles(cites_url, backend):\n    \"\"\"Get the citing articles.\n\n    Parameters\n    ----------\n    cites_url: str\n        A citation url from Google Scholar.\n    backend : 'selenium' | 'requests'\n        Use selenium by default because google can ask for captcha. For\n        'selenium' backend Firefox must be installed.\n\n\n    Returns\n    -------\n    titles : list\n        The article titles.\n    authors : list\n        The name of the authors.\n    links : list\n        Hyperlinks to the articles.\n    \"\"\"\n    n = random.random() * 5\n    time.sleep(n)\n    print(\"\\nSleeping: {0} seconds\".format(n))\n\n    # GS seems to allow only 20 hits per page!\n    cites_url += \"&num=20\"\n    soup = _get_soup(cites_url, backend=backend)\n    hits = get_total_citations(soup)\n    print(\"Got a total of {0} citations\".format(hits))\n\n    hits = int(hits)\n    index = 0\n    titles, authors, links = list(), list(), list()\n    while hits > 1:\n        n = random.random() * 2\n        time.sleep(n)\n        if index > 0:\n            url = cites_url + \"&start=\" + str(index)\n        else:\n            url = cites_url\n        index += 20\n        hits -= 20\n        print(\"{0} more citations to process\".format(hits))\n        soup = soup = _get_soup(url, backend=backend)\n        title, author, link = parse_soup_page(soup)\n        for this_title, this_author, this_link in zip(title, author, link):\n            titles.append(this_title)\n            authors.append(this_author)\n            links.append(this_link)\n\n    return titles, authors, links\n\nif __name__ == '__main__':\n    parser = get_optparser(__file__)\n    parser.add_option(\"-c\", \"--clear\", dest=\"clear\", action='store_true',\n                      help=\"if True, clear the cache.\", default=False)\n    parser.add_option(\"-b\", \"--backend\", dest=\"backend\",\n                      help=\"backend for parsing (selenium | requests)\",\n                      default='requests')\n    options, args = parser.parse_args()\n    backend, clear = options.backend, options.clear\n\n    if clear:\n        mem.clear()\n\n    random.seed()\n    gen_date = time.strftime(\"%B %d, %Y\")\n    html = html % gen_date\n\n    url_tails = ['1521584321377182930', '12188330066413208874']\n    papers = ['MEG and EEG data analysis with MNE-Python',\n              'MNE software for processing MEG and EEG data']\n\n    publications = list()\n    for url_tail, paper in zip(url_tails, papers):\n        titles, authors, links = get_citing_articles(\n            'https://scholar.google.co.in/scholar?cites=%s'\n            % url_tail, backend=backend)\n\n        this_publication = list()\n        for ii in range(len(titles)):\n            pub = '`%s. <%s>`_. %s' % (titles[ii], links[ii], authors[ii])\n            this_publication.append(pub)\n\n        this_publication = [p.encode('utf8') for p in this_publication]\n        publications.append(this_publication)\n\n    # get a union of the citations for the two papers, sorted in\n    # alphabetic order\n    publications = np.union1d(publications[1], publications[0]).tolist()\n\n    # sort by year of publication\n    years = list()\n    for pub in publications:\n        m = re.search('\\d{4} -', pub)\n        if m is None:\n            years.append(-1)\n        else:\n            years.append(int(m.group(0)[:-2]))\n    order = np.argsort(years)[::-1]\n    publications = [publications[idx] for idx in order]\n\n    # filter out publications not containing (http://, https://, ftp://)\n    publications = [p for p in publications if\n                    any(sub in p for sub in ('http://', 'https://', 'ftp://'))]\n\n    # create rst & cleanup\n    this_html = cite_template.substitute(publications=publications)\n    this_html = this_html.replace('&hellip;', '...')\n    html += this_html\n\n    # output an rst file\n    with open(op.join('..', 'cited.rst'), 'w') as f:\n        f.write(html.encode('utf8'))\n", "path": "doc/sphinxext/cited_mne.py"}]}