We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Moldova repeated ValueError
Seen on the Kibana dashboard.

[Logger](https://kibana.electricitymap.org/app/kibana#/discover/1710fdd0-2460-11e8-a779-9d01de8d7a71?_g=(refreshInterval:('$$hashKey':'object:6765',display:'10%20seconds',pause:!f,section:1,value:10000),time:(from:'2018-03-10T00:00:00.000Z',mode:absolute,to:'2018-03-12T10:40:25.571Z'))&_a=(columns:!(level,extra.path,message),filters:!(('$state':(store:appState),exists:(field:level),meta:(alias:!n,disabled:!f,index:'93e631f0-245f-11e8-a779-9d01de8d7a71',key:level,negate:!f,type:exists,value:exists)),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'93e631f0-245f-11e8-a779-9d01de8d7a71',key:level,negate:!t,params:(query:INFO,type:phrase),type:phrase,value:INFO),query:(match:(level:(query:INFO,type:phrase)))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'93e631f0-245f-11e8-a779-9d01de8d7a71',key:extra.key,negate:!f,params:(query:MD,type:phrase),type:phrase,value:MD),query:(match:(extra.key:(query:MD,type:phrase))))),index:'93e631f0-245f-11e8-a779-9d01de8d7a71',interval:auto,query:(language:lucene,query:''),sort:!('@timestamp',desc)))
```
Traceback (most recent call last):
  File "feeder_electricity.py", line 176, in fetch_exchange
    objs = parser(country_code1, country_code2, session, logger=public_logger)
  File "/home/electricitymap/parsers/MD.py", line 113, in fetch_exchange
    exchange_status = get_data(session=session)
  File "/home/electricitymap/parsers/MD.py", line 31, in get_data
    data = [float(i) for i in raw_data.split(',')]
  File "/home/electricitymap/parsers/MD.py", line 31, in <listcomp>
    data = [float(i) for i in raw_data.split(',')]
ValueError: could not convert string to float:
```

```
Traceback (most recent call last):
  File "feeder_electricity.py", line 148, in fetch_production
    objs = parser(country_code, session, logger=public_logger)
  File "/home/electricitymap/parsers/MD.py", line 69, in fetch_production
    grid_status = get_data(session=session)
  File "/home/electricitymap/parsers/MD.py", line 31, in get_data
    data = [float(i) for i in raw_data.split(',')]
  File "/home/electricitymap/parsers/MD.py", line 31, in <listcomp>
    data = [float(i) for i in raw_data.split(',')]
ValueError: could not convert string to float:
```

--- 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/MD.py`
Content:
```
1 #!/usr/bin/env python3
2 # coding=utf-8
3 
4 """Parser for Moldova."""
5 
6 import arrow
7 from operator import itemgetter
8 import requests
9 
10 TYPE_MAPPING = {
11     u'tmva476': 'hydro',  # NHE Costeşti (run-of-river) #2 index
12     u'tmva112': 'hydro',  # NHE Dubăsari (run-of-river) #4 index
13     u'tmva367': 'gas',  # CET Nord (CHPP) #3 index
14     u'tmva42': 'gas',  # CET-1 Chişinău (CHPP) #6 index
15     u'tmva378': 'gas',  # CET-2 Chişinău (CHPP) #5 index
16     u'tmva1024': 'unknown',  # CERS Moldovenească (fuel mix coal, gas, oil) #7 index
17 }
18 
19 display_url = 'http://www.moldelectrica.md/ro/activity/system_state'
20 data_url = 'http://www.moldelectrica.md/utils/load4'
21 
22 
23 def get_data(session=None):
24     """ Returns generation data as a list of floats."""
25 
26     s = session or requests.Session()
27 
28     data_response = s.get(data_url)
29     raw_data = data_response.text
30 
31     data = [float(i) for i in raw_data.split(',')]
32 
33     return data
34 
35 
36 def fetch_production(zone_key='MD', session=None, target_datetime=None, logger=None):
37     """Requests the last known production mix (in MW) of a given country
38 
39     Arguments:
40     zone_key (optional) -- used in case a parser is able to fetch multiple countries
41     session (optional)      -- request session passed in order to re-use an existing session
42 
43     Return:
44     A dictionary in the form:
45     {
46       'zoneKey': 'FR',
47       'datetime': '2017-01-01T00:00:00Z',
48       'production': {
49           'biomass': 0.0,
50           'coal': 0.0,
51           'gas': 0.0,
52           'hydro': 0.0,
53           'nuclear': null,
54           'oil': 0.0,
55           'solar': 0.0,
56           'wind': 0.0,
57           'geothermal': 0.0,
58           'unknown': 0.0
59       },
60       'storage': {
61           'hydro': -10.0,
62       },
63       'source': 'mysource.com'
64     }
65     """
66     if target_datetime:
67         raise NotImplementedError('This parser is not yet able to parse past dates')
68 
69     grid_status = get_data(session=session)
70     production = {'solar': None, 'wind': None, 'biomass': None, 'nuclear': 0.0}
71 
72     production['gas'] = sum(itemgetter(3, 5, 6)(grid_status))
73     production['hydro'] = sum(itemgetter(2, 4)(grid_status))
74     production['unknown'] = grid_status[7]
75 
76     consumption = grid_status[-5]
77 
78     dt = arrow.now('Europe/Chisinau').datetime
79 
80     datapoint = {
81         'zoneKey': zone_key,
82         'datetime': dt,
83         'consumption': consumption,
84         'production': production,
85         'storage': {},
86         'source': 'moldelectrica.md'
87     }
88 
89     return datapoint
90 
91 
92 def fetch_exchange(zone_key1, zone_key2, session=None, target_datetime=None, logger=None):
93     """Requests the last known power exchange (in MW) between two countries
94     Arguments:
95     zone_key1           -- the first country code
96     zone_key2           -- the second country code; order of the two codes in params doesn't matter
97     session (optional)      -- request session passed in order to re-use an existing session
98     Return:
99     A dictionary in the form:
100     {
101       'sortedZoneKeys': 'DK->NO',
102       'datetime': '2017-01-01T00:00:00Z',
103       'netFlow': 0.0,
104       'source': 'mysource.com'
105     }
106     where net flow is from DK into NO
107     """
108     if target_datetime:
109         raise NotImplementedError('This parser is not yet able to parse past dates')
110 
111     sortedZoneKeys = '->'.join(sorted([zone_key1, zone_key2]))
112 
113     exchange_status = get_data(session=session)
114 
115     if sortedZoneKeys == 'MD->UA':
116         netflow = -1 * exchange_status[-3]
117     elif sortedZoneKeys == 'MD->RO':
118         netflow = -1 * exchange_status[-2]
119     else:
120         raise NotImplementedError('This exchange pair is not implemented')
121 
122     dt = arrow.now('Europe/Chisinau').datetime
123 
124     exchange = {
125         'sortedZoneKeys': sortedZoneKeys,
126         'datetime': dt,
127         'netFlow': netflow,
128         'source': 'moldelectrica.md'
129     }
130 
131     return exchange
132 
133 
134 if __name__ == '__main__':
135     """Main method, never used by the Electricity Map backend, but handy for testing."""
136 
137     print('fetch_production() ->')
138     print(fetch_production())
139     print('fetch_exchange(MD, UA) ->')
140     print(fetch_exchange('MD', 'UA'))
141     print('fetch_exchange(MD, RO) ->')
142     print(fetch_exchange('MD', 'RO'))
143
```
--- 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/parsers/MD.py b/parsers/MD.py
--- a/parsers/MD.py
+++ b/parsers/MD.py
@@ -25,9 +25,10 @@
 
     s = session or requests.Session()
 
+    #In order for the data url to return data, cookies from the display url must be obtained then reused.
+    response = s.get(display_url)
     data_response = s.get(data_url)
     raw_data = data_response.text
-
     data = [float(i) for i in raw_data.split(',')]
 
     return data

{"golden_diff": "diff --git a/parsers/MD.py b/parsers/MD.py\n--- a/parsers/MD.py\n+++ b/parsers/MD.py\n@@ -25,9 +25,10 @@\n \n     s = session or requests.Session()\n \n+    #In order for the data url to return data, cookies from the display url must be obtained then reused.\n+    response = s.get(display_url)\n     data_response = s.get(data_url)\n     raw_data = data_response.text\n-\n     data = [float(i) for i in raw_data.split(',')]\n \n     return data\n", "issue": "Moldova repeated ValueError\nSeen on the Kibana dashboard.\r\n\r\n[Logger](https://kibana.electricitymap.org/app/kibana#/discover/1710fdd0-2460-11e8-a779-9d01de8d7a71?_g=(refreshInterval:('$$hashKey':'object:6765',display:'10%20seconds',pause:!f,section:1,value:10000),time:(from:'2018-03-10T00:00:00.000Z',mode:absolute,to:'2018-03-12T10:40:25.571Z'))&_a=(columns:!(level,extra.path,message),filters:!(('$state':(store:appState),exists:(field:level),meta:(alias:!n,disabled:!f,index:'93e631f0-245f-11e8-a779-9d01de8d7a71',key:level,negate:!f,type:exists,value:exists)),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'93e631f0-245f-11e8-a779-9d01de8d7a71',key:level,negate:!t,params:(query:INFO,type:phrase),type:phrase,value:INFO),query:(match:(level:(query:INFO,type:phrase)))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'93e631f0-245f-11e8-a779-9d01de8d7a71',key:extra.key,negate:!f,params:(query:MD,type:phrase),type:phrase,value:MD),query:(match:(extra.key:(query:MD,type:phrase))))),index:'93e631f0-245f-11e8-a779-9d01de8d7a71',interval:auto,query:(language:lucene,query:''),sort:!('@timestamp',desc)))\r\n```\r\nTraceback (most recent call last):\r\n  File \"feeder_electricity.py\", line 176, in fetch_exchange\r\n    objs = parser(country_code1, country_code2, session, logger=public_logger)\r\n  File \"/home/electricitymap/parsers/MD.py\", line 113, in fetch_exchange\r\n    exchange_status = get_data(session=session)\r\n  File \"/home/electricitymap/parsers/MD.py\", line 31, in get_data\r\n    data = [float(i) for i in raw_data.split(',')]\r\n  File \"/home/electricitymap/parsers/MD.py\", line 31, in <listcomp>\r\n    data = [float(i) for i in raw_data.split(',')]\r\nValueError: could not convert string to float:\r\n```\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"feeder_electricity.py\", line 148, in fetch_production\r\n    objs = parser(country_code, session, logger=public_logger)\r\n  File \"/home/electricitymap/parsers/MD.py\", line 69, in fetch_production\r\n    grid_status = get_data(session=session)\r\n  File \"/home/electricitymap/parsers/MD.py\", line 31, in get_data\r\n    data = [float(i) for i in raw_data.split(',')]\r\n  File \"/home/electricitymap/parsers/MD.py\", line 31, in <listcomp>\r\n    data = [float(i) for i in raw_data.split(',')]\r\nValueError: could not convert string to float:\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python3\n# coding=utf-8\n\n\"\"\"Parser for Moldova.\"\"\"\n\nimport arrow\nfrom operator import itemgetter\nimport requests\n\nTYPE_MAPPING = {\n    u'tmva476': 'hydro',  # NHE Coste\u015fti (run-of-river) #2 index\n    u'tmva112': 'hydro',  # NHE Dub\u0103sari (run-of-river) #4 index\n    u'tmva367': 'gas',  # CET Nord (CHPP) #3 index\n    u'tmva42': 'gas',  # CET-1 Chi\u015fin\u0103u (CHPP) #6 index\n    u'tmva378': 'gas',  # CET-2 Chi\u015fin\u0103u (CHPP) #5 index\n    u'tmva1024': 'unknown',  # CERS Moldoveneasc\u0103 (fuel mix coal, gas, oil) #7 index\n}\n\ndisplay_url = 'http://www.moldelectrica.md/ro/activity/system_state'\ndata_url = 'http://www.moldelectrica.md/utils/load4'\n\n\ndef get_data(session=None):\n    \"\"\" Returns generation data as a list of floats.\"\"\"\n\n    s = session or requests.Session()\n\n    data_response = s.get(data_url)\n    raw_data = data_response.text\n\n    data = [float(i) for i in raw_data.split(',')]\n\n    return data\n\n\ndef fetch_production(zone_key='MD', session=None, target_datetime=None, logger=None):\n    \"\"\"Requests the last known production mix (in MW) of a given country\n\n    Arguments:\n    zone_key (optional) -- used in case a parser is able to fetch multiple countries\n    session (optional)      -- request session passed in order to re-use an existing session\n\n    Return:\n    A dictionary in the form:\n    {\n      'zoneKey': 'FR',\n      'datetime': '2017-01-01T00:00:00Z',\n      'production': {\n          'biomass': 0.0,\n          'coal': 0.0,\n          'gas': 0.0,\n          'hydro': 0.0,\n          'nuclear': null,\n          'oil': 0.0,\n          'solar': 0.0,\n          'wind': 0.0,\n          'geothermal': 0.0,\n          'unknown': 0.0\n      },\n      'storage': {\n          'hydro': -10.0,\n      },\n      'source': 'mysource.com'\n    }\n    \"\"\"\n    if target_datetime:\n        raise NotImplementedError('This parser is not yet able to parse past dates')\n\n    grid_status = get_data(session=session)\n    production = {'solar': None, 'wind': None, 'biomass': None, 'nuclear': 0.0}\n\n    production['gas'] = sum(itemgetter(3, 5, 6)(grid_status))\n    production['hydro'] = sum(itemgetter(2, 4)(grid_status))\n    production['unknown'] = grid_status[7]\n\n    consumption = grid_status[-5]\n\n    dt = arrow.now('Europe/Chisinau').datetime\n\n    datapoint = {\n        'zoneKey': zone_key,\n        'datetime': dt,\n        'consumption': consumption,\n        'production': production,\n        'storage': {},\n        'source': 'moldelectrica.md'\n    }\n\n    return datapoint\n\n\ndef fetch_exchange(zone_key1, zone_key2, session=None, target_datetime=None, logger=None):\n    \"\"\"Requests the last known power exchange (in MW) between two countries\n    Arguments:\n    zone_key1           -- the first country code\n    zone_key2           -- the second country code; order of the two codes in params doesn't matter\n    session (optional)      -- request session passed in order to re-use an existing session\n    Return:\n    A dictionary in the form:\n    {\n      'sortedZoneKeys': 'DK->NO',\n      'datetime': '2017-01-01T00:00:00Z',\n      'netFlow': 0.0,\n      'source': 'mysource.com'\n    }\n    where net flow is from DK into NO\n    \"\"\"\n    if target_datetime:\n        raise NotImplementedError('This parser is not yet able to parse past dates')\n\n    sortedZoneKeys = '->'.join(sorted([zone_key1, zone_key2]))\n\n    exchange_status = get_data(session=session)\n\n    if sortedZoneKeys == 'MD->UA':\n        netflow = -1 * exchange_status[-3]\n    elif sortedZoneKeys == 'MD->RO':\n        netflow = -1 * exchange_status[-2]\n    else:\n        raise NotImplementedError('This exchange pair is not implemented')\n\n    dt = arrow.now('Europe/Chisinau').datetime\n\n    exchange = {\n        'sortedZoneKeys': sortedZoneKeys,\n        'datetime': dt,\n        'netFlow': netflow,\n        'source': 'moldelectrica.md'\n    }\n\n    return exchange\n\n\nif __name__ == '__main__':\n    \"\"\"Main method, never used by the Electricity Map backend, but handy for testing.\"\"\"\n\n    print('fetch_production() ->')\n    print(fetch_production())\n    print('fetch_exchange(MD, UA) ->')\n    print(fetch_exchange('MD', 'UA'))\n    print('fetch_exchange(MD, RO) ->')\n    print(fetch_exchange('MD', 'RO'))\n", "path": "parsers/MD.py"}], "after_files": [{"content": "#!/usr/bin/env python3\n# coding=utf-8\n\n\"\"\"Parser for Moldova.\"\"\"\n\nimport arrow\nfrom operator import itemgetter\nimport requests\n\nTYPE_MAPPING = {\n    u'tmva476': 'hydro',  # NHE Coste\u015fti (run-of-river) #2 index\n    u'tmva112': 'hydro',  # NHE Dub\u0103sari (run-of-river) #4 index\n    u'tmva367': 'gas',  # CET Nord (CHPP) #3 index\n    u'tmva42': 'gas',  # CET-1 Chi\u015fin\u0103u (CHPP) #6 index\n    u'tmva378': 'gas',  # CET-2 Chi\u015fin\u0103u (CHPP) #5 index\n    u'tmva1024': 'unknown',  # CERS Moldoveneasc\u0103 (fuel mix coal, gas, oil) #7 index\n}\n\ndisplay_url = 'http://www.moldelectrica.md/ro/activity/system_state'\ndata_url = 'http://www.moldelectrica.md/utils/load4'\n\n\ndef get_data(session=None):\n    \"\"\" Returns generation data as a list of floats.\"\"\"\n\n    s = session or requests.Session()\n\n    #In order for the data url to return data, cookies from the display url must be obtained then reused.\n    response = s.get(display_url)\n    data_response = s.get(data_url)\n    raw_data = data_response.text\n    data = [float(i) for i in raw_data.split(',')]\n\n    return data\n\n\ndef fetch_production(zone_key='MD', session=None, target_datetime=None, logger=None):\n    \"\"\"Requests the last known production mix (in MW) of a given country\n\n    Arguments:\n    zone_key (optional) -- used in case a parser is able to fetch multiple countries\n    session (optional)      -- request session passed in order to re-use an existing session\n\n    Return:\n    A dictionary in the form:\n    {\n      'zoneKey': 'FR',\n      'datetime': '2017-01-01T00:00:00Z',\n      'production': {\n          'biomass': 0.0,\n          'coal': 0.0,\n          'gas': 0.0,\n          'hydro': 0.0,\n          'nuclear': null,\n          'oil': 0.0,\n          'solar': 0.0,\n          'wind': 0.0,\n          'geothermal': 0.0,\n          'unknown': 0.0\n      },\n      'storage': {\n          'hydro': -10.0,\n      },\n      'source': 'mysource.com'\n    }\n    \"\"\"\n    if target_datetime:\n        raise NotImplementedError('This parser is not yet able to parse past dates')\n\n    grid_status = get_data(session=session)\n    production = {'solar': None, 'wind': None, 'biomass': None, 'nuclear': 0.0}\n\n    production['gas'] = sum(itemgetter(3, 5, 6)(grid_status))\n    production['hydro'] = sum(itemgetter(2, 4)(grid_status))\n    production['unknown'] = grid_status[7]\n\n    consumption = grid_status[-5]\n\n    dt = arrow.now('Europe/Chisinau').datetime\n\n    datapoint = {\n        'zoneKey': zone_key,\n        'datetime': dt,\n        'consumption': consumption,\n        'production': production,\n        'storage': {},\n        'source': 'moldelectrica.md'\n    }\n\n    return datapoint\n\n\ndef fetch_exchange(zone_key1, zone_key2, session=None, target_datetime=None, logger=None):\n    \"\"\"Requests the last known power exchange (in MW) between two countries\n    Arguments:\n    zone_key1           -- the first country code\n    zone_key2           -- the second country code; order of the two codes in params doesn't matter\n    session (optional)      -- request session passed in order to re-use an existing session\n    Return:\n    A dictionary in the form:\n    {\n      'sortedZoneKeys': 'DK->NO',\n      'datetime': '2017-01-01T00:00:00Z',\n      'netFlow': 0.0,\n      'source': 'mysource.com'\n    }\n    where net flow is from DK into NO\n    \"\"\"\n    if target_datetime:\n        raise NotImplementedError('This parser is not yet able to parse past dates')\n\n    sortedZoneKeys = '->'.join(sorted([zone_key1, zone_key2]))\n\n    exchange_status = get_data(session=session)\n\n    if sortedZoneKeys == 'MD->UA':\n        netflow = -1 * exchange_status[-3]\n    elif sortedZoneKeys == 'MD->RO':\n        netflow = -1 * exchange_status[-2]\n    else:\n        raise NotImplementedError('This exchange pair is not implemented')\n\n    dt = arrow.now('Europe/Chisinau').datetime\n\n    exchange = {\n        'sortedZoneKeys': sortedZoneKeys,\n        'datetime': dt,\n        'netFlow': netflow,\n        'source': 'moldelectrica.md'\n    }\n\n    return exchange\n\n\nif __name__ == '__main__':\n    \"\"\"Main method, never used by the Electricity Map backend, but handy for testing.\"\"\"\n\n    print('fetch_production() ->')\n    print(fetch_production())\n    print('fetch_exchange(MD, UA) ->')\n    print(fetch_exchange('MD', 'UA'))\n    print('fetch_exchange(MD, RO) ->')\n    print(fetch_exchange('MD', 'RO'))\n", "path": "parsers/MD.py"}]}