prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Spider scooters_coffee is broken
  During the global build at 2021-06-23-14-42-18, spider **scooters_coffee** failed with **324 features** and **1 errors**.
  
  Here's [the log](https://data.alltheplaces.xyz/runs/2021-06-23-14-42-18/logs/scooters_coffee.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-06-23-14-42-18/output/scooters_coffee.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-06-23-14-42-18/output/scooters_coffee.geojson))
  
  </issue>
  <code>
  [start of locations/spiders/scooters_coffee.py]
  1 # -*- coding: utf-8 -*-
  2 import json
  3 import re
  4 
  5 import scrapy
  6 
  7 from locations.items import GeojsonPointItem
  8 from locations.hours import OpeningHours
  9 
  10 DAY_MAPPING = {'Mon': 'Mo', 'Tue': 'Tu',
  11                'Wed': 'We', 'Thu': 'Th',
  12                'Fri': 'Fr', 'Sat': 'Sa',
  13                'Sun': 'Su'}
  14 
  15 
  16 class ScootersCoffeeSpider(scrapy.Spider):
  17     name = "scooters_coffee"
  18     item_attributes = {'brand': "Scooter's Coffee"}
  19     allowed_domains = ['code.metalocator.com']
  20     download_delay = 0.5
  21 
  22     def start_requests(self):
  23         n = 327
  24         for store_id in range(1, n+1):
  25             url = f'https://code.metalocator.com/index.php?option=com_locator&view=location&tmpl=component&task=load&framed=1&sample_data=undefined&format=json&Itemid=12991&templ[]=item_address_template&lang=&_opt_out=&_urlparams=&distance=NaN&id={store_id}'
  26             
  27             yield scrapy.Request(url=url, callback=self.parse)
  28 
  29     def parse_hours(self, hours):
  30         opening_hours = OpeningHours()
  31 
  32         weekdays = re.findall(r'{(.*?)}', hours)
  33         for weekday in weekdays:
  34             day, open_close = weekday.split('|')
  35             if open_close == 'C':
  36                 continue
  37             else:
  38                 open_time, close_time = open_close.split('-')
  39                 opening_hours.add_range(day=DAY_MAPPING[day], open_time=open_time, close_time=close_time, time_format='%I:%M%p')
  40 
  41         return opening_hours.as_opening_hours()
  42 
  43     def parse(self, response):
  44         store_data = json.loads(response.text)[0]
  45         name = store_data['name']
  46         if '*permanently closed' in name.lower():
  47             pass
  48         else:  # Gather the store details
  49 
  50             properties = {
  51                 'ref': store_data['id'],
  52                 'name': store_data['name'].strip(' *COMING SOON'),
  53                 'addr_full': store_data['address'],
  54                 'city': store_data['city'],
  55                 'state': store_data['state'],
  56                 'postcode': store_data['postalcode'],
  57                 'country': store_data['country'],
  58                 'lat': store_data['lat'],
  59                 'lon': store_data['lng'],
  60                 'phone': store_data['phone'],
  61                 'website': response.url
  62             }
  63 
  64             hours = store_data.get('hours', '')
  65             if hours and hours != '{Sun|C}{Mon|C}{Tue|C}{Wed|C}{Thu|C}{Fri|C}{Sat|C}':
  66                 store_hours = self.parse_hours(hours)
  67                 properties["opening_hours"] = store_hours
  68 
  69             yield GeojsonPointItem(**properties)
  70
  [end of locations/spiders/scooters_coffee.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/scooters_coffee.py b/locations/spiders/scooters_coffee.py
  --- a/locations/spiders/scooters_coffee.py
  +++ b/locations/spiders/scooters_coffee.py
  @@ -35,6 +35,7 @@
               if open_close == 'C':
                   continue
               else:
  +                open_close = open_close.replace(' ', '')
                   open_time, close_time = open_close.split('-')
                   opening_hours.add_range(day=DAY_MAPPING[day], open_time=open_time, close_time=close_time, time_format='%I:%M%p')
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/scooters_coffee.py b/locations/spiders/scooters_coffee.py\n--- a/locations/spiders/scooters_coffee.py\n+++ b/locations/spiders/scooters_coffee.py\n@@ -35,6 +35,7 @@\n             if open_close == 'C':\n                 continue\n             else:\n+                open_close = open_close.replace(' ', '')\n                 open_time, close_time = open_close.split('-')\n                 opening_hours.add_range(day=DAY_MAPPING[day], open_time=open_time, close_time=close_time, time_format='%I:%M%p')\n", "issue": "Spider scooters_coffee is broken\nDuring the global build at 2021-06-23-14-42-18, spider **scooters_coffee** failed with **324 features** and **1 errors**.\n\nHere's [the log](https://data.alltheplaces.xyz/runs/2021-06-23-14-42-18/logs/scooters_coffee.txt) and [the output](https://data.alltheplaces.xyz/runs/2021-06-23-14-42-18/output/scooters_coffee.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-06-23-14-42-18/output/scooters_coffee.geojson))\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport json\nimport re\n\nimport scrapy\n\nfrom locations.items import GeojsonPointItem\nfrom locations.hours import OpeningHours\n\nDAY_MAPPING = {'Mon': 'Mo', 'Tue': 'Tu',\n               'Wed': 'We', 'Thu': 'Th',\n               'Fri': 'Fr', 'Sat': 'Sa',\n               'Sun': 'Su'}\n\n\nclass ScootersCoffeeSpider(scrapy.Spider):\n    name = \"scooters_coffee\"\n    item_attributes = {'brand': \"Scooter's Coffee\"}\n    allowed_domains = ['code.metalocator.com']\n    download_delay = 0.5\n\n    def start_requests(self):\n        n = 327\n        for store_id in range(1, n+1):\n            url = f'https://code.metalocator.com/index.php?option=com_locator&view=location&tmpl=component&task=load&framed=1&sample_data=undefined&format=json&Itemid=12991&templ[]=item_address_template&lang=&_opt_out=&_urlparams=&distance=NaN&id={store_id}'\n            \n            yield scrapy.Request(url=url, callback=self.parse)\n\n    def parse_hours(self, hours):\n        opening_hours = OpeningHours()\n\n        weekdays = re.findall(r'{(.*?)}', hours)\n        for weekday in weekdays:\n            day, open_close = weekday.split('|')\n            if open_close == 'C':\n                continue\n            else:\n                open_time, close_time = open_close.split('-')\n                opening_hours.add_range(day=DAY_MAPPING[day], open_time=open_time, close_time=close_time, time_format='%I:%M%p')\n\n        return opening_hours.as_opening_hours()\n\n    def parse(self, response):\n        store_data = json.loads(response.text)[0]\n        name = store_data['name']\n        if '*permanently closed' in name.lower():\n            pass\n        else:  # Gather the store details\n\n            properties = {\n                'ref': store_data['id'],\n                'name': store_data['name'].strip(' *COMING SOON'),\n                'addr_full': store_data['address'],\n                'city': store_data['city'],\n                'state': store_data['state'],\n                'postcode': store_data['postalcode'],\n                'country': store_data['country'],\n                'lat': store_data['lat'],\n                'lon': store_data['lng'],\n                'phone': store_data['phone'],\n                'website': response.url\n            }\n\n            hours = store_data.get('hours', '')\n            if hours and hours != '{Sun|C}{Mon|C}{Tue|C}{Wed|C}{Thu|C}{Fri|C}{Sat|C}':\n                store_hours = self.parse_hours(hours)\n                properties[\"opening_hours\"] = store_hours\n\n            yield GeojsonPointItem(**properties)\n", "path": "locations/spiders/scooters_coffee.py"}]}