prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Spider tmobile_us is broken
  During the global build at 2021-05-26-14-42-23, spider **tmobile_us** failed with **7356 features** and **2 errors**.
  
  Here's [the log](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/logs/tmobile_us.log) and [the output](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/tmobile_us.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/tmobile_us.geojson))
  
  </issue>
  <code>
  [start of locations/spiders/tmobile_us.py]
  1 # -*- coding: utf-8 -*-
  2 import json
  3 from urllib.parse import urlencode
  4 
  5 import scrapy
  6 
  7 from locations.items import GeojsonPointItem
  8 from locations.hours import OpeningHours
  9 
  10 DAY_MAPPING = {'Monday': 'Mo',
  11                'Tuesday': 'Tu',
  12                'Wednesday': 'We',
  13                'Thursday': 'Th',
  14                'Friday': 'Fr',
  15                'Saturday': 'Sa',
  16                'Sunday': 'Su'}
  17 
  18 BASE_URL = 'https://onmyj41p3c.execute-api.us-west-2.amazonaws.com/prod/getStoresByCoordinates?'
  19 
  20 
  21 class TMobileUSSpider(scrapy.Spider):
  22     name = "tmobile_us"
  23     item_attributes = { 'brand': "T-Mobile" }
  24     allowed_domains = ["www.t-mobile.com"]
  25     download_delay = 0.2
  26 
  27     def parse_hours(self, store_hours):
  28         opening_hours = OpeningHours()
  29         if store_hours is None:
  30             return
  31 
  32         for store_day in store_hours:
  33             day = DAY_MAPPING[store_day.get("day")]
  34             open_time = store_day.get("opens")
  35             close_time = store_day.get("closes")
  36             if open_time is None and close_time is None:
  37                 continue
  38             opening_hours.add_range(day=day,
  39                                     open_time=open_time,
  40                                     close_time=close_time,
  41                                     time_format='%H:%M'
  42                                     )
  43 
  44         return opening_hours.as_opening_hours()
  45 
  46     def start_requests(self):
  47         url = BASE_URL
  48 
  49         with open('./locations/searchable_points/us_centroids_25mile_radius.csv') as points:
  50 
  51             next(points)  # Ignore the header
  52             for point in points:
  53                 _, lat, lon = point.strip().split(',')
  54 
  55                 params = {
  56                     'latitude': '{}'.format(lat),
  57                     'longitude': '{}'.format(lon),
  58                     'count': '1000',
  59                     'radius': '25',
  60                     'ignoreLoadingBar': 'false'
  61                 }
  62 
  63                 yield scrapy.http.Request(url + urlencode(params), callback=self.parse)
  64 
  65     def parse(self, response):
  66         data = json.loads(response.body_as_unicode())
  67 
  68         for store in data:
  69             properties = {
  70                 'name': store["name"],
  71                 'ref': store["id"],
  72                 'addr_full': store["location"]["address"]["streetAddress"],
  73                 'city': store["location"]["address"]["addressLocality"],
  74                 'state': store["location"]["address"]["addressRegion"],
  75                 'postcode': store["location"]["address"]["postalCode"],
  76                 'phone': store.get("telephone"),
  77                 'website': store.get("url") or response.url,
  78                 'lat': float(store["location"]["latitude"]),
  79                 'lon': float(store["location"]["longitude"]),
  80             }
  81 
  82             hours = self.parse_hours(store.get("hours", []))
  83             if hours:
  84                 properties["opening_hours"] = hours
  85 
  86             yield GeojsonPointItem(**properties)
  87
  [end of locations/spiders/tmobile_us.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/tmobile_us.py b/locations/spiders/tmobile_us.py
  --- a/locations/spiders/tmobile_us.py
  +++ b/locations/spiders/tmobile_us.py
  @@ -15,12 +15,12 @@
                  'Saturday': 'Sa',
                  'Sunday': 'Su'}
   
  -BASE_URL = 'https://onmyj41p3c.execute-api.us-west-2.amazonaws.com/prod/getStoresByCoordinates?'
  +BASE_URL = 'https://onmyj41p3c.execute-api.us-west-2.amazonaws.com/prod/v2.1/getStoresByCoordinates?'
   
   
   class TMobileUSSpider(scrapy.Spider):
       name = "tmobile_us"
  -    item_attributes = { 'brand': "T-Mobile" }
  +    item_attributes = {'brand': "T-Mobile"}
       allowed_domains = ["www.t-mobile.com"]
       download_delay = 0.2
   
  @@ -67,7 +67,7 @@
   
           for store in data:
               properties = {
  -                'name': store["name"],
  +                'name': store.get("name"),
                   'ref': store["id"],
                   'addr_full': store["location"]["address"]["streetAddress"],
                   'city': store["location"]["address"]["addressLocality"],
  @@ -75,8 +75,8 @@
                   'postcode': store["location"]["address"]["postalCode"],
                   'phone': store.get("telephone"),
                   'website': store.get("url") or response.url,
  -                'lat': float(store["location"]["latitude"]),
  -                'lon': float(store["location"]["longitude"]),
  +                'lat': store["location"]["latitude"],
  +                'lon': store["location"]["longitude"],
               }
   
               hours = self.parse_hours(store.get("hours", []))
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/tmobile_us.py b/locations/spiders/tmobile_us.py\n--- a/locations/spiders/tmobile_us.py\n+++ b/locations/spiders/tmobile_us.py\n@@ -15,12 +15,12 @@\n                'Saturday': 'Sa',\n                'Sunday': 'Su'}\n \n-BASE_URL = 'https://onmyj41p3c.execute-api.us-west-2.amazonaws.com/prod/getStoresByCoordinates?'\n+BASE_URL = 'https://onmyj41p3c.execute-api.us-west-2.amazonaws.com/prod/v2.1/getStoresByCoordinates?'\n \n \n class TMobileUSSpider(scrapy.Spider):\n     name = \"tmobile_us\"\n-    item_attributes = { 'brand': \"T-Mobile\" }\n+    item_attributes = {'brand': \"T-Mobile\"}\n     allowed_domains = [\"www.t-mobile.com\"]\n     download_delay = 0.2\n \n@@ -67,7 +67,7 @@\n \n         for store in data:\n             properties = {\n-                'name': store[\"name\"],\n+                'name': store.get(\"name\"),\n                 'ref': store[\"id\"],\n                 'addr_full': store[\"location\"][\"address\"][\"streetAddress\"],\n                 'city': store[\"location\"][\"address\"][\"addressLocality\"],\n@@ -75,8 +75,8 @@\n                 'postcode': store[\"location\"][\"address\"][\"postalCode\"],\n                 'phone': store.get(\"telephone\"),\n                 'website': store.get(\"url\") or response.url,\n-                'lat': float(store[\"location\"][\"latitude\"]),\n-                'lon': float(store[\"location\"][\"longitude\"]),\n+                'lat': store[\"location\"][\"latitude\"],\n+                'lon': store[\"location\"][\"longitude\"],\n             }\n \n             hours = self.parse_hours(store.get(\"hours\", []))\n", "issue": "Spider tmobile_us is broken\nDuring the global build at 2021-05-26-14-42-23, spider **tmobile_us** failed with **7356 features** and **2 errors**.\n\nHere's [the log](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/logs/tmobile_us.log) and [the output](https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/tmobile_us.geojson) ([on a map](https://data.alltheplaces.xyz/map.html?show=https://data.alltheplaces.xyz/runs/2021-05-26-14-42-23/output/tmobile_us.geojson))\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport json\nfrom urllib.parse import urlencode\n\nimport scrapy\n\nfrom locations.items import GeojsonPointItem\nfrom locations.hours import OpeningHours\n\nDAY_MAPPING = {'Monday': 'Mo',\n               'Tuesday': 'Tu',\n               'Wednesday': 'We',\n               'Thursday': 'Th',\n               'Friday': 'Fr',\n               'Saturday': 'Sa',\n               'Sunday': 'Su'}\n\nBASE_URL = 'https://onmyj41p3c.execute-api.us-west-2.amazonaws.com/prod/getStoresByCoordinates?'\n\n\nclass TMobileUSSpider(scrapy.Spider):\n    name = \"tmobile_us\"\n    item_attributes = { 'brand': \"T-Mobile\" }\n    allowed_domains = [\"www.t-mobile.com\"]\n    download_delay = 0.2\n\n    def parse_hours(self, store_hours):\n        opening_hours = OpeningHours()\n        if store_hours is None:\n            return\n\n        for store_day in store_hours:\n            day = DAY_MAPPING[store_day.get(\"day\")]\n            open_time = store_day.get(\"opens\")\n            close_time = store_day.get(\"closes\")\n            if open_time is None and close_time is None:\n                continue\n            opening_hours.add_range(day=day,\n                                    open_time=open_time,\n                                    close_time=close_time,\n                                    time_format='%H:%M'\n                                    )\n\n        return opening_hours.as_opening_hours()\n\n    def start_requests(self):\n        url = BASE_URL\n\n        with open('./locations/searchable_points/us_centroids_25mile_radius.csv') as points:\n\n            next(points)  # Ignore the header\n            for point in points:\n                _, lat, lon = point.strip().split(',')\n\n                params = {\n                    'latitude': '{}'.format(lat),\n                    'longitude': '{}'.format(lon),\n                    'count': '1000',\n                    'radius': '25',\n                    'ignoreLoadingBar': 'false'\n                }\n\n                yield scrapy.http.Request(url + urlencode(params), callback=self.parse)\n\n    def parse(self, response):\n        data = json.loads(response.body_as_unicode())\n\n        for store in data:\n            properties = {\n                'name': store[\"name\"],\n                'ref': store[\"id\"],\n                'addr_full': store[\"location\"][\"address\"][\"streetAddress\"],\n                'city': store[\"location\"][\"address\"][\"addressLocality\"],\n                'state': store[\"location\"][\"address\"][\"addressRegion\"],\n                'postcode': store[\"location\"][\"address\"][\"postalCode\"],\n                'phone': store.get(\"telephone\"),\n                'website': store.get(\"url\") or response.url,\n                'lat': float(store[\"location\"][\"latitude\"]),\n                'lon': float(store[\"location\"][\"longitude\"]),\n            }\n\n            hours = self.parse_hours(store.get(\"hours\", []))\n            if hours:\n                properties[\"opening_hours\"] = hours\n\n            yield GeojsonPointItem(**properties)\n", "path": "locations/spiders/tmobile_us.py"}]}