We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Marshall's


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `locations/spiders/marshalls.py`
Content:
```
1 import json
2 import re
3 import scrapy
4 from locations.items import GeojsonPointItem
5 
6 STATES = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA",
7           "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
8           "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
9           "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
10           "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"]
11 
12 DAYS = {'Mon': 'Mo', 'Tue': 'Tu',
13         'Wed': 'We', 'Thu': 'Th',
14         'Fri': 'Fr', 'Sat': 'Sa',
15         'Sun': 'Su'}
16 
17 URL = 'https://mktsvc.tjx.com/storelocator/GetSearchResultsByState'
18 
19 
20 def normalize_time(hours):
21 
22     if not hours:
23       return ''
24 
25     day_times = hours.split(',')
26     normalize_day_times = []
27 
28     for day_time in day_times:
29         day, hours = [x.strip() for x in day_time.split(': ')]
30         normalize_hours = []
31 
32         if re.search('-', day):
33             days = [x.strip() for x in day.split('-')]
34             norm_days = '-'.join([DAYS.get(x, '') for x in days])
35         else:
36             norm_days = DAYS.get(day, '')
37 
38         if re.search('CLOSED', hours):
39             norm_hours = ' off'
40             normalize_hours.append(norm_hours)
41         else:
42             if re.search('-', hours):
43                 hours = [x.strip() for x in hours.split('-')]
44 
45                 for hour in hours:
46 
47                     if hour[-1] == 'p':
48                         if re.search(':', hour[:-1]):
49                             hora, minute = [x.strip() for x in hour[:-1].split(':')]
50                             if int(hora) < 12:
51                                 norm_hours = str(int(hora) + 12) + ':' + minute
52                         else:
53                             if int(hour[:-1]) < 12:
54                                 norm_hours = str(int(hour[:-1]) + 12) + ":00"
55 
56                     elif hour[-1] == 'a':
57                         if re.search(':', hour[:-1]):
58                             hora, minute = [x.strip() for x in hour[:-1].split(':')]
59                             norm_hours = hora + ':' + minute
60                         else:
61                             norm_hours = hour[:-1] + ":00"
62 
63                     normalize_hours.append(norm_hours)
64 
65         normalize_day_times.append(' '.join([norm_days, '-'.join(normalize_hours)]))
66     return '; '.join(normalize_day_times)
67 
68 
69 class MarshallsSpider(scrapy.Spider):
70 
71     name = "marshalls"
72     allowed_domains = ["mktsvc.tjx.com", 'www.marshallsonline.com']
73 
74     def start_requests(self):
75         url = URL
76 
77         headers = {
78                    'Accept-Language': 'en-US,en;q=0.8,ru;q=0.6',
79                    'Origin': 'https://www.marshallsonline.com',
80                    'Accept-Encoding': 'gzip, deflate, br',
81                    'Accept': 'application/json, text/plain, */*',
82                    'Referer': 'https://www.marshallsonline.com/store-finder/by-state',
83                    'Connection': 'keep-alive',
84                    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
85                    }
86 
87         for state in STATES:
88             form_data = {'chain': '10', 'lang': 'en', 'state': state}
89 
90             yield scrapy.http.FormRequest(url=url, method='POST', formdata=form_data,
91                                           headers=headers, callback=self.parse)
92 
93     def parse(self, response):
94 
95         data = json.loads(response.body_as_unicode())
96         stores = data.get('Stores', None)
97 
98         for store in stores:
99             lon_lat = [store.pop('Longitude', None), store.pop('Latitude', None)]
100             store['ref'] = URL + str(store.get('StoreID', None))
101 
102             opening_hours = normalize_time(store.get('Hours', ''))
103 
104             if opening_hours:
105                 store['opening_hours'] = opening_hours
106                 store.pop('Hours', None)
107 
108             yield GeojsonPointItem(
109                 properties=store,
110                 lon_lat=lon_lat
111             )
112
```
--- 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/locations/spiders/marshalls.py b/locations/spiders/marshalls.py
--- a/locations/spiders/marshalls.py
+++ b/locations/spiders/marshalls.py
@@ -17,10 +17,20 @@
 URL = 'https://mktsvc.tjx.com/storelocator/GetSearchResultsByState'
 
 
+NORMALIZE_KEYS = (
+                    ('addr:full', ['Address', 'Address2']),
+                    ('addr:city', ['City']),
+                    ('addr:state', ['State']),
+                    ('addr:postcode', ['Zip']),
+                    ('addr:country', ['Country']),
+                    ('phone', ['Phone']),
+                 )
+
+
 def normalize_time(hours):
 
     if not hours:
-      return ''
+        return ''
 
     day_times = hours.split(',')
     normalize_day_times = []
@@ -94,18 +104,23 @@
 
         data = json.loads(response.body_as_unicode())
         stores = data.get('Stores', None)
+        props = {}
 
         for store in stores:
-            lon_lat = [store.pop('Longitude', None), store.pop('Latitude', None)]
-            store['ref'] = URL + str(store.get('StoreID', None))
+            lon_lat = [store.pop('Longitude', ''), store.pop('Latitude', None)]
+            props['ref'] = store.pop('StoreID', None)
+            props['website'] = URL
+
+            for new_key, old_keys in NORMALIZE_KEYS:
+                props[new_key] = ", ".join([store.pop(key, '').strip() for key in old_keys if store[key]])
 
-            opening_hours = normalize_time(store.get('Hours', ''))
+            opening_hours = normalize_time(store.pop('Hours', ''))
 
             if opening_hours:
-                store['opening_hours'] = opening_hours
-                store.pop('Hours', None)
+                props['opening_hours'] = opening_hours
+                props.pop('Hours', None)
 
             yield GeojsonPointItem(
-                properties=store,
+                properties=props,
                 lon_lat=lon_lat
             )

{"golden_diff": "diff --git a/locations/spiders/marshalls.py b/locations/spiders/marshalls.py\n--- a/locations/spiders/marshalls.py\n+++ b/locations/spiders/marshalls.py\n@@ -17,10 +17,20 @@\n URL = 'https://mktsvc.tjx.com/storelocator/GetSearchResultsByState'\n \n \n+NORMALIZE_KEYS = (\n+                    ('addr:full', ['Address', 'Address2']),\n+                    ('addr:city', ['City']),\n+                    ('addr:state', ['State']),\n+                    ('addr:postcode', ['Zip']),\n+                    ('addr:country', ['Country']),\n+                    ('phone', ['Phone']),\n+                 )\n+\n+\n def normalize_time(hours):\n \n     if not hours:\n-      return ''\n+        return ''\n \n     day_times = hours.split(',')\n     normalize_day_times = []\n@@ -94,18 +104,23 @@\n \n         data = json.loads(response.body_as_unicode())\n         stores = data.get('Stores', None)\n+        props = {}\n \n         for store in stores:\n-            lon_lat = [store.pop('Longitude', None), store.pop('Latitude', None)]\n-            store['ref'] = URL + str(store.get('StoreID', None))\n+            lon_lat = [store.pop('Longitude', ''), store.pop('Latitude', None)]\n+            props['ref'] = store.pop('StoreID', None)\n+            props['website'] = URL\n+\n+            for new_key, old_keys in NORMALIZE_KEYS:\n+                props[new_key] = \", \".join([store.pop(key, '').strip() for key in old_keys if store[key]])\n \n-            opening_hours = normalize_time(store.get('Hours', ''))\n+            opening_hours = normalize_time(store.pop('Hours', ''))\n \n             if opening_hours:\n-                store['opening_hours'] = opening_hours\n-                store.pop('Hours', None)\n+                props['opening_hours'] = opening_hours\n+                props.pop('Hours', None)\n \n             yield GeojsonPointItem(\n-                properties=store,\n+                properties=props,\n                 lon_lat=lon_lat\n             )\n", "issue": "Marshall's\n\n", "before_files": [{"content": "import json\nimport re\nimport scrapy\nfrom locations.items import GeojsonPointItem\n\nSTATES = [\"AL\", \"AK\", \"AZ\", \"AR\", \"CA\", \"CO\", \"CT\", \"DC\", \"DE\", \"FL\", \"GA\",\n          \"HI\", \"ID\", \"IL\", \"IN\", \"IA\", \"KS\", \"KY\", \"LA\", \"ME\", \"MD\",\n          \"MA\", \"MI\", \"MN\", \"MS\", \"MO\", \"MT\", \"NE\", \"NV\", \"NH\", \"NJ\",\n          \"NM\", \"NY\", \"NC\", \"ND\", \"OH\", \"OK\", \"OR\", \"PA\", \"RI\", \"SC\",\n          \"SD\", \"TN\", \"TX\", \"UT\", \"VT\", \"VA\", \"WA\", \"WV\", \"WI\", \"WY\"]\n\nDAYS = {'Mon': 'Mo', 'Tue': 'Tu',\n        'Wed': 'We', 'Thu': 'Th',\n        'Fri': 'Fr', 'Sat': 'Sa',\n        'Sun': 'Su'}\n\nURL = 'https://mktsvc.tjx.com/storelocator/GetSearchResultsByState'\n\n\ndef normalize_time(hours):\n\n    if not hours:\n      return ''\n\n    day_times = hours.split(',')\n    normalize_day_times = []\n\n    for day_time in day_times:\n        day, hours = [x.strip() for x in day_time.split(': ')]\n        normalize_hours = []\n\n        if re.search('-', day):\n            days = [x.strip() for x in day.split('-')]\n            norm_days = '-'.join([DAYS.get(x, '') for x in days])\n        else:\n            norm_days = DAYS.get(day, '')\n\n        if re.search('CLOSED', hours):\n            norm_hours = ' off'\n            normalize_hours.append(norm_hours)\n        else:\n            if re.search('-', hours):\n                hours = [x.strip() for x in hours.split('-')]\n\n                for hour in hours:\n\n                    if hour[-1] == 'p':\n                        if re.search(':', hour[:-1]):\n                            hora, minute = [x.strip() for x in hour[:-1].split(':')]\n                            if int(hora) < 12:\n                                norm_hours = str(int(hora) + 12) + ':' + minute\n                        else:\n                            if int(hour[:-1]) < 12:\n                                norm_hours = str(int(hour[:-1]) + 12) + \":00\"\n\n                    elif hour[-1] == 'a':\n                        if re.search(':', hour[:-1]):\n                            hora, minute = [x.strip() for x in hour[:-1].split(':')]\n                            norm_hours = hora + ':' + minute\n                        else:\n                            norm_hours = hour[:-1] + \":00\"\n\n                    normalize_hours.append(norm_hours)\n\n        normalize_day_times.append(' '.join([norm_days, '-'.join(normalize_hours)]))\n    return '; '.join(normalize_day_times)\n\n\nclass MarshallsSpider(scrapy.Spider):\n\n    name = \"marshalls\"\n    allowed_domains = [\"mktsvc.tjx.com\", 'www.marshallsonline.com']\n\n    def start_requests(self):\n        url = URL\n\n        headers = {\n                   'Accept-Language': 'en-US,en;q=0.8,ru;q=0.6',\n                   'Origin': 'https://www.marshallsonline.com',\n                   'Accept-Encoding': 'gzip, deflate, br',\n                   'Accept': 'application/json, text/plain, */*',\n                   'Referer': 'https://www.marshallsonline.com/store-finder/by-state',\n                   'Connection': 'keep-alive',\n                   'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n                   }\n\n        for state in STATES:\n            form_data = {'chain': '10', 'lang': 'en', 'state': state}\n\n            yield scrapy.http.FormRequest(url=url, method='POST', formdata=form_data,\n                                          headers=headers, callback=self.parse)\n\n    def parse(self, response):\n\n        data = json.loads(response.body_as_unicode())\n        stores = data.get('Stores', None)\n\n        for store in stores:\n            lon_lat = [store.pop('Longitude', None), store.pop('Latitude', None)]\n            store['ref'] = URL + str(store.get('StoreID', None))\n\n            opening_hours = normalize_time(store.get('Hours', ''))\n\n            if opening_hours:\n                store['opening_hours'] = opening_hours\n                store.pop('Hours', None)\n\n            yield GeojsonPointItem(\n                properties=store,\n                lon_lat=lon_lat\n            )\n", "path": "locations/spiders/marshalls.py"}], "after_files": [{"content": "import json\nimport re\nimport scrapy\nfrom locations.items import GeojsonPointItem\n\nSTATES = [\"AL\", \"AK\", \"AZ\", \"AR\", \"CA\", \"CO\", \"CT\", \"DC\", \"DE\", \"FL\", \"GA\",\n          \"HI\", \"ID\", \"IL\", \"IN\", \"IA\", \"KS\", \"KY\", \"LA\", \"ME\", \"MD\",\n          \"MA\", \"MI\", \"MN\", \"MS\", \"MO\", \"MT\", \"NE\", \"NV\", \"NH\", \"NJ\",\n          \"NM\", \"NY\", \"NC\", \"ND\", \"OH\", \"OK\", \"OR\", \"PA\", \"RI\", \"SC\",\n          \"SD\", \"TN\", \"TX\", \"UT\", \"VT\", \"VA\", \"WA\", \"WV\", \"WI\", \"WY\"]\n\nDAYS = {'Mon': 'Mo', 'Tue': 'Tu',\n        'Wed': 'We', 'Thu': 'Th',\n        'Fri': 'Fr', 'Sat': 'Sa',\n        'Sun': 'Su'}\n\nURL = 'https://mktsvc.tjx.com/storelocator/GetSearchResultsByState'\n\n\nNORMALIZE_KEYS = (\n                    ('addr:full', ['Address', 'Address2']),\n                    ('addr:city', ['City']),\n                    ('addr:state', ['State']),\n                    ('addr:postcode', ['Zip']),\n                    ('addr:country', ['Country']),\n                    ('phone', ['Phone']),\n                 )\n\n\ndef normalize_time(hours):\n\n    if not hours:\n        return ''\n\n    day_times = hours.split(',')\n    normalize_day_times = []\n\n    for day_time in day_times:\n        day, hours = [x.strip() for x in day_time.split(': ')]\n        normalize_hours = []\n\n        if re.search('-', day):\n            days = [x.strip() for x in day.split('-')]\n            norm_days = '-'.join([DAYS.get(x, '') for x in days])\n        else:\n            norm_days = DAYS.get(day, '')\n\n        if re.search('CLOSED', hours):\n            norm_hours = ' off'\n            normalize_hours.append(norm_hours)\n        else:\n            if re.search('-', hours):\n                hours = [x.strip() for x in hours.split('-')]\n\n                for hour in hours:\n\n                    if hour[-1] == 'p':\n                        if re.search(':', hour[:-1]):\n                            hora, minute = [x.strip() for x in hour[:-1].split(':')]\n                            if int(hora) < 12:\n                                norm_hours = str(int(hora) + 12) + ':' + minute\n                        else:\n                            if int(hour[:-1]) < 12:\n                                norm_hours = str(int(hour[:-1]) + 12) + \":00\"\n\n                    elif hour[-1] == 'a':\n                        if re.search(':', hour[:-1]):\n                            hora, minute = [x.strip() for x in hour[:-1].split(':')]\n                            norm_hours = hora + ':' + minute\n                        else:\n                            norm_hours = hour[:-1] + \":00\"\n\n                    normalize_hours.append(norm_hours)\n\n        normalize_day_times.append(' '.join([norm_days, '-'.join(normalize_hours)]))\n    return '; '.join(normalize_day_times)\n\n\nclass MarshallsSpider(scrapy.Spider):\n\n    name = \"marshalls\"\n    allowed_domains = [\"mktsvc.tjx.com\", 'www.marshallsonline.com']\n\n    def start_requests(self):\n        url = URL\n\n        headers = {\n                   'Accept-Language': 'en-US,en;q=0.8,ru;q=0.6',\n                   'Origin': 'https://www.marshallsonline.com',\n                   'Accept-Encoding': 'gzip, deflate, br',\n                   'Accept': 'application/json, text/plain, */*',\n                   'Referer': 'https://www.marshallsonline.com/store-finder/by-state',\n                   'Connection': 'keep-alive',\n                   'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',\n                   }\n\n        for state in STATES:\n            form_data = {'chain': '10', 'lang': 'en', 'state': state}\n\n            yield scrapy.http.FormRequest(url=url, method='POST', formdata=form_data,\n                                          headers=headers, callback=self.parse)\n\n    def parse(self, response):\n\n        data = json.loads(response.body_as_unicode())\n        stores = data.get('Stores', None)\n        props = {}\n\n        for store in stores:\n            lon_lat = [store.pop('Longitude', ''), store.pop('Latitude', None)]\n            props['ref'] = store.pop('StoreID', None)\n            props['website'] = URL\n\n            for new_key, old_keys in NORMALIZE_KEYS:\n                props[new_key] = \", \".join([store.pop(key, '').strip() for key in old_keys if store[key]])\n\n            opening_hours = normalize_time(store.pop('Hours', ''))\n\n            if opening_hours:\n                props['opening_hours'] = opening_hours\n                props.pop('Hours', None)\n\n            yield GeojsonPointItem(\n                properties=props,\n                lon_lat=lon_lat\n            )\n", "path": "locations/spiders/marshalls.py"}]}