prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Wendy's
  e.g. https://locations.wendys.com/jamestown-ny-3438
  
  </issue>
  <code>
  [start of locations/spiders/wendys.py]
  1 import scrapy
  2 import re
  3 import json
  4 from locations.items import GeojsonPointItem
  5 
  6 DAY_MAPPING = {
  7     'Monday': 'Mo',
  8     'Tuesday': 'Tu',
  9     'Wednesday': 'We',
  10     'Thursday': 'Th',
  11     'Friday': 'Fr',
  12     'Saturday': 'Sa',
  13     'Sunday': 'Su'
  14 }
  15 
  16 
  17 class WendysSpider(scrapy.Spider):
  18 
  19     name = "wendys"
  20     allowed_domains = ["locations.wendys.com"]
  21     download_delay = 0
  22     download_timeout = 30
  23     start_urls = (
  24         'https://locations.wendys.com',
  25     )
  26 
  27     def handle_error(self, failure):
  28         self.log("Request failed: %s" % failure.request)
  29     def parse_day(self, day):
  30             return DAY_MAPPING[day.strip()]
  31     def parse_times(self, times):
  32         hours_to = [x.strip() for x in times.split('-')]
  33         cleaned_times = []
  34 
  35         for hour in hours_to:
  36             if re.search('pm$', hour):
  37                 hour = re.sub('pm', '', hour).strip()
  38                 hour_min = hour.split(":")
  39                 if int(hour_min[0]) < 12:
  40                     hour_min[0] = str(12 + int(hour_min[0]))
  41                 cleaned_times.append(":".join(hour_min))
  42 
  43             if re.search('am$', hour):
  44                 hour = re.sub('am', '', hour).strip()
  45                 hour_min = hour.split(":")
  46                 if len(hour_min[0]) <2:
  47                     hour_min[0] = hour_min[0].zfill(2)
  48                 else:
  49                     hour_min[0] = str(int(hour_min[0]))
  50 
  51                 cleaned_times.append(":".join(hour_min))
  52         return "-".join(cleaned_times)
  53 
  54     def parse_hours(self, lis):
  55         hours = []
  56         for li in lis:
  57             day = li.xpath('./span[@class="day"]/text()').extract()[1]
  58             times = li.xpath('./span[2]/text()').extract_first()
  59             if times and day:
  60                 parsed_time = self.parse_times(times)
  61                 parsed_day = self.parse_day(day)
  62                 hours.append(parsed_day + ' ' + parsed_time)
  63 
  64         return "; ".join(hours)
  65     def parse_stores(self, response):
  66         page_content = response.body_as_unicode()
  67         json_content = re.findall('li.data.results =[^;]+' , page_content)
  68         if len(json_content)>0:
  69             json_content =  json_content[0].replace('li.data.results =' ,'')
  70         json_data =  json.loads(json_content)
  71         properties = {
  72             'addr_full': json_data[0]['address'],
  73             'phone':json_data[0]['phone'],
  74             'city': json_data[0]['city'],
  75             'state':json_data[0]['state'],
  76             'postcode': json_data[0]['postal'],
  77             'ref': json_data[0]['id'],
  78             'website': response.url,
  79             'lat': json_data[0]['lat'],
  80             'lon': json_data[0]['lon'],
  81         }
  82         hours = self.parse_hours(response.xpath('//div[@class="hours"]/ol/li'))
  83         if hours:
  84             properties['opening_hours'] = hours
  85 
  86         yield GeojsonPointItem(**properties)
  87 
  88     def parse_city_stores(self, response):
  89         stores = response.xpath('//div[@class="col-xs-12 col-lg-10 col-lg-offset-1"]/article/ul/li/a/@href').extract()
  90         for store in stores:
  91             if store:
  92                 yield scrapy.Request(response.urljoin(store), callback=self.parse_stores ,errback=self.handle_error)
  93 
  94     def parse_state(self, response):
  95         city_urls = response.xpath('//div[@class="col-xs-12 col-lg-10 col-lg-offset-1"]/article/div[@class="col"]/ul/li/a/@href').extract()
  96         for path in city_urls:
  97             yield scrapy.Request(response.urljoin(path), callback=self.parse_city_stores ,errback=self.handle_error)
  98 
  99     def parse(self, response):
  100         urls = response.xpath('//div[@class="col-xs-12 col-lg-10 col-lg-offset-1"]/article/div[@class="col"]/ul/li/a/@href').extract()
  101         for path in urls:
  102             yield scrapy.Request(response.urljoin(path), callback=self.parse_state ,errback=self.handle_error)
  103
  [end of locations/spiders/wendys.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/wendys.py b/locations/spiders/wendys.py
  --- a/locations/spiders/wendys.py
  +++ b/locations/spiders/wendys.py
  @@ -18,7 +18,7 @@
   
       name = "wendys"
       allowed_domains = ["locations.wendys.com"]
  -    download_delay = 0
  +    download_delay = 0.5
       download_timeout = 30
       start_urls = (
           'https://locations.wendys.com',
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/wendys.py b/locations/spiders/wendys.py\n--- a/locations/spiders/wendys.py\n+++ b/locations/spiders/wendys.py\n@@ -18,7 +18,7 @@\n \n     name = \"wendys\"\n     allowed_domains = [\"locations.wendys.com\"]\n-    download_delay = 0\n+    download_delay = 0.5\n     download_timeout = 30\n     start_urls = (\n         'https://locations.wendys.com',\n", "issue": "Wendy's\ne.g. https://locations.wendys.com/jamestown-ny-3438\n", "before_files": [{"content": "import scrapy\nimport re\nimport json\nfrom locations.items import GeojsonPointItem\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 WendysSpider(scrapy.Spider):\n\n    name = \"wendys\"\n    allowed_domains = [\"locations.wendys.com\"]\n    download_delay = 0\n    download_timeout = 30\n    start_urls = (\n        'https://locations.wendys.com',\n    )\n\n    def handle_error(self, failure):\n        self.log(\"Request failed: %s\" % failure.request)\n    def parse_day(self, day):\n            return DAY_MAPPING[day.strip()]\n    def parse_times(self, times):\n        hours_to = [x.strip() for x in times.split('-')]\n        cleaned_times = []\n\n        for hour in hours_to:\n            if re.search('pm$', hour):\n                hour = re.sub('pm', '', hour).strip()\n                hour_min = hour.split(\":\")\n                if int(hour_min[0]) < 12:\n                    hour_min[0] = str(12 + int(hour_min[0]))\n                cleaned_times.append(\":\".join(hour_min))\n\n            if re.search('am$', hour):\n                hour = re.sub('am', '', hour).strip()\n                hour_min = hour.split(\":\")\n                if len(hour_min[0]) <2:\n                    hour_min[0] = hour_min[0].zfill(2)\n                else:\n                    hour_min[0] = str(int(hour_min[0]))\n\n                cleaned_times.append(\":\".join(hour_min))\n        return \"-\".join(cleaned_times)\n\n    def parse_hours(self, lis):\n        hours = []\n        for li in lis:\n            day = li.xpath('./span[@class=\"day\"]/text()').extract()[1]\n            times = li.xpath('./span[2]/text()').extract_first()\n            if times and day:\n                parsed_time = self.parse_times(times)\n                parsed_day = self.parse_day(day)\n                hours.append(parsed_day + ' ' + parsed_time)\n\n        return \"; \".join(hours)\n    def parse_stores(self, response):\n        page_content = response.body_as_unicode()\n        json_content = re.findall('li.data.results =[^;]+' , page_content)\n        if len(json_content)>0:\n            json_content =  json_content[0].replace('li.data.results =' ,'')\n        json_data =  json.loads(json_content)\n        properties = {\n            'addr_full': json_data[0]['address'],\n            'phone':json_data[0]['phone'],\n            'city': json_data[0]['city'],\n            'state':json_data[0]['state'],\n            'postcode': json_data[0]['postal'],\n            'ref': json_data[0]['id'],\n            'website': response.url,\n            'lat': json_data[0]['lat'],\n            'lon': json_data[0]['lon'],\n        }\n        hours = self.parse_hours(response.xpath('//div[@class=\"hours\"]/ol/li'))\n        if hours:\n            properties['opening_hours'] = hours\n\n        yield GeojsonPointItem(**properties)\n\n    def parse_city_stores(self, response):\n        stores = response.xpath('//div[@class=\"col-xs-12 col-lg-10 col-lg-offset-1\"]/article/ul/li/a/@href').extract()\n        for store in stores:\n            if store:\n                yield scrapy.Request(response.urljoin(store), callback=self.parse_stores ,errback=self.handle_error)\n\n    def parse_state(self, response):\n        city_urls = response.xpath('//div[@class=\"col-xs-12 col-lg-10 col-lg-offset-1\"]/article/div[@class=\"col\"]/ul/li/a/@href').extract()\n        for path in city_urls:\n            yield scrapy.Request(response.urljoin(path), callback=self.parse_city_stores ,errback=self.handle_error)\n\n    def parse(self, response):\n        urls = response.xpath('//div[@class=\"col-xs-12 col-lg-10 col-lg-offset-1\"]/article/div[@class=\"col\"]/ul/li/a/@href').extract()\n        for path in urls:\n            yield scrapy.Request(response.urljoin(path), callback=self.parse_state ,errback=self.handle_error)\n", "path": "locations/spiders/wendys.py"}]}