We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Update FIA links
It's that time of year again where FIA puts out a new release and moves things around. See https://github.com/weecology/retriever/issues/865#issuecomment-325588307

We need to track down the most recent links and update the script.

Thanks to @nestorperez for reporting this.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `scripts/forest_inventory_analysis.py`
Content:
```
1 #retriever
2 """Retriever script for Forest Inventory and Analysis
3 
4 """
5 from __future__ import print_function
6 from future import standard_library
7 standard_library.install_aliases()
8 
9 import os
10 
11 from retriever.lib.templates import Script
12 from retriever.lib.models import Table
13 from retriever import open_fr, open_fw, VERSION
14 from pkg_resources import parse_version
15 
16 
17 class main(Script):
18     def __init__(self, **kwargs):
19         Script.__init__(self, **kwargs)
20         self.title = "Forest Inventory and Analysis"
21         self.name = "forest-inventory-analysis"
22         self.retriever_minimum_version = '2.0.dev'
23         self.version = '1.4.0'
24         self.ref = "http://fia.fs.fed.us/"
25         self.urls = {"main": "https://apps.fs.usda.gov/fiadb-downloads/CSV/",
26                      'species': 'https://apps.fs.usda.gov/fiadb-downloads/CSV/REF_SPECIES.csv'}
27         self.keywords = ["plants", "continental-scale", "observational"]
28         self.citation = "DATEOFDOWNLOAD. Forest Inventory and Analysis Database, St. Paul, MN: U.S. Department of Agriculture, Forest Service, Northern Research Station. [Available only on internet: http://apps.fs.fed.us/fiadb-downloads/datamart.html]"
29         self.description = """WARNING: This dataset requires downloading many large files and will probably take several hours to finish installing."""
30         self.addendum = """This dataset requires downloading many large files - please be patient."""
31         
32         if parse_version(VERSION) <= parse_version("2.0.0"):
33             self.shortname = self.name
34             self.name = self.title
35             self.tags = self.keywords
36 
37     def download(self, engine=None, debug=False):
38         Script.download(self, engine, debug)
39         engine = self.engine
40 
41         # download and create species table
42         table = Table('species')
43         self.engine.auto_create_table(table, url=self.urls['species'])
44         self.engine.insert_data_from_url(self.urls['species'])
45 
46         # State abbreviations with the year annual inventory began for that state
47         stateslist = [('AL', 2001), ('AK', 2004), ('AZ', 2001), ('AR', 2000),
48                       ('CA', 2001), ('CO', 2002), ('CT', 2003), ('DE', 2004),
49                       ('FL', 2003), ('GA', 1998), ('ID', 2004), ('IL', 2001),
50                       ('IN', 1999), ('IA', 1999), ('KS', 2001), ('KY', 1999),
51                       ('LA', 2001), ('ME', 1999), ('MD', 2004), ('MA', 2003),
52                       ('MI', 2000), ('MN', 1999), ('MO', 1999), ('MS', 2006),
53                       ('MT', 2003), ('NE', 2001), ('NV', 2004), ('NH', 2002),
54                       ('NJ', 2004), ('NM', 1999), ('NY', 2002), ('NC', 2003),
55                       ('ND', 2001), ('OH', 2001), ('OK', 2008), ('OR', 2001),
56                       ('PA', 2000), ('RI', 2003), ('SC', 1999), ('SD', 2001),
57                       ('TN', 2000), ('TX', 2001), ('UT', 2000), ('VT', 2003),
58                       ('VA', 1998), ('WA', 2002), ('WV', 2004), ('WI', 2000),
59                       ('WY', 2000), ('PR', 2001)]
60 
61         tablelist = ["SURVEY", "PLOT", "COND", "SUBPLOT", "SUBP_COND", "TREE", "SEEDLING"]
62 
63         for table in tablelist:
64             for state, year in stateslist:
65                 engine.download_files_from_archive(self.urls["main"] + state + "_" + table + ".ZIP",
66                                                    [state + "_" + table + ".csv"])
67 
68         for table in tablelist:
69             print("Scanning data for table %s..." % table)
70             prep_file_name = "%s.csv" % table
71             prep_file = open_fw(engine.format_filename(prep_file_name))
72             this_file = open_fr(engine.format_filename(stateslist[0][0] + "_" + table + ".csv"))
73             col_names = this_file.readline()
74             prep_file.write(col_names)
75             column_names = [col.strip('"') for col in col_names.split(',')]
76             year_column = column_names.index("INVYR")
77             this_file.close()
78 
79             for state, year in stateslist:
80                 this_file = open_fr(engine.format_filename(state + "_" + table + ".csv"))
81                 this_file.readline()
82                 for line in this_file:
83                     values = line.split(',')
84                     this_year = values[year_column]
85                     if int(this_year) >= year:
86                         prep_file.write(line)
87             prep_file.close()
88             engine.auto_create_table(Table(table), filename=prep_file_name)
89 
90             engine.insert_data_from_file(engine.format_filename(prep_file_name))
91 
92             try:
93                 os.remove(engine.format_filename(prep_file_name))
94             except:
95                 pass
96 
97         return engine
98 
99 
100 SCRIPT = main()
101
```
--- 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/scripts/forest_inventory_analysis.py b/scripts/forest_inventory_analysis.py
--- a/scripts/forest_inventory_analysis.py
+++ b/scripts/forest_inventory_analysis.py
@@ -20,10 +20,10 @@
         self.title = "Forest Inventory and Analysis"
         self.name = "forest-inventory-analysis"
         self.retriever_minimum_version = '2.0.dev'
-        self.version = '1.4.0'
+        self.version = '1.4.1'
         self.ref = "http://fia.fs.fed.us/"
-        self.urls = {"main": "https://apps.fs.usda.gov/fiadb-downloads/CSV/",
-                     'species': 'https://apps.fs.usda.gov/fiadb-downloads/CSV/REF_SPECIES.csv'}
+        self.urls = {"main": "https://apps.fs.usda.gov/fia/datamart/CSV/",
+                     'species': 'https://apps.fs.usda.gov/fia/datamart/CSV/REF_SPECIES.csv'}
         self.keywords = ["plants", "continental-scale", "observational"]
         self.citation = "DATEOFDOWNLOAD. Forest Inventory and Analysis Database, St. Paul, MN: U.S. Department of Agriculture, Forest Service, Northern Research Station. [Available only on internet: http://apps.fs.fed.us/fiadb-downloads/datamart.html]"
         self.description = """WARNING: This dataset requires downloading many large files and will probably take several hours to finish installing."""

{"golden_diff": "diff --git a/scripts/forest_inventory_analysis.py b/scripts/forest_inventory_analysis.py\n--- a/scripts/forest_inventory_analysis.py\n+++ b/scripts/forest_inventory_analysis.py\n@@ -20,10 +20,10 @@\n         self.title = \"Forest Inventory and Analysis\"\n         self.name = \"forest-inventory-analysis\"\n         self.retriever_minimum_version = '2.0.dev'\n-        self.version = '1.4.0'\n+        self.version = '1.4.1'\n         self.ref = \"http://fia.fs.fed.us/\"\n-        self.urls = {\"main\": \"https://apps.fs.usda.gov/fiadb-downloads/CSV/\",\n-                     'species': 'https://apps.fs.usda.gov/fiadb-downloads/CSV/REF_SPECIES.csv'}\n+        self.urls = {\"main\": \"https://apps.fs.usda.gov/fia/datamart/CSV/\",\n+                     'species': 'https://apps.fs.usda.gov/fia/datamart/CSV/REF_SPECIES.csv'}\n         self.keywords = [\"plants\", \"continental-scale\", \"observational\"]\n         self.citation = \"DATEOFDOWNLOAD. Forest Inventory and Analysis Database, St. Paul, MN: U.S. Department of Agriculture, Forest Service, Northern Research Station. [Available only on internet: http://apps.fs.fed.us/fiadb-downloads/datamart.html]\"\n         self.description = \"\"\"WARNING: This dataset requires downloading many large files and will probably take several hours to finish installing.\"\"\"\n", "issue": "Update FIA links\nIt's that time of year again where FIA puts out a new release and moves things around. See https://github.com/weecology/retriever/issues/865#issuecomment-325588307\r\n\r\nWe need to track down the most recent links and update the script.\r\n\r\nThanks to @nestorperez for reporting this.\n", "before_files": [{"content": "#retriever\n\"\"\"Retriever script for Forest Inventory and Analysis\n\n\"\"\"\nfrom __future__ import print_function\nfrom future import standard_library\nstandard_library.install_aliases()\n\nimport os\n\nfrom retriever.lib.templates import Script\nfrom retriever.lib.models import Table\nfrom retriever import open_fr, open_fw, VERSION\nfrom pkg_resources import parse_version\n\n\nclass main(Script):\n    def __init__(self, **kwargs):\n        Script.__init__(self, **kwargs)\n        self.title = \"Forest Inventory and Analysis\"\n        self.name = \"forest-inventory-analysis\"\n        self.retriever_minimum_version = '2.0.dev'\n        self.version = '1.4.0'\n        self.ref = \"http://fia.fs.fed.us/\"\n        self.urls = {\"main\": \"https://apps.fs.usda.gov/fiadb-downloads/CSV/\",\n                     'species': 'https://apps.fs.usda.gov/fiadb-downloads/CSV/REF_SPECIES.csv'}\n        self.keywords = [\"plants\", \"continental-scale\", \"observational\"]\n        self.citation = \"DATEOFDOWNLOAD. Forest Inventory and Analysis Database, St. Paul, MN: U.S. Department of Agriculture, Forest Service, Northern Research Station. [Available only on internet: http://apps.fs.fed.us/fiadb-downloads/datamart.html]\"\n        self.description = \"\"\"WARNING: This dataset requires downloading many large files and will probably take several hours to finish installing.\"\"\"\n        self.addendum = \"\"\"This dataset requires downloading many large files - please be patient.\"\"\"\n        \n        if parse_version(VERSION) <= parse_version(\"2.0.0\"):\n            self.shortname = self.name\n            self.name = self.title\n            self.tags = self.keywords\n\n    def download(self, engine=None, debug=False):\n        Script.download(self, engine, debug)\n        engine = self.engine\n\n        # download and create species table\n        table = Table('species')\n        self.engine.auto_create_table(table, url=self.urls['species'])\n        self.engine.insert_data_from_url(self.urls['species'])\n\n        # State abbreviations with the year annual inventory began for that state\n        stateslist = [('AL', 2001), ('AK', 2004), ('AZ', 2001), ('AR', 2000),\n                      ('CA', 2001), ('CO', 2002), ('CT', 2003), ('DE', 2004),\n                      ('FL', 2003), ('GA', 1998), ('ID', 2004), ('IL', 2001),\n                      ('IN', 1999), ('IA', 1999), ('KS', 2001), ('KY', 1999),\n                      ('LA', 2001), ('ME', 1999), ('MD', 2004), ('MA', 2003),\n                      ('MI', 2000), ('MN', 1999), ('MO', 1999), ('MS', 2006),\n                      ('MT', 2003), ('NE', 2001), ('NV', 2004), ('NH', 2002),\n                      ('NJ', 2004), ('NM', 1999), ('NY', 2002), ('NC', 2003),\n                      ('ND', 2001), ('OH', 2001), ('OK', 2008), ('OR', 2001),\n                      ('PA', 2000), ('RI', 2003), ('SC', 1999), ('SD', 2001),\n                      ('TN', 2000), ('TX', 2001), ('UT', 2000), ('VT', 2003),\n                      ('VA', 1998), ('WA', 2002), ('WV', 2004), ('WI', 2000),\n                      ('WY', 2000), ('PR', 2001)]\n\n        tablelist = [\"SURVEY\", \"PLOT\", \"COND\", \"SUBPLOT\", \"SUBP_COND\", \"TREE\", \"SEEDLING\"]\n\n        for table in tablelist:\n            for state, year in stateslist:\n                engine.download_files_from_archive(self.urls[\"main\"] + state + \"_\" + table + \".ZIP\",\n                                                   [state + \"_\" + table + \".csv\"])\n\n        for table in tablelist:\n            print(\"Scanning data for table %s...\" % table)\n            prep_file_name = \"%s.csv\" % table\n            prep_file = open_fw(engine.format_filename(prep_file_name))\n            this_file = open_fr(engine.format_filename(stateslist[0][0] + \"_\" + table + \".csv\"))\n            col_names = this_file.readline()\n            prep_file.write(col_names)\n            column_names = [col.strip('\"') for col in col_names.split(',')]\n            year_column = column_names.index(\"INVYR\")\n            this_file.close()\n\n            for state, year in stateslist:\n                this_file = open_fr(engine.format_filename(state + \"_\" + table + \".csv\"))\n                this_file.readline()\n                for line in this_file:\n                    values = line.split(',')\n                    this_year = values[year_column]\n                    if int(this_year) >= year:\n                        prep_file.write(line)\n            prep_file.close()\n            engine.auto_create_table(Table(table), filename=prep_file_name)\n\n            engine.insert_data_from_file(engine.format_filename(prep_file_name))\n\n            try:\n                os.remove(engine.format_filename(prep_file_name))\n            except:\n                pass\n\n        return engine\n\n\nSCRIPT = main()\n", "path": "scripts/forest_inventory_analysis.py"}], "after_files": [{"content": "#retriever\n\"\"\"Retriever script for Forest Inventory and Analysis\n\n\"\"\"\nfrom __future__ import print_function\nfrom future import standard_library\nstandard_library.install_aliases()\n\nimport os\n\nfrom retriever.lib.templates import Script\nfrom retriever.lib.models import Table\nfrom retriever import open_fr, open_fw, VERSION\nfrom pkg_resources import parse_version\n\n\nclass main(Script):\n    def __init__(self, **kwargs):\n        Script.__init__(self, **kwargs)\n        self.title = \"Forest Inventory and Analysis\"\n        self.name = \"forest-inventory-analysis\"\n        self.retriever_minimum_version = '2.0.dev'\n        self.version = '1.4.1'\n        self.ref = \"http://fia.fs.fed.us/\"\n        self.urls = {\"main\": \"https://apps.fs.usda.gov/fia/datamart/CSV/\",\n                     'species': 'https://apps.fs.usda.gov/fia/datamart/CSV/REF_SPECIES.csv'}\n        self.keywords = [\"plants\", \"continental-scale\", \"observational\"]\n        self.citation = \"DATEOFDOWNLOAD. Forest Inventory and Analysis Database, St. Paul, MN: U.S. Department of Agriculture, Forest Service, Northern Research Station. [Available only on internet: http://apps.fs.fed.us/fiadb-downloads/datamart.html]\"\n        self.description = \"\"\"WARNING: This dataset requires downloading many large files and will probably take several hours to finish installing.\"\"\"\n        self.addendum = \"\"\"This dataset requires downloading many large files - please be patient.\"\"\"\n        \n        if parse_version(VERSION) <= parse_version(\"2.0.0\"):\n            self.shortname = self.name\n            self.name = self.title\n            self.tags = self.keywords\n\n    def download(self, engine=None, debug=False):\n        Script.download(self, engine, debug)\n        engine = self.engine\n\n        # download and create species table\n        table = Table('species')\n        self.engine.auto_create_table(table, url=self.urls['species'])\n        self.engine.insert_data_from_url(self.urls['species'])\n\n        # State abbreviations with the year annual inventory began for that state\n        stateslist = [('AL', 2001), ('AK', 2004), ('AZ', 2001), ('AR', 2000),\n                      ('CA', 2001), ('CO', 2002), ('CT', 2003), ('DE', 2004),\n                      ('FL', 2003), ('GA', 1998), ('ID', 2004), ('IL', 2001),\n                      ('IN', 1999), ('IA', 1999), ('KS', 2001), ('KY', 1999),\n                      ('LA', 2001), ('ME', 1999), ('MD', 2004), ('MA', 2003),\n                      ('MI', 2000), ('MN', 1999), ('MO', 1999), ('MS', 2006),\n                      ('MT', 2003), ('NE', 2001), ('NV', 2004), ('NH', 2002),\n                      ('NJ', 2004), ('NM', 1999), ('NY', 2002), ('NC', 2003),\n                      ('ND', 2001), ('OH', 2001), ('OK', 2008), ('OR', 2001),\n                      ('PA', 2000), ('RI', 2003), ('SC', 1999), ('SD', 2001),\n                      ('TN', 2000), ('TX', 2001), ('UT', 2000), ('VT', 2003),\n                      ('VA', 1998), ('WA', 2002), ('WV', 2004), ('WI', 2000),\n                      ('WY', 2000), ('PR', 2001)]\n\n        tablelist = [\"SURVEY\", \"PLOT\", \"COND\", \"SUBPLOT\", \"SUBP_COND\", \"TREE\", \"SEEDLING\"]\n\n        for table in tablelist:\n            for state, year in stateslist:\n                engine.download_files_from_archive(self.urls[\"main\"] + state + \"_\" + table + \".ZIP\",\n                                                   [state + \"_\" + table + \".csv\"])\n\n        for table in tablelist:\n            print(\"Scanning data for table %s...\" % table)\n            prep_file_name = \"%s.csv\" % table\n            prep_file = open_fw(engine.format_filename(prep_file_name))\n            this_file = open_fr(engine.format_filename(stateslist[0][0] + \"_\" + table + \".csv\"))\n            col_names = this_file.readline()\n            prep_file.write(col_names)\n            column_names = [col.strip('\"') for col in col_names.split(',')]\n            year_column = column_names.index(\"INVYR\")\n            this_file.close()\n\n            for state, year in stateslist:\n                this_file = open_fr(engine.format_filename(state + \"_\" + table + \".csv\"))\n                this_file.readline()\n                for line in this_file:\n                    values = line.split(',')\n                    this_year = values[year_column]\n                    if int(this_year) >= year:\n                        prep_file.write(line)\n            prep_file.close()\n            engine.auto_create_table(Table(table), filename=prep_file_name)\n\n            engine.insert_data_from_file(engine.format_filename(prep_file_name))\n\n            try:\n                os.remove(engine.format_filename(prep_file_name))\n            except:\n                pass\n\n        return engine\n\n\nSCRIPT = main()\n", "path": "scripts/forest_inventory_analysis.py"}]}