We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix for sunpy paper listing 3.7


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `sunpy/net/helio/parser.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # Author:   Michael Malocha <mjm159@humboldt.edu>
3 # Last Edit:  September 22nd, 2013
4 #
5 # This module was developed with funding from the GSOC 2013 summer of code
6 #
7 
8 """
9 This module is meant to parse the HELIO registry and return WSDL endpoints to
10 facilitate the interfacing between further modules and HELIO.
11 """
12 from __future__ import absolute_import
13 from urllib2 import urlopen, URLError
14 #import sunpy.util.etree as EL
15 import xml.etree.ElementTree as EL
16 from sunpy.net.helio import registry_links as RL
17 from bs4 import BeautifulSoup
18 from contextlib import closing
19 
20 __author__ = 'Michael Malocha'
21 __version__ = 'September 22nd, 2013'
22 
23 # Lifespan in seconds before a link times-out
24 LINK_TIMEOUT = 3
25 
26 
27 def webservice_parser(service='HEC'):
28     """
29     Quickly parses important contents from HELIO registry.
30 
31     Uses the link contained in registry_links in with 'service' appended
32     and scrapes the web-service links contained on that webpage.
33 
34     Parameters
35     ----------
36     service: str
37         Indicates which particular HELIO service is used. Defaults to HEC.
38 
39     Returns
40     -------
41     links: list or NoneType
42         List of urls to registries containing WSDL endpoints.
43 
44     Examples
45     --------
46     >>> from sunpy.net.helio import parser
47     >>> parser.webservice_parser()
48     ['http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService',
49     'http://festung3.oats.inaf.it:8080/helio-hec/HelioService',
50     'http://festung1.oats.inaf.it:8080/helio-hec/HelioService',
51     'http://hec.helio-vo.eu/helio_hec/HelioService',
52     'http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioLongQueryService',
53     'http://festung3.oats.inaf.it:8080/helio-hec/HelioLongQueryService',
54     'http://festung1.oats.inaf.it:8080/helio-hec/HelioLongQueryService',
55     'http://hec.helio-vo.eu/helio_hec/HelioLongQueryService']
56     """
57     link = RL.LINK + service.lower()
58     xml = link_test(link)
59     if xml is None:
60         return xml
61     root = EL.fromstring(xml)
62     links = []
63 
64     #WARNING: getiterator is deprecated in Python 2.7+
65     #Fix for 3.x support
66     for interface in root.getiterator('interface'):
67         service_type = interface.attrib
68         key = service_type.keys()
69         if len(key) > 0:
70             value = service_type[key[0]]
71             if value == 'vr:WebService':
72                 for url in interface.getiterator('accessURL'):
73                     if url.text not in links:
74                         links.append(url.text)
75     return links
76 
77 
78 def endpoint_parser(link):
79     """
80     Takes a link to a list of endpoints and parses the WSDL links.
81 
82     Feeding 1 result from webservice_parser() into endpoint_parser() at a time
83     will return a list of WSDL endpoints that are contained on the page from
84     that link that was passed in.
85 
86     Parameters
87     ----------
88     link: str
89         A url to a page containing links to WSDL files.
90 
91     Returns
92     -------
93     endpoints: list or NoneType
94         A list containing all of the available WSDL endpoints from the passed
95         in url.
96 
97     Examples
98     --------
99     >>> from sunpy.net.helio import parser
100     >>> parser.endpoint_parser('http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService')
101     ['http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioService?wsdl',
102     'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioService1_0?wsdl',
103     'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioService1_0b?wsdl',
104     'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService?wsdl',
105     'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService1_0?wsdl',
106     'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService1_1?wsdl',
107     'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService1_0b?wsdl',
108     'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioTavernaService?wsdl']
109     """
110     endpoint_page = link_test(link)
111     if endpoint_page is None:
112         return None
113     soup = BeautifulSoup(endpoint_page)
114     endpoints = []
115     for web_link in soup.find_all('a'):
116         endpoints.append(web_link.get('href'))
117     return endpoints
118 
119 
120 def taverna_parser(link):
121     """
122     Takes a link to a list of endpoints and parses the taverna WSDL links.
123 
124     Takes a url to a page containing a list of endpoints, then passes that url
125     to endpoint_parser(). Upon receiving the resulting list from the parser
126     taverna_parser() goes through the list and finds all the WSDL links for
127     the taverna web-service. It then returns a list containing the filtered
128     links.
129 
130     Parameters
131     ----------
132     link: str
133         A url to a page containing links to WSDL files.
134 
135     Returns
136     -------
137     taverna_links: list or NoneType
138         A list containing WSDL links for a taverna web-service
139 
140     Examples
141     --------
142     >>> from sunpy.net.helio import parser
143     >>> parser.taverna_parser('http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService')
144     ['http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioTavernaService?wsdl']
145     """
146     endpoints = endpoint_parser(link)
147     taverna_links = []
148     if endpoints is None:
149         return None
150     for web_link in endpoints:
151         if 'Taverna' in web_link:
152             taverna_links.append(web_link)
153     if len(taverna_links) == 0:
154         return None
155     return taverna_links
156 
157 
158 def link_test(link):
159     """
160     Just a quick function to test a link.
161 
162     Quickly checks to see if the URL is a valid link; if it is it returns the
163     downloaded contents of that page.
164 
165     Parameters
166     ----------
167     link: str
168         A string containing a URL
169 
170     Returns
171     -------
172     webpage: str or NoneType
173         String containing the webresults
174 
175     Examples
176     --------
177     >>> from sunpy.net.helio import parser
178     >>> parser.link_test('http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService')
179     u'<html>\n<head>...</body>\n</html>\n'
180 
181     >>> print parser.link_test('http://rrnx.invalid_url5523.com')
182     None
183     """
184     try:
185         with closing(urlopen(link)) as fd:
186             return fd.read()
187     except (ValueError, URLError):
188         return None
189 
190 
191 def wsdl_retriever(service='HEC'):
192     """
193     Retrieves a link to a taverna WSDL file
194 
195     This is essentially the master method, from it all the other functions get
196     called and it essentially knits everything together. It gets a list of
197     service links via webservice_parser(), then filters the results via
198     taverna_parser(). Finally it tests all the returned taverna WSDL links
199     and returns the first live taverna endpoint.
200 
201     Parameters
202     ----------
203     service: str
204         Indicates which particular HELIO service is used. Defaults to HEC.
205 
206     Returns
207     -------
208     wsdl: str
209         URL to a single live taverna endpoint
210 
211     Examples
212     --------
213     >>> from sunpy.net.helio import parser
214     >>> parser.wsdl_retriever()
215     'http://msslkz.mssl.ucl.ac.uk:80/helio_hec/HelioTavernaService?wsdl'
216 
217     Notes
218     -----
219     * Currently only support for HEC exists, but it was designed so that it
220         could be expanded at a later date
221     * There is a 3 second timeout lifespan on links, so there is potential for
222         this function to take a while to return. Timeout duration can be
223         controlled through the LINK_TIMEOUT value
224     """
225     service_links = webservice_parser(service=service)
226     wsdl = None
227     wsdl_links = None
228     if service_links is None:
229         return None
230     for link in service_links:
231         wsdl_links = taverna_parser(link)
232     if wsdl_links is None:
233         return None
234     for end_point in wsdl_links:
235         if end_point is not None and link_test(end_point) is not None:
236             wsdl = end_point
237             break
238     return wsdl
239
```
--- 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/sunpy/net/helio/parser.py b/sunpy/net/helio/parser.py
--- a/sunpy/net/helio/parser.py
+++ b/sunpy/net/helio/parser.py
@@ -54,7 +54,7 @@
     'http://festung1.oats.inaf.it:8080/helio-hec/HelioLongQueryService',
     'http://hec.helio-vo.eu/helio_hec/HelioLongQueryService']
     """
-    link = RL.LINK + service.lower()
+    link = RL.LINK + '/' + service.lower()
     xml = link_test(link)
     if xml is None:
         return xml
@@ -182,7 +182,7 @@
     None
     """
     try:
-        with closing(urlopen(link)) as fd:
+        with closing(urlopen(link, timeout=LINK_TIMEOUT)) as fd:
             return fd.read()
     except (ValueError, URLError):
         return None

{"golden_diff": "diff --git a/sunpy/net/helio/parser.py b/sunpy/net/helio/parser.py\n--- a/sunpy/net/helio/parser.py\n+++ b/sunpy/net/helio/parser.py\n@@ -54,7 +54,7 @@\n     'http://festung1.oats.inaf.it:8080/helio-hec/HelioLongQueryService',\n     'http://hec.helio-vo.eu/helio_hec/HelioLongQueryService']\n     \"\"\"\n-    link = RL.LINK + service.lower()\n+    link = RL.LINK + '/' + service.lower()\n     xml = link_test(link)\n     if xml is None:\n         return xml\n@@ -182,7 +182,7 @@\n     None\n     \"\"\"\n     try:\n-        with closing(urlopen(link)) as fd:\n+        with closing(urlopen(link, timeout=LINK_TIMEOUT)) as fd:\n             return fd.read()\n     except (ValueError, URLError):\n         return None\n", "issue": "Fix for sunpy paper listing 3.7\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# Author:   Michael Malocha <mjm159@humboldt.edu>\n# Last Edit:  September 22nd, 2013\n#\n# This module was developed with funding from the GSOC 2013 summer of code\n#\n\n\"\"\"\nThis module is meant to parse the HELIO registry and return WSDL endpoints to\nfacilitate the interfacing between further modules and HELIO.\n\"\"\"\nfrom __future__ import absolute_import\nfrom urllib2 import urlopen, URLError\n#import sunpy.util.etree as EL\nimport xml.etree.ElementTree as EL\nfrom sunpy.net.helio import registry_links as RL\nfrom bs4 import BeautifulSoup\nfrom contextlib import closing\n\n__author__ = 'Michael Malocha'\n__version__ = 'September 22nd, 2013'\n\n# Lifespan in seconds before a link times-out\nLINK_TIMEOUT = 3\n\n\ndef webservice_parser(service='HEC'):\n    \"\"\"\n    Quickly parses important contents from HELIO registry.\n\n    Uses the link contained in registry_links in with 'service' appended\n    and scrapes the web-service links contained on that webpage.\n\n    Parameters\n    ----------\n    service: str\n        Indicates which particular HELIO service is used. Defaults to HEC.\n\n    Returns\n    -------\n    links: list or NoneType\n        List of urls to registries containing WSDL endpoints.\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.webservice_parser()\n    ['http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService',\n    'http://festung3.oats.inaf.it:8080/helio-hec/HelioService',\n    'http://festung1.oats.inaf.it:8080/helio-hec/HelioService',\n    'http://hec.helio-vo.eu/helio_hec/HelioService',\n    'http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioLongQueryService',\n    'http://festung3.oats.inaf.it:8080/helio-hec/HelioLongQueryService',\n    'http://festung1.oats.inaf.it:8080/helio-hec/HelioLongQueryService',\n    'http://hec.helio-vo.eu/helio_hec/HelioLongQueryService']\n    \"\"\"\n    link = RL.LINK + service.lower()\n    xml = link_test(link)\n    if xml is None:\n        return xml\n    root = EL.fromstring(xml)\n    links = []\n\n    #WARNING: getiterator is deprecated in Python 2.7+\n    #Fix for 3.x support\n    for interface in root.getiterator('interface'):\n        service_type = interface.attrib\n        key = service_type.keys()\n        if len(key) > 0:\n            value = service_type[key[0]]\n            if value == 'vr:WebService':\n                for url in interface.getiterator('accessURL'):\n                    if url.text not in links:\n                        links.append(url.text)\n    return links\n\n\ndef endpoint_parser(link):\n    \"\"\"\n    Takes a link to a list of endpoints and parses the WSDL links.\n\n    Feeding 1 result from webservice_parser() into endpoint_parser() at a time\n    will return a list of WSDL endpoints that are contained on the page from\n    that link that was passed in.\n\n    Parameters\n    ----------\n    link: str\n        A url to a page containing links to WSDL files.\n\n    Returns\n    -------\n    endpoints: list or NoneType\n        A list containing all of the available WSDL endpoints from the passed\n        in url.\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.endpoint_parser('http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService')\n    ['http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioService?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioService1_0?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioService1_0b?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService1_0?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService1_1?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService1_0b?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioTavernaService?wsdl']\n    \"\"\"\n    endpoint_page = link_test(link)\n    if endpoint_page is None:\n        return None\n    soup = BeautifulSoup(endpoint_page)\n    endpoints = []\n    for web_link in soup.find_all('a'):\n        endpoints.append(web_link.get('href'))\n    return endpoints\n\n\ndef taverna_parser(link):\n    \"\"\"\n    Takes a link to a list of endpoints and parses the taverna WSDL links.\n\n    Takes a url to a page containing a list of endpoints, then passes that url\n    to endpoint_parser(). Upon receiving the resulting list from the parser\n    taverna_parser() goes through the list and finds all the WSDL links for\n    the taverna web-service. It then returns a list containing the filtered\n    links.\n\n    Parameters\n    ----------\n    link: str\n        A url to a page containing links to WSDL files.\n\n    Returns\n    -------\n    taverna_links: list or NoneType\n        A list containing WSDL links for a taverna web-service\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.taverna_parser('http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService')\n    ['http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioTavernaService?wsdl']\n    \"\"\"\n    endpoints = endpoint_parser(link)\n    taverna_links = []\n    if endpoints is None:\n        return None\n    for web_link in endpoints:\n        if 'Taverna' in web_link:\n            taverna_links.append(web_link)\n    if len(taverna_links) == 0:\n        return None\n    return taverna_links\n\n\ndef link_test(link):\n    \"\"\"\n    Just a quick function to test a link.\n\n    Quickly checks to see if the URL is a valid link; if it is it returns the\n    downloaded contents of that page.\n\n    Parameters\n    ----------\n    link: str\n        A string containing a URL\n\n    Returns\n    -------\n    webpage: str or NoneType\n        String containing the webresults\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.link_test('http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService')\n    u'<html>\\n<head>...</body>\\n</html>\\n'\n\n    >>> print parser.link_test('http://rrnx.invalid_url5523.com')\n    None\n    \"\"\"\n    try:\n        with closing(urlopen(link)) as fd:\n            return fd.read()\n    except (ValueError, URLError):\n        return None\n\n\ndef wsdl_retriever(service='HEC'):\n    \"\"\"\n    Retrieves a link to a taverna WSDL file\n\n    This is essentially the master method, from it all the other functions get\n    called and it essentially knits everything together. It gets a list of\n    service links via webservice_parser(), then filters the results via\n    taverna_parser(). Finally it tests all the returned taverna WSDL links\n    and returns the first live taverna endpoint.\n\n    Parameters\n    ----------\n    service: str\n        Indicates which particular HELIO service is used. Defaults to HEC.\n\n    Returns\n    -------\n    wsdl: str\n        URL to a single live taverna endpoint\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.wsdl_retriever()\n    'http://msslkz.mssl.ucl.ac.uk:80/helio_hec/HelioTavernaService?wsdl'\n\n    Notes\n    -----\n    * Currently only support for HEC exists, but it was designed so that it\n        could be expanded at a later date\n    * There is a 3 second timeout lifespan on links, so there is potential for\n        this function to take a while to return. Timeout duration can be\n        controlled through the LINK_TIMEOUT value\n    \"\"\"\n    service_links = webservice_parser(service=service)\n    wsdl = None\n    wsdl_links = None\n    if service_links is None:\n        return None\n    for link in service_links:\n        wsdl_links = taverna_parser(link)\n    if wsdl_links is None:\n        return None\n    for end_point in wsdl_links:\n        if end_point is not None and link_test(end_point) is not None:\n            wsdl = end_point\n            break\n    return wsdl\n", "path": "sunpy/net/helio/parser.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# Author:   Michael Malocha <mjm159@humboldt.edu>\n# Last Edit:  September 22nd, 2013\n#\n# This module was developed with funding from the GSOC 2013 summer of code\n#\n\n\"\"\"\nThis module is meant to parse the HELIO registry and return WSDL endpoints to\nfacilitate the interfacing between further modules and HELIO.\n\"\"\"\nfrom __future__ import absolute_import\nfrom urllib2 import urlopen, URLError\n#import sunpy.util.etree as EL\nimport xml.etree.ElementTree as EL\nfrom sunpy.net.helio import registry_links as RL\nfrom bs4 import BeautifulSoup\nfrom contextlib import closing\n\n__author__ = 'Michael Malocha'\n__version__ = 'September 22nd, 2013'\n\n# Lifespan in seconds before a link times-out\nLINK_TIMEOUT = 3\n\n\ndef webservice_parser(service='HEC'):\n    \"\"\"\n    Quickly parses important contents from HELIO registry.\n\n    Uses the link contained in registry_links in with 'service' appended\n    and scrapes the web-service links contained on that webpage.\n\n    Parameters\n    ----------\n    service: str\n        Indicates which particular HELIO service is used. Defaults to HEC.\n\n    Returns\n    -------\n    links: list or NoneType\n        List of urls to registries containing WSDL endpoints.\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.webservice_parser()\n    ['http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService',\n    'http://festung3.oats.inaf.it:8080/helio-hec/HelioService',\n    'http://festung1.oats.inaf.it:8080/helio-hec/HelioService',\n    'http://hec.helio-vo.eu/helio_hec/HelioService',\n    'http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioLongQueryService',\n    'http://festung3.oats.inaf.it:8080/helio-hec/HelioLongQueryService',\n    'http://festung1.oats.inaf.it:8080/helio-hec/HelioLongQueryService',\n    'http://hec.helio-vo.eu/helio_hec/HelioLongQueryService']\n    \"\"\"\n    link = RL.LINK + '/' + service.lower()\n    xml = link_test(link)\n    if xml is None:\n        return xml\n    root = EL.fromstring(xml)\n    links = []\n\n    #WARNING: getiterator is deprecated in Python 2.7+\n    #Fix for 3.x support\n    for interface in root.getiterator('interface'):\n        service_type = interface.attrib\n        key = service_type.keys()\n        if len(key) > 0:\n            value = service_type[key[0]]\n            if value == 'vr:WebService':\n                for url in interface.getiterator('accessURL'):\n                    if url.text not in links:\n                        links.append(url.text)\n    return links\n\n\ndef endpoint_parser(link):\n    \"\"\"\n    Takes a link to a list of endpoints and parses the WSDL links.\n\n    Feeding 1 result from webservice_parser() into endpoint_parser() at a time\n    will return a list of WSDL endpoints that are contained on the page from\n    that link that was passed in.\n\n    Parameters\n    ----------\n    link: str\n        A url to a page containing links to WSDL files.\n\n    Returns\n    -------\n    endpoints: list or NoneType\n        A list containing all of the available WSDL endpoints from the passed\n        in url.\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.endpoint_parser('http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService')\n    ['http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioService?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioService1_0?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioService1_0b?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService1_0?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService1_1?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioLongQueryService1_0b?wsdl',\n    'http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioTavernaService?wsdl']\n    \"\"\"\n    endpoint_page = link_test(link)\n    if endpoint_page is None:\n        return None\n    soup = BeautifulSoup(endpoint_page)\n    endpoints = []\n    for web_link in soup.find_all('a'):\n        endpoints.append(web_link.get('href'))\n    return endpoints\n\n\ndef taverna_parser(link):\n    \"\"\"\n    Takes a link to a list of endpoints and parses the taverna WSDL links.\n\n    Takes a url to a page containing a list of endpoints, then passes that url\n    to endpoint_parser(). Upon receiving the resulting list from the parser\n    taverna_parser() goes through the list and finds all the WSDL links for\n    the taverna web-service. It then returns a list containing the filtered\n    links.\n\n    Parameters\n    ----------\n    link: str\n        A url to a page containing links to WSDL files.\n\n    Returns\n    -------\n    taverna_links: list or NoneType\n        A list containing WSDL links for a taverna web-service\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.taverna_parser('http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService')\n    ['http://msslkz.mssl.ucl.ac.uk:80/helio-hec/HelioTavernaService?wsdl']\n    \"\"\"\n    endpoints = endpoint_parser(link)\n    taverna_links = []\n    if endpoints is None:\n        return None\n    for web_link in endpoints:\n        if 'Taverna' in web_link:\n            taverna_links.append(web_link)\n    if len(taverna_links) == 0:\n        return None\n    return taverna_links\n\n\ndef link_test(link):\n    \"\"\"\n    Just a quick function to test a link.\n\n    Quickly checks to see if the URL is a valid link; if it is it returns the\n    downloaded contents of that page.\n\n    Parameters\n    ----------\n    link: str\n        A string containing a URL\n\n    Returns\n    -------\n    webpage: str or NoneType\n        String containing the webresults\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.link_test('http://msslkz.mssl.ucl.ac.uk/helio-hec/HelioService')\n    u'<html>\\n<head>...</body>\\n</html>\\n'\n\n    >>> print parser.link_test('http://rrnx.invalid_url5523.com')\n    None\n    \"\"\"\n    try:\n        with closing(urlopen(link, timeout=LINK_TIMEOUT)) as fd:\n            return fd.read()\n    except (ValueError, URLError):\n        return None\n\n\ndef wsdl_retriever(service='HEC'):\n    \"\"\"\n    Retrieves a link to a taverna WSDL file\n\n    This is essentially the master method, from it all the other functions get\n    called and it essentially knits everything together. It gets a list of\n    service links via webservice_parser(), then filters the results via\n    taverna_parser(). Finally it tests all the returned taverna WSDL links\n    and returns the first live taverna endpoint.\n\n    Parameters\n    ----------\n    service: str\n        Indicates which particular HELIO service is used. Defaults to HEC.\n\n    Returns\n    -------\n    wsdl: str\n        URL to a single live taverna endpoint\n\n    Examples\n    --------\n    >>> from sunpy.net.helio import parser\n    >>> parser.wsdl_retriever()\n    'http://msslkz.mssl.ucl.ac.uk:80/helio_hec/HelioTavernaService?wsdl'\n\n    Notes\n    -----\n    * Currently only support for HEC exists, but it was designed so that it\n        could be expanded at a later date\n    * There is a 3 second timeout lifespan on links, so there is potential for\n        this function to take a while to return. Timeout duration can be\n        controlled through the LINK_TIMEOUT value\n    \"\"\"\n    service_links = webservice_parser(service=service)\n    wsdl = None\n    wsdl_links = None\n    if service_links is None:\n        return None\n    for link in service_links:\n        wsdl_links = taverna_parser(link)\n    if wsdl_links is None:\n        return None\n    for end_point in wsdl_links:\n        if end_point is not None and link_test(end_point) is not None:\n            wsdl = end_point\n            break\n    return wsdl\n", "path": "sunpy/net/helio/parser.py"}]}