internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: alltheplaces/alltheplaces

Issue:
Spider tgifridays is broken
During the global build at 2021-05-26-14-42-23, spider **tgifridays** failed with **0 features** and **0 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/logs/tgifridays.log) and [the output](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/tgifridays.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/tgifridays.geojson))


Discussion:
During the global build at 2021-06-30-14-42-26, spider **tgifridays** failed with **317 features** and **6 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-06-30-14-42-26/logs/tgifridays.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-06-30-14-42-26/output/tgifridays.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-06-30-14-42-26/output/tgifridays.geojson))
During the global build at 2021-07-14-14-42-22, spider **tgifridays** failed with **317 features** and **5 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/logs/tgifridays.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/output/tgifridays.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-07-14-14-42-22/output/tgifridays.geojson))
During the global build at 2021-07-21-14-42-39, spider **tgifridays** failed with **317 features** and **5 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-07-21-14-42-39/logs/tgifridays.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-07-21-14-42-39/output/tgifridays.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-07-21-14-42-39/output/tgifridays.geojson))

Resolving patch:
diff --git a/locations/spiders/tgifridays.py b/locations/spiders/tgifridays.py
--- a/locations/spiders/tgifridays.py
+++ b/locations/spiders/tgifridays.py
@@ -32,9 +32,9 @@ def parse_hours(self, hours):
         opening_hours = OpeningHours()
 
         for hour in hours:
-            if hour["opens"] == "Closed":
+            if hour["opens"] in ("Closed", ""):
                 continue
-            elif hour["closes"] == "Closed":
+            elif hour["closes"] in ("Closed", ""):
                 continue
             else:
                 opening_hours.add_range(


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Spider att is broken
During the global build at 2021-06-02-14-42-40, spider **att** failed with **0 features** and **5433 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-06-02-14-42-40/logs/att.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-06-02-14-42-40/output/att.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-06-02-14-42-40/output/att.geojson))


Discussion:

Resolving patch:
diff --git a/locations/spiders/att.py b/locations/spiders/att.py
--- a/locations/spiders/att.py
+++ b/locations/spiders/att.py
@@ -76,7 +76,7 @@ def parse_store(self, response):
             'lon': response.xpath('normalize-space(//meta[@itemprop="longitude"]/@content)').extract_first(),
         }
 
-        hours = response.xpath('//span[@class="c-location-hours-today js-location-hours"]/@data-days').extract_first()
+        hours = response.xpath('//span[@class="c-hours-today js-hours-today"]/@data-days').extract_first()
         properties['opening_hours'] = self.parse_hours(hours)
 
         yield GeojsonPointItem(**properties)


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Camp Bow Wow
https://www.campbowwow.com/locations/


Discussion:

Resolving patch:
diff --git a/locations/spiders/camp_bow_wow.py b/locations/spiders/camp_bow_wow.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/camp_bow_wow.py
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+import json
+import re
+
+import scrapy
+
+from locations.items import GeojsonPointItem
+from locations.hours import OpeningHours
+
+
+class CampBowWowSpider(scrapy.Spider):
+    name = "camp_bow_wow"
+    allowed_domains = ["campbowwow.com"]
+
+    def start_requests(self):
+        url = "https://www.campbowwow.com/locations/?CallAjax=GetLocations"
+
+        yield scrapy.http.Request(url,
+                                  method='POST',
+                                  callback=self.parse
+                                  )
+
+    def parse(self, response):
+        data = json.loads(response.body_as_unicode())
+
+        for place in data:
+            properties = {
+                'ref': place["FranchiseLocationID"],
+                'name': place["FranchiseLocationName"],
+                'addr_full': place["Address1"],
+                'city': place["City"],
+                'state': place["State"],
+                'postcode': place["ZipCode"],
+                'country': place["Country"],
+                'lat': place["Latitude"],
+                'lon': place["Longitude"],
+                'phone': place["Phone"]
+            }
+
+            yield GeojsonPointItem(**properties)


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
J.Jill
http://locations.jjill.com/


Discussion:

Resolving patch:
diff --git a/locations/spiders/jjill.py b/locations/spiders/jjill.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/jjill.py
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+
+import scrapy
+from locations.items import GeojsonPointItem
+
+
+class JJillSpider(scrapy.Spider):
+    name = 'jjill'
+    item_attributes = {'brand': 'J.Jill'}
+    allowed_domains = ['jjill.com']
+    start_urls = ['https://locations.jjill.com/']
+
+    def parse(self, response):
+        urls = response.xpath('//*[@class="indexpage_node"]/a/@href').extract()
+        if urls:
+            for url in urls:
+                yield scrapy.Request(response.urljoin(url), callback=self.parse)
+        else:
+            name = response.xpath('//*[@class="store-name"]/text()').extract_first()
+            street = response.xpath('//*[@itemprop="streetAddress"]//text()').extract_first()
+            city = response.xpath('//*[@itemprop="addressLocality"]/text()').extract_first()
+            state = response.xpath('//*[@itemprop="addressRegion"]/text()').extract_first()
+            postalcode = response.xpath('//*[@itemprop="postalCode"]/text()').extract_first()
+            country = response.xpath('//*[@itemprop="addressCountry"]/text()').extract_first()
+            phone = response.xpath('//*[@itemprop="telephone"]/text()').extract_first()
+            latitude = response.xpath('//*[@property="place:location:latitude"]/@content').extract_first()
+            longitude = response.xpath('//*[@property="place:location:longitude"]/@content').extract_first()
+            ref = response.url.strip('/').split('/')[-1]
+            hours = response.xpath('//h2[text()="Store Hours"]/following-sibling::div[@class="desktop"]/div[contains(@class, "day-hours")]')
+            properties = {
+                'name': name.strip(),
+                'ref': ref,
+                'street': street.strip(),
+                'city': city.strip(),
+                'postcode': postalcode.strip(),
+                'state': state.strip(),
+                'country': country.strip(),
+                'phone': phone.strip(),
+                'website': response.url,
+                'lat': float(latitude),
+                'lon': float(longitude),
+                'opening_hours': self.parse_hours(hours) if hours else None
+            }
+            yield GeojsonPointItem(**properties)
+
+    def parse_hours(self, store_hours):
+        opening_hours = []
+
+        for day_hour in store_hours:
+            day = day_hour.xpath('.//*[@class="day"]/text()').extract_first().strip(" :").title()
+            hrs = day_hour.xpath('.//*[@class="hr"]/text()').extract_first()
+            if "closed" in hrs.lower():
+                continue
+            opening_hours.append(f"{day[:2]} {hrs}")
+
+        return "; ".join(opening_hours)


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Duluth Trading Company
https://www.duluthtrading.com/our-stores/


Discussion:
This issue hasn't been worked on in a while. I'm removing the assignment so others can work on it. If you're still working on it, please reassign yourself and reference a pull request or branch where you're doing your work.

Resolving patch:
diff --git a/locations/spiders/duluthtrading.py b/locations/spiders/duluthtrading.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/duluthtrading.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+import json
+
+import scrapy
+from locations.items import GeojsonPointItem
+
+
+class DuluthTradingSpider(scrapy.Spider):
+    name = 'duluthtrading'
+    item_attributes = {'brand': 'Duluth Trading'}
+    allowed_domains = ['duluthtrading.com']
+    start_urls = ['https://www.duluthtrading.com/find-stores/?brand=duluth']
+
+    def parse(self, response):
+        locations = json.loads(response.xpath('//div/@data-storejson').extract_first())
+        for data in locations:
+            street = data.get('address1')
+            city = data.get('city')
+            ref = data.get('id')
+            properties = {
+                'name': data.get('name'),
+                'ref': ref,
+                'street': street,
+                'city': city,
+                'postcode': data.get('postalCode'),
+                'state': data.get('stateCode'),
+                'country': data.get('countryCode'),
+                'phone': data.get('phone'),
+                'website': f"https://www.duluthtrading.com/locations/?StoreID={ref}&street-address={street}&city={city}",
+                'lat': float(data.get('latitude', 0)),
+                'lon': float(data.get('longitude', 0)),
+            }
+            yield GeojsonPointItem(**properties)


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Charleys Philly Steaks
https://charleys.com/stores


Discussion:

Resolving patch:
diff --git a/locations/spiders/charleys_philly_steaks.py b/locations/spiders/charleys_philly_steaks.py
new file mode 100644
--- /dev/null
+++ b/locations/spiders/charleys_philly_steaks.py
@@ -0,0 +1,67 @@
+# -*- coding: utf-8 -*-
+import json
+import re
+
+import scrapy
+import csv
+
+from locations.items import GeojsonPointItem
+from locations.hours import OpeningHours
+
+DAY_MAPPING = {'Mon': 'Mo',
+               'Tue': 'Tu',
+               'Wed': 'We',
+               'Thu': 'Th',
+               'Fri': 'Fr',
+               'Sat': 'Sa',
+               'Sun': 'Su'}
+
+
+class CharleysPhillySteaksSpider(scrapy.Spider):
+    name = "charleys_philly_steaks"
+    allowed_domains = ['charleys.com']
+    start_urls = [
+        'https://charleys.com/storelocator/StoreList/StoreList.ashx',
+    ]
+
+    def parse_hours(self, hours):
+        opening_hours = OpeningHours()
+
+        hours_list = hours.split("<br />")
+
+        if len(hours_list) != 1:
+            for days in hours_list:
+                if days != "":
+                    day, h = days.split(": ")
+                    day = DAY_MAPPING[day]
+                    if h != "Closed":
+                        open_time, close_time = h.split(" - ")
+                        if close_time == "0:00AM":
+                            close_time = "12:00AM"
+                            opening_hours.add_range(day=day,
+                                                    open_time=open_time,
+                                                    close_time=close_time,
+                                                    time_format='%I:%M%p'
+                                                    )
+
+        return opening_hours.as_opening_hours()
+
+    def parse(self, response):
+        for row in csv.DictReader(response.body_as_unicode().splitlines()):
+            properties = {
+                'ref': row["store_id"],
+                'name': row["store_name"],
+                'addr_full': row["address1"],
+                'city': row["city"],
+                'state': row["state"],
+                'postcode': row["zip"],
+                'lat': row["lat"],
+                'lon': row["lng"],
+                'phone': row["phone1"]
+            }
+
+            hours = self.parse_hours(row["hours"])
+            if hours:
+                properties["opening_hours"] = hours
+
+            yield GeojsonPointItem(**properties)


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Spider wyndham is broken
During the global build at 2021-10-20-14-42-48, spider **wyndham** failed with **116 features** and **1 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/logs/wyndham.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/wyndham.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/wyndham.geojson))


Discussion:

Resolving patch:
diff --git a/locations/spiders/wyndham.py b/locations/spiders/wyndham.py
--- a/locations/spiders/wyndham.py
+++ b/locations/spiders/wyndham.py
@@ -3,6 +3,7 @@
 import re
 import scrapy
 from locations.items import GeojsonPointItem
+from urllib.parse import urlparse, parse_qs
 
 BRAND_MAP = {
     "hj": "hojo",
@@ -91,19 +92,6 @@
     "Chile": "CL",
     "Colombia": "CO",
 }
-HEADERS = {
-    "Host": "www.wyndhamhotels.com",
-    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0",
-    "Accept": "*/*",
-    "Accept-Language": "en-US,en;q=0.5",
-    "Accept-Encoding": "gzip, deflate, br",
-    "X-Requested-With": "XMLHttpRequest",
-    "DNT": "1",
-    "Connection": "keep-alive",
-    "Referer": "https://www.wyndhamhotels.com/locations",
-    "TE": "Trailers",
-}
-
 
 
 def create_url(brand, city, state, unique_url, tier_id):
@@ -126,15 +114,25 @@ def create_url(brand, city, state, unique_url, tier_id):
 
 class WyndhamSpider(scrapy.Spider):
     name = "wyndham"
+    download_speed = 0.7
     allowed_domains = ["www.wyndhamhotels.com"]
-    headers = HEADERS
-
-    def start_requests(self):
-        start_url = "https://www.wyndhamhotels.com/BWSServices/services/search/properties?recordsPerPage=&pageNumber=1&brandId=ALL&countryCode=&noPropertyData=false"
-        yield scrapy.Request(start_url, callback=self.parse, headers=self.headers)
+    start_urls = (
+        'https://www.wyndhamhotels.com/BWSServices/services/search/properties?recordsPerPage=50&pageNumber=1&brandId=ALL&countryCode=US%2CCA%2CMX',
+    )
 
     def parse(self, response):
         data = json.loads(response.text)
+
+        page_count = data.get('pageCount')
+        parsed_url = urlparse(response.request.url)
+        parsed_args = parse_qs(parsed_url.query)
+        page_number = int(parsed_args['pageNumber'][0])
+        if page_number <= page_count:
+            next_page_number = page_number + 1
+            yield scrapy.Request(
+                f'https://www.wyndhamhotels.com/BWSServices/services/search/properties?recordsPerPage=50&pageNumber={next_page_number}&brandId=ALL&countryCode=US%2CCA%2CMX',
+            )
+
         for country in data["countries"]:
             country_code = country["countryCode"]
             for state in country["states"]:
@@ -158,7 +156,6 @@ def parse(self, response):
                                 "country_code": country_code,
                                 "brand_name": brand_name,
                             },
-                            headers=HEADERS,
                         )
 
     def parse_property(self, response):


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Spider alnatura_de is broken
During the global build at 2021-08-25-14-42-15, spider **alnatura_de** failed with **134 features** and **5 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-08-25-14-42-15/logs/alnatura_de.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-08-25-14-42-15/output/alnatura_de.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-08-25-14-42-15/output/alnatura_de.geojson))


Discussion:

Resolving patch:
diff --git a/locations/spiders/alnatura_de.py b/locations/spiders/alnatura_de.py
--- a/locations/spiders/alnatura_de.py
+++ b/locations/spiders/alnatura_de.py
@@ -28,8 +28,8 @@ def parse_hours(self, store_hours):
         if match:
             from_day = match.group(1).strip()
             to_day = match.group(2).strip()
-            from_time = match.group(3).strip()
-            to_time = match.group(4).strip()
+            from_time = match.group(3).strip().replace(':','.')
+            to_time = match.group(4).strip().replace(':','.')
 
             fhours = int(float(from_time))
             fminutes = (float(from_time) * 60) % 60
@@ -38,13 +38,13 @@ def parse_hours(self, store_hours):
             tminutes = (float(to_time) * 60) % 60
             fmt_to_time = "%d:%02d" % (thours, tminutes)
 
-        for day in range(DAY_MAPPING[from_day], DAY_MAPPING[to_day] + 1):
-            opening_hours.add_range(
-                day=DAY_MAPPING[day],
-                open_time=fmt_from_time,
-                close_time=fmt_to_time,
-                time_format='%H:%M'
-            )
+            for day in range(DAY_MAPPING[from_day], DAY_MAPPING[to_day] + 1):
+                opening_hours.add_range(
+                    day=DAY_MAPPING[day],
+                    open_time=fmt_from_time,
+                    close_time=fmt_to_time,
+                    time_format='%H:%M'
+                )
 
         return opening_hours.as_opening_hours()
 


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Spider vetco is broken
During the global build at 2021-09-01-14-42-16, spider **vetco** failed with **0 features** and **24644 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-09-01-14-42-16/logs/vetco.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-09-01-14-42-16/output/vetco.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-09-01-14-42-16/output/vetco.geojson))


Discussion:

Resolving patch:
diff --git a/locations/spiders/vetco_clinic.py b/locations/spiders/vetco_clinic.py
--- a/locations/spiders/vetco_clinic.py
+++ b/locations/spiders/vetco_clinic.py
@@ -38,7 +38,7 @@ def parse(self, response):
             if clinics:
                 for stores in clinics:
                     body = stores['label']
-                    address = Selector(text=body).xpath('//div[@class="locationinfo_area"]/address/text()').extract()
+                    address = Selector(text=body).xpath('//address/text()').extract()
                     if len(address) == 3:
                         addr_full, city_state_postal, phone = [item.split(",") for item in address]
                         city, state_postal = [item.split(",") for item in city_state_postal]


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Spider kopps is broken
During the global build at 2021-06-16-14-42-20, spider **kopps** failed with **0 features** and **1 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-06-16-14-42-20/logs/kopps.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-06-16-14-42-20/output/kopps.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-06-16-14-42-20/output/kopps.geojson))


Discussion:

Resolving patch:
diff --git a/locations/spiders/kopps.py b/locations/spiders/kopps.py
--- a/locations/spiders/kopps.py
+++ b/locations/spiders/kopps.py
@@ -26,8 +26,9 @@ def parse_day(self, day):
             osm_days = []
             if len(days) == 2:
                 for day in days:
-                    osm_day = DAY_MAPPING[day.strip()]
-                    osm_days.append(osm_day)
+                    if day.strip() in DAY_MAPPING:
+                        osm_day = DAY_MAPPING[day.strip()]
+                        osm_days.append(osm_day)
             return "-".join(osm_days)
 
     def parse_times(self, times):
@@ -69,7 +70,8 @@ def parse_hours(self, lis):
             if times and day:
                 parsed_time = self.parse_times(times)
                 parsed_day = self.parse_day(day)
-                hours.append(parsed_day + ' ' + parsed_time)
+                if parsed_day and parsed_time:
+                    hours.append(parsed_day + ' ' + parsed_time)
 
         return "; ".join(hours)
 


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Spider xpo_logistics is broken
During the global build at 2021-10-20-14-42-48, spider **xpo_logistics** failed with **0 features** and **1 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/logs/xpo_logistics.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/xpo_logistics.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-10-20-14-42-48/output/xpo_logistics.geojson))


Discussion:

Resolving patch:
diff --git a/locations/spiders/xpo_logistics.py b/locations/spiders/xpo_logistics.py
--- a/locations/spiders/xpo_logistics.py
+++ b/locations/spiders/xpo_logistics.py
@@ -1,28 +1,29 @@
 # -*- coding: utf-8 -*-
-import scrapy
-import re
 import ast
+
+import scrapy
+
 from locations.items import GeojsonPointItem
 
+
 class XPOLogisticsSpider(scrapy.Spider):
     name = "xpo_logistics"
-    item_attributes = { 'brand': "XPO Logistics" }
+    item_attributes = { 'brand': "XPO Logistics", 'brand_wikidata': 'Q8042415' }
     allowed_domains = ["www.xpo.com"]
     start_urls = (
         'https://www.xpo.com/global-locations/',
     )
 
     def parse(self, response):
-        script = response.xpath('//script[contains(.,"globalLocationsArray")]').extract_first()
-        data = re.search(r'globalLocationsArray = (.*);', script).groups()[0]
-        data = ast.literal_eval(data)
+        script = response.xpath('//script[@id="globalLocations"]/text()').extract_first()
+        data = ast.literal_eval(script)
 
         for store in data:
             yield GeojsonPointItem(
                 lat=float(store['latitude']),
                 lon=float(store['longitude'].replace(',','')),
                 phone=store['telephone'],
-                ref=store['office_name'],
+                ref=f"{store['office_name']}-{store['postal_code']}",
                 addr_full=store['street'],
                 city=store['city'],
                 state=store['state'],
@@ -30,5 +31,3 @@ def parse(self, response):
                 country=store['country'],
                 name=store['office_name']
             )
-
-


Test patch:
Repository: alltheplaces/alltheplaces

Issue:
Spider upsstore is broken
During the global build at 2021-10-13-14-42-23, spider **upsstore** failed with **5176 features** and **5 errors**.

Here's [the log](https://data.alltheplaces.xyz/runs/2021-10-13-14-42-23/logs/upsstore.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-10-13-14-42-23/output/upsstore.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-10-13-14-42-23/output/upsstore.geojson))


Discussion:

Resolving patch:
diff --git a/locations/spiders/upsstore.py b/locations/spiders/upsstore.py
--- a/locations/spiders/upsstore.py
+++ b/locations/spiders/upsstore.py
@@ -43,6 +43,9 @@ def parse_hours(self, hours):
         return o.as_opening_hours()
 
     def parse_store(self, response):
+        if "Permanently Closed" in response.text:
+            return
+
         ref = response.xpath('//input[@id="store_id"]/@value').extract_first()
         if not ref:
             ref = re.search(r'store(\d+)@theupsstore.com',


Test patch: