prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Spider rentacenter is broken
  During the global build at 2021-05-26-14-42-23, spider **rentacenter** failed with **2196 features** and **1 errors**.
  
  Here's [the log](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/logs/rentacenter.log) and [the output](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/rentacenter.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/rentacenter.geojson))
  
  </issue>
  <code>
  [start of locations/spiders/rentacenter.py]
  1 import json
  2 import scrapy
  3 import re
  4 from scrapy.selector import Selector
  5 
  6 from locations.items import GeojsonPointItem
  7 from locations.hours import OpeningHours
  8 
  9 
  10 DAY_MAPPING = {
  11     'Monday': 'Mo',
  12     'Tuesday': 'Tu',
  13     'Wednesday': 'We',
  14     'Thursday': 'Th',
  15     'Friday': 'Fr',
  16     'Saturday': 'Sa',
  17     'Sunday': 'Su'
  18 }
  19 
  20 
  21 class RentACenterSpider(scrapy.Spider):
  22     name = "rentacenter"
  23     item_attributes = { 'brand': "Rent-A-Center" }
  24     allowed_domains = ["rentacenter.com"]
  25 
  26     start_urls = [
  27         "https://locations.rentacenter.com/sitemap.xml",
  28     ]
  29 
  30     def parse_hours(self, hours):
  31         opening_hours = OpeningHours()
  32 
  33         for hour in hours:
  34             opening_hours.add_range(day=DAY_MAPPING[hour["dayOfWeek"].replace('http://schema.org/', '')],
  35                                     open_time=hour["opens"],
  36                                     close_time=hour["closes"],
  37                                     time_format='%H:%M:%S')
  38 
  39         return opening_hours.as_opening_hours()
  40 
  41     def parse_location(self, response):
  42         data = response.xpath('//script[@type="application/ld+json"]/text()').extract_first()
  43         data = json.loads(data)
  44 
  45         ref = data.get("branchCode")
  46         if not ref:
  47             return  # not a store page
  48 
  49         properties = {
  50             'addr_full': data["address"]["streetAddress"],
  51             'phone': data["telephone"],
  52             'city': data["address"]["addressLocality"],
  53             'state': data["address"]["addressRegion"],
  54             'postcode': data["address"]["postalCode"],
  55             'country': 'US',
  56             'ref': ref,
  57             'website': response.url,
  58             'lat': float(data["geo"]["latitude"]),
  59             'lon': float(data["geo"]["longitude"]),
  60             'name': data["name"]
  61         }
  62 
  63         hours = self.parse_hours(data.get("openingHoursSpecification", []))
  64         if hours:
  65             properties["opening_hours"] = hours
  66 
  67         yield GeojsonPointItem(**properties)
  68 
  69     def parse_state_sitemap(self, response):
  70         xml = Selector(response)
  71         xml.remove_namespaces()
  72 
  73         urls = xml.xpath('//loc/text()').extract()
  74         urls = [url.strip() for url in urls]
  75 
  76         # individual store pages are listed at top, then a state page, then bunch of other non-store pages
  77         # find the index position of the state page and then only parse urls before that
  78         i = urls.index(re.search(r'^(https://locations.rentacenter.com/.+?)/.*$', urls[0]).groups()[0] + '/')
  79         for url in urls[:i]:
  80             yield scrapy.Request(url, callback=self.parse_location)
  81 
  82     def parse(self, response):
  83         xml = Selector(response)
  84         xml.remove_namespaces()
  85 
  86         urls = xml.xpath('//loc/text()').extract()
  87         urls = [url.strip() for url in urls]
  88 
  89         for url in urls:
  90             yield scrapy.Request(url, callback=self.parse_state_sitemap)
  91 
  92
  [end of locations/spiders/rentacenter.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/locations/spiders/rentacenter.py b/locations/spiders/rentacenter.py
  --- a/locations/spiders/rentacenter.py
  +++ b/locations/spiders/rentacenter.py
  @@ -48,15 +48,15 @@
   
           properties = {
               'addr_full': data["address"]["streetAddress"],
  -            'phone': data["telephone"],
  +            'phone': data.get("telephone"),
               'city': data["address"]["addressLocality"],
               'state': data["address"]["addressRegion"],
               'postcode': data["address"]["postalCode"],
               'country': 'US',
               'ref': ref,
               'website': response.url,
  -            'lat': float(data["geo"]["latitude"]),
  -            'lon': float(data["geo"]["longitude"]),
  +            'lat': data["geo"]["latitude"],
  +            'lon': data["geo"]["longitude"],
               'name': data["name"]
           }
   
  @@ -87,5 +87,7 @@
           urls = [url.strip() for url in urls]
   
           for url in urls:
  +            if '/home/' in url:
  +                continue
               yield scrapy.Request(url, callback=self.parse_state_sitemap)
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/rentacenter.py b/locations/spiders/rentacenter.py\n--- a/locations/spiders/rentacenter.py\n+++ b/locations/spiders/rentacenter.py\n@@ -48,15 +48,15 @@\n \n         properties = {\n             'addr_full': data[\"address\"][\"streetAddress\"],\n-            'phone': data[\"telephone\"],\n+            'phone': data.get(\"telephone\"),\n             'city': data[\"address\"][\"addressLocality\"],\n             'state': data[\"address\"][\"addressRegion\"],\n             'postcode': data[\"address\"][\"postalCode\"],\n             'country': 'US',\n             'ref': ref,\n             'website': response.url,\n-            'lat': float(data[\"geo\"][\"latitude\"]),\n-            'lon': float(data[\"geo\"][\"longitude\"]),\n+            'lat': data[\"geo\"][\"latitude\"],\n+            'lon': data[\"geo\"][\"longitude\"],\n             'name': data[\"name\"]\n         }\n \n@@ -87,5 +87,7 @@\n         urls = [url.strip() for url in urls]\n \n         for url in urls:\n+            if '/home/' in url:\n+                continue\n             yield scrapy.Request(url, callback=self.parse_state_sitemap)\n", "issue": "Spider rentacenter is broken\nDuring the global build at 2021-05-26-14-42-23, spider **rentacenter** failed with **2196 features** and **1 errors**.\n\nHere's [the log](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/logs/rentacenter.log) and [the output](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/rentacenter.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/rentacenter.geojson))\n", "before_files": [{"content": "import json\nimport scrapy\nimport re\nfrom scrapy.selector import Selector\n\nfrom locations.items import GeojsonPointItem\nfrom locations.hours import OpeningHours\n\n\nDAY_MAPPING = {\n    'Monday': 'Mo',\n    'Tuesday': 'Tu',\n    'Wednesday': 'We',\n    'Thursday': 'Th',\n    'Friday': 'Fr',\n    'Saturday': 'Sa',\n    'Sunday': 'Su'\n}\n\n\nclass RentACenterSpider(scrapy.Spider):\n    name = \"rentacenter\"\n    item_attributes = { 'brand': \"Rent-A-Center\" }\n    allowed_domains = [\"rentacenter.com\"]\n\n    start_urls = [\n        \"https://locations.rentacenter.com/sitemap.xml\",\n    ]\n\n    def parse_hours(self, hours):\n        opening_hours = OpeningHours()\n\n        for hour in hours:\n            opening_hours.add_range(day=DAY_MAPPING[hour[\"dayOfWeek\"].replace('http://schema.org/', '')],\n                                    open_time=hour[\"opens\"],\n                                    close_time=hour[\"closes\"],\n                                    time_format='%H:%M:%S')\n\n        return opening_hours.as_opening_hours()\n\n    def parse_location(self, response):\n        data = response.xpath('//script[@type=\"application/ld+json\"]/text()').extract_first()\n        data = json.loads(data)\n\n        ref = data.get(\"branchCode\")\n        if not ref:\n            return  # not a store page\n\n        properties = {\n            'addr_full': data[\"address\"][\"streetAddress\"],\n            'phone': data[\"telephone\"],\n            'city': data[\"address\"][\"addressLocality\"],\n            'state': data[\"address\"][\"addressRegion\"],\n            'postcode': data[\"address\"][\"postalCode\"],\n            'country': 'US',\n            'ref': ref,\n            'website': response.url,\n            'lat': float(data[\"geo\"][\"latitude\"]),\n            'lon': float(data[\"geo\"][\"longitude\"]),\n            'name': data[\"name\"]\n        }\n\n        hours = self.parse_hours(data.get(\"openingHoursSpecification\", []))\n        if hours:\n            properties[\"opening_hours\"] = hours\n\n        yield GeojsonPointItem(**properties)\n\n    def parse_state_sitemap(self, response):\n        xml = Selector(response)\n        xml.remove_namespaces()\n\n        urls = xml.xpath('//loc/text()').extract()\n        urls = [url.strip() for url in urls]\n\n        # individual store pages are listed at top, then a state page, then bunch of other non-store pages\n        # find the index position of the state page and then only parse urls before that\n        i = urls.index(re.search(r'^(https://locations.rentacenter.com/.+?)/.*$', urls[0]).groups()[0] + '/')\n        for url in urls[:i]:\n            yield scrapy.Request(url, callback=self.parse_location)\n\n    def parse(self, response):\n        xml = Selector(response)\n        xml.remove_namespaces()\n\n        urls = xml.xpath('//loc/text()').extract()\n        urls = [url.strip() for url in urls]\n\n        for url in urls:\n            yield scrapy.Request(url, callback=self.parse_state_sitemap)\n\n", "path": "locations/spiders/rentacenter.py"}]}