prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Taiwan TW is offline
  Currently, Taiwan is grey and 24-hours-history is empty as well.
  
  - [The link ](http://data.taipower.com.tw/opendata01/apply/file/d006001/001.txt) in the [TW.py parser](https://github.com/tmrowco/electricitymap/blob/master/parsers/TW.py) seems to show data, though. 
  Maybe there have been some crucial changes?
  
  Some other TW related things that should be fixed:
  - The source link on the electricitymap website for Taiwan is not shown / shown as "?".
  ![image](https://user-images.githubusercontent.com/25743609/36668983-6d5ee628-1af3-11e8-91a0-db8cff5b6a64.png)
  
  - In general, the link in README.md will show 404 error and is leading nowhere. Seems like they updated/revised their website a bit?
  Here is the website with the 10-min-generation mix that should be linked in README.md:
  http://www.taipower.com.tw/tc/page.aspx?mid=206&cid=404&cchk=8ccc1918-8cae-4f40-a2d0-b43454f4f218
  
  ![image](https://user-images.githubusercontent.com/25743609/36669034-afe4857a-1af3-11e8-8be7-b15da8a1b58d.png)
  
  Taiwan TW is offline
  Currently, Taiwan is grey and 24-hours-history is empty as well.
  
  - [The link ](http://data.taipower.com.tw/opendata01/apply/file/d006001/001.txt) in the [TW.py parser](https://github.com/tmrowco/electricitymap/blob/master/parsers/TW.py) seems to show data, though. 
  Maybe there have been some crucial changes?
  
  Some other TW related things that should be fixed:
  - The source link on the electricitymap website for Taiwan is not shown / shown as "?".
  ![image](https://user-images.githubusercontent.com/25743609/36668983-6d5ee628-1af3-11e8-91a0-db8cff5b6a64.png)
  
  - In general, the link in README.md will show 404 error and is leading nowhere. Seems like they updated/revised their website a bit?
  Here is the website with the 10-min-generation mix that should be linked in README.md:
  http://www.taipower.com.tw/tc/page.aspx?mid=206&cid=404&cchk=8ccc1918-8cae-4f40-a2d0-b43454f4f218
  
  ![image](https://user-images.githubusercontent.com/25743609/36669034-afe4857a-1af3-11e8-8be7-b15da8a1b58d.png)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `parsers/TW.py`
  Content:
  ```
  1 #!/usr/bin/env python3
  2 import arrow
  3 import requests
  4 import pandas
  5 import dateutil
  6 
  7 
  8 def fetch_production(country_code='TW'):
  9     url = 'http://data.taipower.com.tw/opendata01/apply/file/d006001/001.txt'
  10     response = requests.get(url)
  11     data = response.json()
  12 
  13     dumpDate = data['']
  14     prodData = data['aaData']
  15 
  16     tz = 'Asia/Taipei'
  17     dumpDate = arrow.get(dumpDate, 'YYYY-MM-DD HH:mm').replace(tzinfo=dateutil.tz.gettz(tz))
  18 
  19     objData = pandas.DataFrame(prodData)
  20 
  21     objData.columns = ['fueltype', 'name', 'capacity', 'output', 'percentage',
  22                        'additional']
  23 
  24     objData['fueltype'] = objData.fueltype.str.split('(').str[1]
  25     objData['fueltype'] = objData.fueltype.str.split(')').str[0]
  26     objData.drop('additional', axis=1, inplace=True)
  27     objData.drop('percentage', axis=1, inplace=True)
  28 
  29     objData = objData.convert_objects(convert_numeric=True)
  30     production = pandas.DataFrame(objData.groupby('fueltype').sum())
  31     production.columns = ['capacity', 'output']
  32 
  33     coal_capacity = production.ix['Coal'].capacity + production.ix['IPP-Coal'].capacity
  34     gas_capacity = production.ix['LNG'].capacity + production.ix['IPP-LNG'].capacity
  35     oil_capacity = production.ix['Oil'].capacity + production.ix['Diesel'].capacity
  36 
  37     coal_production = production.ix['Coal'].output + production.ix['IPP-Coal'].output
  38     gas_production = production.ix['LNG'].output + production.ix['IPP-LNG'].output
  39     oil_production = production.ix['Oil'].output + production.ix['Diesel'].output
  40 
  41     # For storage, note that load will be negative, and generation positive.
  42     # We require the opposite
  43 
  44     returndata = {
  45         'countryCode': country_code,
  46         'datetime': dumpDate.datetime,
  47         'production': {
  48             'coal': coal_production,
  49             'gas': gas_production,
  50             'oil': oil_production,
  51             'hydro': production.ix['Hydro'].output,
  52             'nuclear': production.ix['Nuclear'].output,
  53             'solar': production.ix['Solar'].output,
  54             'wind': production.ix['Wind'].output,
  55             'unknown': production.ix['Co-Gen'].output
  56         },
  57         'capacity': {
  58             'coal': coal_capacity,
  59             'gas': gas_capacity,
  60             'oil': oil_capacity,
  61             'hydro': production.ix['Hydro'].capacity,
  62             'nuclear': production.ix['Nuclear'].capacity,
  63             'solar': production.ix['Solar'].capacity,
  64             'wind': production.ix['Wind'].capacity,
  65             'unknown': production.ix['Co-Gen'].capacity
  66         },
  67         'storage': {
  68             'hydro': -1 * production.ix['Pumping Load'].output - production.ix['Pumping Gen'].output
  69         },
  70         'source': 'taipower.com.tw'
  71     }
  72 
  73     return returndata
  74 
  75 
  76 if __name__ == '__main__':
  77     print(fetch_production())
  78
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/parsers/TW.py b/parsers/TW.py
  --- a/parsers/TW.py
  +++ b/parsers/TW.py
  @@ -5,7 +5,7 @@
   import dateutil
   
   
  -def fetch_production(country_code='TW'):
  +def fetch_production(country_code='TW', session=None):
       url = 'http://data.taipower.com.tw/opendata01/apply/file/d006001/001.txt'
       response = requests.get(url)
       data = response.json()
  
verification_info: {"golden_diff": "diff --git a/parsers/TW.py b/parsers/TW.py\n--- a/parsers/TW.py\n+++ b/parsers/TW.py\n@@ -5,7 +5,7 @@\n import dateutil\n \n \n-def fetch_production(country_code='TW'):\n+def fetch_production(country_code='TW', session=None):\n     url = 'http://data.taipower.com.tw/opendata01/apply/file/d006001/001.txt'\n     response = requests.get(url)\n     data = response.json()\n", "issue": "Taiwan TW is offline\nCurrently, Taiwan is grey and 24-hours-history is empty as well.\r\n\r\n- [The link ](http://data.taipower.com.tw/opendata01/apply/file/d006001/001.txt) in the [TW.py parser](https://github.com/tmrowco/electricitymap/blob/master/parsers/TW.py) seems to show data, though. \r\nMaybe there have been some crucial changes?\r\n\r\nSome other TW related things that should be fixed:\r\n- The source link on the electricitymap website for Taiwan is not shown / shown as \"?\".\r\n![image](https://user-images.githubusercontent.com/25743609/36668983-6d5ee628-1af3-11e8-91a0-db8cff5b6a64.png)\r\n\r\n- In general, the link in README.md will show 404 error and is leading nowhere. Seems like they updated/revised their website a bit?\r\nHere is the website with the 10-min-generation mix that should be linked in README.md:\r\nhttp://www.taipower.com.tw/tc/page.aspx?mid=206&cid=404&cchk=8ccc1918-8cae-4f40-a2d0-b43454f4f218\r\n\r\n![image](https://user-images.githubusercontent.com/25743609/36669034-afe4857a-1af3-11e8-8be7-b15da8a1b58d.png)\r\n\nTaiwan TW is offline\nCurrently, Taiwan is grey and 24-hours-history is empty as well.\r\n\r\n- [The link ](http://data.taipower.com.tw/opendata01/apply/file/d006001/001.txt) in the [TW.py parser](https://github.com/tmrowco/electricitymap/blob/master/parsers/TW.py) seems to show data, though. \r\nMaybe there have been some crucial changes?\r\n\r\nSome other TW related things that should be fixed:\r\n- The source link on the electricitymap website for Taiwan is not shown / shown as \"?\".\r\n![image](https://user-images.githubusercontent.com/25743609/36668983-6d5ee628-1af3-11e8-91a0-db8cff5b6a64.png)\r\n\r\n- In general, the link in README.md will show 404 error and is leading nowhere. Seems like they updated/revised their website a bit?\r\nHere is the website with the 10-min-generation mix that should be linked in README.md:\r\nhttp://www.taipower.com.tw/tc/page.aspx?mid=206&cid=404&cchk=8ccc1918-8cae-4f40-a2d0-b43454f4f218\r\n\r\n![image](https://user-images.githubusercontent.com/25743609/36669034-afe4857a-1af3-11e8-8be7-b15da8a1b58d.png)\r\n\n", "before_files": [{"content": "#!/usr/bin/env python3\nimport arrow\nimport requests\nimport pandas\nimport dateutil\n\n\ndef fetch_production(country_code='TW'):\n    url = 'http://data.taipower.com.tw/opendata01/apply/file/d006001/001.txt'\n    response = requests.get(url)\n    data = response.json()\n\n    dumpDate = data['']\n    prodData = data['aaData']\n\n    tz = 'Asia/Taipei'\n    dumpDate = arrow.get(dumpDate, 'YYYY-MM-DD HH:mm').replace(tzinfo=dateutil.tz.gettz(tz))\n\n    objData = pandas.DataFrame(prodData)\n\n    objData.columns = ['fueltype', 'name', 'capacity', 'output', 'percentage',\n                       'additional']\n\n    objData['fueltype'] = objData.fueltype.str.split('(').str[1]\n    objData['fueltype'] = objData.fueltype.str.split(')').str[0]\n    objData.drop('additional', axis=1, inplace=True)\n    objData.drop('percentage', axis=1, inplace=True)\n\n    objData = objData.convert_objects(convert_numeric=True)\n    production = pandas.DataFrame(objData.groupby('fueltype').sum())\n    production.columns = ['capacity', 'output']\n\n    coal_capacity = production.ix['Coal'].capacity + production.ix['IPP-Coal'].capacity\n    gas_capacity = production.ix['LNG'].capacity + production.ix['IPP-LNG'].capacity\n    oil_capacity = production.ix['Oil'].capacity + production.ix['Diesel'].capacity\n\n    coal_production = production.ix['Coal'].output + production.ix['IPP-Coal'].output\n    gas_production = production.ix['LNG'].output + production.ix['IPP-LNG'].output\n    oil_production = production.ix['Oil'].output + production.ix['Diesel'].output\n\n    # For storage, note that load will be negative, and generation positive.\n    # We require the opposite\n\n    returndata = {\n        'countryCode': country_code,\n        'datetime': dumpDate.datetime,\n        'production': {\n            'coal': coal_production,\n            'gas': gas_production,\n            'oil': oil_production,\n            'hydro': production.ix['Hydro'].output,\n            'nuclear': production.ix['Nuclear'].output,\n            'solar': production.ix['Solar'].output,\n            'wind': production.ix['Wind'].output,\n            'unknown': production.ix['Co-Gen'].output\n        },\n        'capacity': {\n            'coal': coal_capacity,\n            'gas': gas_capacity,\n            'oil': oil_capacity,\n            'hydro': production.ix['Hydro'].capacity,\n            'nuclear': production.ix['Nuclear'].capacity,\n            'solar': production.ix['Solar'].capacity,\n            'wind': production.ix['Wind'].capacity,\n            'unknown': production.ix['Co-Gen'].capacity\n        },\n        'storage': {\n            'hydro': -1 * production.ix['Pumping Load'].output - production.ix['Pumping Gen'].output\n        },\n        'source': 'taipower.com.tw'\n    }\n\n    return returndata\n\n\nif __name__ == '__main__':\n    print(fetch_production())\n", "path": "parsers/TW.py"}], "after_files": [{"content": "#!/usr/bin/env python3\nimport arrow\nimport requests\nimport pandas\nimport dateutil\n\n\ndef fetch_production(country_code='TW', session=None):\n    url = 'http://data.taipower.com.tw/opendata01/apply/file/d006001/001.txt'\n    response = requests.get(url)\n    data = response.json()\n\n    dumpDate = data['']\n    prodData = data['aaData']\n\n    tz = 'Asia/Taipei'\n    dumpDate = arrow.get(dumpDate, 'YYYY-MM-DD HH:mm').replace(tzinfo=dateutil.tz.gettz(tz))\n\n    objData = pandas.DataFrame(prodData)\n\n    objData.columns = ['fueltype', 'name', 'capacity', 'output', 'percentage',\n                       'additional']\n\n    objData['fueltype'] = objData.fueltype.str.split('(').str[1]\n    objData['fueltype'] = objData.fueltype.str.split(')').str[0]\n    objData.drop('additional', axis=1, inplace=True)\n    objData.drop('percentage', axis=1, inplace=True)\n\n    objData = objData.convert_objects(convert_numeric=True)\n    production = pandas.DataFrame(objData.groupby('fueltype').sum())\n    production.columns = ['capacity', 'output']\n\n    coal_capacity = production.ix['Coal'].capacity + production.ix['IPP-Coal'].capacity\n    gas_capacity = production.ix['LNG'].capacity + production.ix['IPP-LNG'].capacity\n    oil_capacity = production.ix['Oil'].capacity + production.ix['Diesel'].capacity\n\n    coal_production = production.ix['Coal'].output + production.ix['IPP-Coal'].output\n    gas_production = production.ix['LNG'].output + production.ix['IPP-LNG'].output\n    oil_production = production.ix['Oil'].output + production.ix['Diesel'].output\n\n    # For storage, note that load will be negative, and generation positive.\n    # We require the opposite\n\n    returndata = {\n        'countryCode': country_code,\n        'datetime': dumpDate.datetime,\n        'production': {\n            'coal': coal_production,\n            'gas': gas_production,\n            'oil': oil_production,\n            'hydro': production.ix['Hydro'].output,\n            'nuclear': production.ix['Nuclear'].output,\n            'solar': production.ix['Solar'].output,\n            'wind': production.ix['Wind'].output,\n            'unknown': production.ix['Co-Gen'].output\n        },\n        'capacity': {\n            'coal': coal_capacity,\n            'gas': gas_capacity,\n            'oil': oil_capacity,\n            'hydro': production.ix['Hydro'].capacity,\n            'nuclear': production.ix['Nuclear'].capacity,\n            'solar': production.ix['Solar'].capacity,\n            'wind': production.ix['Wind'].capacity,\n            'unknown': production.ix['Co-Gen'].capacity\n        },\n        'storage': {\n            'hydro': -1 * production.ix['Pumping Load'].output - production.ix['Pumping Gen'].output\n        },\n        'source': 'taipower.com.tw'\n    }\n\n    return returndata\n\n\nif __name__ == '__main__':\n    print(fetch_production())\n", "path": "parsers/TW.py"}]}