We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Download of sample data is repeated for each server
Why do we have `sunpy.data.download_sample_data()` download all of the sample data files twice, once for each of the two servers (data.sunpy.org and hesperia.gsfc.nasa.gov)?  This seems silly.

Lines 60–61 in `sunpy/data/_sample.py`:

``` python
    for base_url in _base_urls:
        for file_name in _files.itervalues():
```

Output:

```
>>> import sunpy.data
>>> sunpy.data.download_sample_data()
Downloading sample files to c:/Users/Albert\sunpy\data/sample_data
Downloading http://data.sunpy.org/sample-data/BIR_20110922_103000_01.fit
|===========================================| 760k/760k (100.00%)         4s
Downloading http://data.sunpy.org/sample-data/swap_lv1_20120101_001607.fits
|===========================================| 2.1M/2.1M (100.00%)         4s
Downloading http://data.sunpy.org/sample-data/eit_l1_20020625_100011.fits
|===========================================| 8.3M/8.3M (100.00%)        10s
Downloading http://data.sunpy.org/sample-data/aia.lev1.193A_2013-09-21T16_00_06.84Z.image_
lev1.fits.zip
|===========================================|  12M/ 12M (100.00%)        22s
Unpacking: aia.lev1.193A_2013-09-21T16_00_06.84Z.image_lev1.fits
Downloading http://data.sunpy.org/sample-data/hsi_calib_ev_20020220_1106_20020220_1106_25_
40.fits
|===========================================| 207k/207k (100.00%)         0s
Downloading http://data.sunpy.org/sample-data/AIA20110319_105400_0171.fits
|===========================================| 4.2M/4.2M (100.00%)         6s
Downloading http://data.sunpy.org/sample-data/hsi_image_20101016_191218.fits
|===========================================|  95k/ 95k (100.00%)         0s
Downloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/BIR_20110922_103000_
01.fit
|===========================================| 760k/760k (100.00%)         0s
Downloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/swap_lv1_20120101_00
1607.fits
|===========================================| 2.1M/2.1M (100.00%)         2s
Downloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/eit_l1_20020625_1000
11.fits
|===========================================| 8.3M/8.3M (100.00%)         6s
Downloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/aia.lev1.193A_2013-0
9-21T16_00_06.84Z.image_lev1.fits.zip
|===========================================|  12M/ 12M (100.00%)        10s
Unpacking: aia.lev1.193A_2013-09-21T16_00_06.84Z.image_lev1.fits
Downloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/hsi_calib_ev_2002022
0_1106_20020220_1106_25_40.fits
|===========================================| 207k/207k (100.00%)         0s
Downloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/AIA20110319_105400_0
171.fits
|===========================================| 4.2M/4.2M (100.00%)         3s
Downloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/hsi_image_20101016_1
91218.fits
|===========================================|  95k/ 95k (100.00%)         0s
```


--- 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/data/_sample.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 """SunPy sample data files"""
3 from __future__ import absolute_import
4 
5 from os import remove
6 import os.path
7 from zipfile import ZipFile
8 from urllib2 import URLError
9 from shutil import move
10 
11 from astropy.utils.data import download_file
12 
13 from sunpy.util.net import url_exists
14 from sunpy import config
15 
16 __author__ = "Steven Christe"
17 __email__ = "steven.christe@nasa.gov"
18 
19 
20 sampledata_dir = config.get("downloads", "sample_dir")
21 
22 # urls to search for the sample data
23 _base_urls = (
24     'http://data.sunpy.org/sample-data/',
25     'http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/')
26 
27 # keys are file shortcuts
28 # values consist of filename as well as optional file extension if files are
29 # hosted compressed. This extension is removed after download.
30 _files = {
31     "AIA_171_IMAGE": ("AIA20110319_105400_0171.fits", ""),
32     "RHESSI_IMAGE": ("hsi_image_20101016_191218.fits", ""),
33     "EIT_195_IMAGE": ("eit_l1_20020625_100011.fits", ""),
34     "CALLISTO_IMAGE": ("BIR_20110922_103000_01.fit", ""),
35     "RHESSI_EVENT_LIST": ("hsi_calib_ev_20020220_1106_20020220_1106_25_40.fits", ""),
36     "SWAP_LEVEL1_IMAGE": ("swap_lv1_20120101_001607.fits", ""),
37     "AIA_193_IMAGE": ("aia.lev1.193A_2013-09-21T16_00_06.84Z.image_lev1.fits", ".zip")
38 }
39 
40 sample_files = {}
41 for key in _files:
42     sample_files[key] = os.path.abspath(os.path.join(sampledata_dir, _files[key][0]))
43 
44 
45 def download_sample_data(progress=True):
46     """
47     Download the sample data.
48 
49     Parameters
50     ----------
51     progress: bool
52         Show a progress bar during download
53 
54     Returns
55     -------
56     None
57     """
58     number_of_files_fetched = 0
59     print("Downloading sample files to " + sampledata_dir)
60     for base_url in _base_urls:
61         for file_name in _files.itervalues():
62             full_file_name = file_name[0] + file_name[1]
63             if url_exists(os.path.join(base_url, full_file_name)):
64                 f = download_file(os.path.join(base_url, full_file_name))
65                 real_name, ext = os.path.splitext(full_file_name)
66 
67                 if file_name[1] == '.zip':
68                     print("Unpacking: %s" % real_name)
69                     with ZipFile(f, 'r') as zip_file:
70                         zip_file.extract(real_name, sampledata_dir)
71                     remove(f)
72                 else:
73                     # move files to the data directory
74                     move(f, os.path.join(sampledata_dir, file_name[0]))
75                 # increment the number of files obtained to check later
76                 number_of_files_fetched += 1
77 
78     if number_of_files_fetched < len(_files.keys()):
79         raise URLError("Could not download all samples files. Problem with accessing sample data servers.")
80
```
--- 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/data/_sample.py b/sunpy/data/_sample.py
--- a/sunpy/data/_sample.py
+++ b/sunpy/data/_sample.py
@@ -57,8 +57,8 @@
     """
     number_of_files_fetched = 0
     print("Downloading sample files to " + sampledata_dir)
-    for base_url in _base_urls:
-        for file_name in _files.itervalues():
+    for file_name in _files.itervalues():
+        for base_url in _base_urls:
             full_file_name = file_name[0] + file_name[1]
             if url_exists(os.path.join(base_url, full_file_name)):
                 f = download_file(os.path.join(base_url, full_file_name))
@@ -74,6 +74,7 @@
                     move(f, os.path.join(sampledata_dir, file_name[0]))
                 # increment the number of files obtained to check later
                 number_of_files_fetched += 1
+                break
 
     if number_of_files_fetched < len(_files.keys()):
         raise URLError("Could not download all samples files. Problem with accessing sample data servers.")

{"golden_diff": "diff --git a/sunpy/data/_sample.py b/sunpy/data/_sample.py\n--- a/sunpy/data/_sample.py\n+++ b/sunpy/data/_sample.py\n@@ -57,8 +57,8 @@\n     \"\"\"\n     number_of_files_fetched = 0\n     print(\"Downloading sample files to \" + sampledata_dir)\n-    for base_url in _base_urls:\n-        for file_name in _files.itervalues():\n+    for file_name in _files.itervalues():\n+        for base_url in _base_urls:\n             full_file_name = file_name[0] + file_name[1]\n             if url_exists(os.path.join(base_url, full_file_name)):\n                 f = download_file(os.path.join(base_url, full_file_name))\n@@ -74,6 +74,7 @@\n                     move(f, os.path.join(sampledata_dir, file_name[0]))\n                 # increment the number of files obtained to check later\n                 number_of_files_fetched += 1\n+                break\n \n     if number_of_files_fetched < len(_files.keys()):\n         raise URLError(\"Could not download all samples files. Problem with accessing sample data servers.\")\n", "issue": "Download of sample data is repeated for each server\nWhy do we have `sunpy.data.download_sample_data()` download all of the sample data files twice, once for each of the two servers (data.sunpy.org and hesperia.gsfc.nasa.gov)?  This seems silly.\n\nLines 60\u201361 in `sunpy/data/_sample.py`:\n\n``` python\n    for base_url in _base_urls:\n        for file_name in _files.itervalues():\n```\n\nOutput:\n\n```\n>>> import sunpy.data\n>>> sunpy.data.download_sample_data()\nDownloading sample files to c:/Users/Albert\\sunpy\\data/sample_data\nDownloading http://data.sunpy.org/sample-data/BIR_20110922_103000_01.fit\n|===========================================| 760k/760k (100.00%)         4s\nDownloading http://data.sunpy.org/sample-data/swap_lv1_20120101_001607.fits\n|===========================================| 2.1M/2.1M (100.00%)         4s\nDownloading http://data.sunpy.org/sample-data/eit_l1_20020625_100011.fits\n|===========================================| 8.3M/8.3M (100.00%)        10s\nDownloading http://data.sunpy.org/sample-data/aia.lev1.193A_2013-09-21T16_00_06.84Z.image_\nlev1.fits.zip\n|===========================================|  12M/ 12M (100.00%)        22s\nUnpacking: aia.lev1.193A_2013-09-21T16_00_06.84Z.image_lev1.fits\nDownloading http://data.sunpy.org/sample-data/hsi_calib_ev_20020220_1106_20020220_1106_25_\n40.fits\n|===========================================| 207k/207k (100.00%)         0s\nDownloading http://data.sunpy.org/sample-data/AIA20110319_105400_0171.fits\n|===========================================| 4.2M/4.2M (100.00%)         6s\nDownloading http://data.sunpy.org/sample-data/hsi_image_20101016_191218.fits\n|===========================================|  95k/ 95k (100.00%)         0s\nDownloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/BIR_20110922_103000_\n01.fit\n|===========================================| 760k/760k (100.00%)         0s\nDownloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/swap_lv1_20120101_00\n1607.fits\n|===========================================| 2.1M/2.1M (100.00%)         2s\nDownloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/eit_l1_20020625_1000\n11.fits\n|===========================================| 8.3M/8.3M (100.00%)         6s\nDownloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/aia.lev1.193A_2013-0\n9-21T16_00_06.84Z.image_lev1.fits.zip\n|===========================================|  12M/ 12M (100.00%)        10s\nUnpacking: aia.lev1.193A_2013-09-21T16_00_06.84Z.image_lev1.fits\nDownloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/hsi_calib_ev_2002022\n0_1106_20020220_1106_25_40.fits\n|===========================================| 207k/207k (100.00%)         0s\nDownloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/AIA20110319_105400_0\n171.fits\n|===========================================| 4.2M/4.2M (100.00%)         3s\nDownloading http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/hsi_image_20101016_1\n91218.fits\n|===========================================|  95k/ 95k (100.00%)         0s\n```\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"SunPy sample data files\"\"\"\nfrom __future__ import absolute_import\n\nfrom os import remove\nimport os.path\nfrom zipfile import ZipFile\nfrom urllib2 import URLError\nfrom shutil import move\n\nfrom astropy.utils.data import download_file\n\nfrom sunpy.util.net import url_exists\nfrom sunpy import config\n\n__author__ = \"Steven Christe\"\n__email__ = \"steven.christe@nasa.gov\"\n\n\nsampledata_dir = config.get(\"downloads\", \"sample_dir\")\n\n# urls to search for the sample data\n_base_urls = (\n    'http://data.sunpy.org/sample-data/',\n    'http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/')\n\n# keys are file shortcuts\n# values consist of filename as well as optional file extension if files are\n# hosted compressed. This extension is removed after download.\n_files = {\n    \"AIA_171_IMAGE\": (\"AIA20110319_105400_0171.fits\", \"\"),\n    \"RHESSI_IMAGE\": (\"hsi_image_20101016_191218.fits\", \"\"),\n    \"EIT_195_IMAGE\": (\"eit_l1_20020625_100011.fits\", \"\"),\n    \"CALLISTO_IMAGE\": (\"BIR_20110922_103000_01.fit\", \"\"),\n    \"RHESSI_EVENT_LIST\": (\"hsi_calib_ev_20020220_1106_20020220_1106_25_40.fits\", \"\"),\n    \"SWAP_LEVEL1_IMAGE\": (\"swap_lv1_20120101_001607.fits\", \"\"),\n    \"AIA_193_IMAGE\": (\"aia.lev1.193A_2013-09-21T16_00_06.84Z.image_lev1.fits\", \".zip\")\n}\n\nsample_files = {}\nfor key in _files:\n    sample_files[key] = os.path.abspath(os.path.join(sampledata_dir, _files[key][0]))\n\n\ndef download_sample_data(progress=True):\n    \"\"\"\n    Download the sample data.\n\n    Parameters\n    ----------\n    progress: bool\n        Show a progress bar during download\n\n    Returns\n    -------\n    None\n    \"\"\"\n    number_of_files_fetched = 0\n    print(\"Downloading sample files to \" + sampledata_dir)\n    for base_url in _base_urls:\n        for file_name in _files.itervalues():\n            full_file_name = file_name[0] + file_name[1]\n            if url_exists(os.path.join(base_url, full_file_name)):\n                f = download_file(os.path.join(base_url, full_file_name))\n                real_name, ext = os.path.splitext(full_file_name)\n\n                if file_name[1] == '.zip':\n                    print(\"Unpacking: %s\" % real_name)\n                    with ZipFile(f, 'r') as zip_file:\n                        zip_file.extract(real_name, sampledata_dir)\n                    remove(f)\n                else:\n                    # move files to the data directory\n                    move(f, os.path.join(sampledata_dir, file_name[0]))\n                # increment the number of files obtained to check later\n                number_of_files_fetched += 1\n\n    if number_of_files_fetched < len(_files.keys()):\n        raise URLError(\"Could not download all samples files. Problem with accessing sample data servers.\")\n", "path": "sunpy/data/_sample.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"SunPy sample data files\"\"\"\nfrom __future__ import absolute_import\n\nfrom os import remove\nimport os.path\nfrom zipfile import ZipFile\nfrom urllib2 import URLError\nfrom shutil import move\n\nfrom astropy.utils.data import download_file\n\nfrom sunpy.util.net import url_exists\nfrom sunpy import config\n\n__author__ = \"Steven Christe\"\n__email__ = \"steven.christe@nasa.gov\"\n\n\nsampledata_dir = config.get(\"downloads\", \"sample_dir\")\n\n# urls to search for the sample data\n_base_urls = (\n    'http://data.sunpy.org/sample-data/',\n    'http://hesperia.gsfc.nasa.gov/~schriste/sunpy-sample-data/')\n\n# keys are file shortcuts\n# values consist of filename as well as optional file extension if files are\n# hosted compressed. This extension is removed after download.\n_files = {\n    \"AIA_171_IMAGE\": (\"AIA20110319_105400_0171.fits\", \"\"),\n    \"RHESSI_IMAGE\": (\"hsi_image_20101016_191218.fits\", \"\"),\n    \"EIT_195_IMAGE\": (\"eit_l1_20020625_100011.fits\", \"\"),\n    \"CALLISTO_IMAGE\": (\"BIR_20110922_103000_01.fit\", \"\"),\n    \"RHESSI_EVENT_LIST\": (\"hsi_calib_ev_20020220_1106_20020220_1106_25_40.fits\", \"\"),\n    \"SWAP_LEVEL1_IMAGE\": (\"swap_lv1_20120101_001607.fits\", \"\"),\n    \"AIA_193_IMAGE\": (\"aia.lev1.193A_2013-09-21T16_00_06.84Z.image_lev1.fits\", \".zip\")\n}\n\nsample_files = {}\nfor key in _files:\n    sample_files[key] = os.path.abspath(os.path.join(sampledata_dir, _files[key][0]))\n\n\ndef download_sample_data(progress=True):\n    \"\"\"\n    Download the sample data.\n\n    Parameters\n    ----------\n    progress: bool\n        Show a progress bar during download\n\n    Returns\n    -------\n    None\n    \"\"\"\n    number_of_files_fetched = 0\n    print(\"Downloading sample files to \" + sampledata_dir)\n    for file_name in _files.itervalues():\n        for base_url in _base_urls:\n            full_file_name = file_name[0] + file_name[1]\n            if url_exists(os.path.join(base_url, full_file_name)):\n                f = download_file(os.path.join(base_url, full_file_name))\n                real_name, ext = os.path.splitext(full_file_name)\n\n                if file_name[1] == '.zip':\n                    print(\"Unpacking: %s\" % real_name)\n                    with ZipFile(f, 'r') as zip_file:\n                        zip_file.extract(real_name, sampledata_dir)\n                    remove(f)\n                else:\n                    # move files to the data directory\n                    move(f, os.path.join(sampledata_dir, file_name[0]))\n                # increment the number of files obtained to check later\n                number_of_files_fetched += 1\n                break\n\n    if number_of_files_fetched < len(_files.keys()):\n        raise URLError(\"Could not download all samples files. Problem with accessing sample data servers.\")\n", "path": "sunpy/data/_sample.py"}]}