prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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))
  
  </issue>
  <code>
  [start of locations/spiders/xpo_logistics.py]
  1 # -*- coding: utf-8 -*-
  2 import scrapy
  3 import re
  4 import ast
  5 from locations.items import GeojsonPointItem
  6 
  7 class XPOLogisticsSpider(scrapy.Spider):
  8     name = "xpo_logistics"
  9     item_attributes = { 'brand': "XPO Logistics" }
  10     allowed_domains = ["www.xpo.com"]
  11     start_urls = (
  12         'https://www.xpo.com/global-locations/',
  13     )
  14 
  15     def parse(self, response):
  16         script = response.xpath('//script[contains(.,"globalLocationsArray")]').extract_first()
  17         data = re.search(r'globalLocationsArray = (.*);', script).groups()[0]
  18         data = ast.literal_eval(data)
  19 
  20         for store in data:
  21             yield GeojsonPointItem(
  22                 lat=float(store['latitude']),
  23                 lon=float(store['longitude'].replace(',','')),
  24                 phone=store['telephone'],
  25                 ref=store['office_name'],
  26                 addr_full=store['street'],
  27                 city=store['city'],
  28                 state=store['state'],
  29                 postcode=store['postal_code'],
  30                 country=store['country'],
  31                 name=store['office_name']
  32             )
  33 
  34 
  35
  [end of locations/spiders/xpo_logistics.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/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 @@
                   country=store['country'],
                   name=store['office_name']
               )
  -
  -
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/xpo_logistics.py b/locations/spiders/xpo_logistics.py\n--- a/locations/spiders/xpo_logistics.py\n+++ b/locations/spiders/xpo_logistics.py\n@@ -1,28 +1,29 @@\n # -*- coding: utf-8 -*-\n-import scrapy\n-import re\n import ast\n+\n+import scrapy\n+\n from locations.items import GeojsonPointItem\n \n+\n class XPOLogisticsSpider(scrapy.Spider):\n     name = \"xpo_logistics\"\n-    item_attributes = { 'brand': \"XPO Logistics\" }\n+    item_attributes = { 'brand': \"XPO Logistics\", 'brand_wikidata': 'Q8042415' }\n     allowed_domains = [\"www.xpo.com\"]\n     start_urls = (\n         'https://www.xpo.com/global-locations/',\n     )\n \n     def parse(self, response):\n-        script = response.xpath('//script[contains(.,\"globalLocationsArray\")]').extract_first()\n-        data = re.search(r'globalLocationsArray = (.*);', script).groups()[0]\n-        data = ast.literal_eval(data)\n+        script = response.xpath('//script[@id=\"globalLocations\"]/text()').extract_first()\n+        data = ast.literal_eval(script)\n \n         for store in data:\n             yield GeojsonPointItem(\n                 lat=float(store['latitude']),\n                 lon=float(store['longitude'].replace(',','')),\n                 phone=store['telephone'],\n-                ref=store['office_name'],\n+                ref=f\"{store['office_name']}-{store['postal_code']}\",\n                 addr_full=store['street'],\n                 city=store['city'],\n                 state=store['state'],\n@@ -30,5 +31,3 @@\n                 country=store['country'],\n                 name=store['office_name']\n             )\n-\n-\n", "issue": "Spider xpo_logistics is broken\nDuring the global build at 2021-10-20-14-42-48, spider **xpo_logistics** failed with **0 features** and **1 errors**.\n\nHere'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))\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport scrapy\nimport re\nimport ast\nfrom locations.items import GeojsonPointItem\n\nclass XPOLogisticsSpider(scrapy.Spider):\n    name = \"xpo_logistics\"\n    item_attributes = { 'brand': \"XPO Logistics\" }\n    allowed_domains = [\"www.xpo.com\"]\n    start_urls = (\n        'https://www.xpo.com/global-locations/',\n    )\n\n    def parse(self, response):\n        script = response.xpath('//script[contains(.,\"globalLocationsArray\")]').extract_first()\n        data = re.search(r'globalLocationsArray = (.*);', script).groups()[0]\n        data = ast.literal_eval(data)\n\n        for store in data:\n            yield GeojsonPointItem(\n                lat=float(store['latitude']),\n                lon=float(store['longitude'].replace(',','')),\n                phone=store['telephone'],\n                ref=store['office_name'],\n                addr_full=store['street'],\n                city=store['city'],\n                state=store['state'],\n                postcode=store['postal_code'],\n                country=store['country'],\n                name=store['office_name']\n            )\n\n\n", "path": "locations/spiders/xpo_logistics.py"}]}