prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Samsonite spider finds dealers, not official stores
  This spider is wrong, e.g., the stores in Norway are not official Samsonite stores but dealers carrying the Samsonite brand
  
  E.g., this is Chillout Travel Store, not a Samsonite store
  https://www.alltheplaces.xyz/map/#15.79/59.920398/10.757257
  
  The website does list official stores and dealers separately, so it should be possible to import the right type?
  https://www.samsonite.no/samsonite-store/?search=dealer&city=&country=no&lat=59.920469259204786&lng=10.755597088646583&radius=20
  
  _Originally posted by @eisams in https://github.com/alltheplaces/alltheplaces/issues/4385#issuecomment-1586255246_
              
  
  </issue>
  <code>
  [start of locations/spiders/samsonite_eu.py]
  1 import scrapy
  2 import xmltodict
  3 
  4 from locations.dict_parser import DictParser
  5 
  6 
  7 class SamsoniteEuSpider(scrapy.Spider):
  8     name = "samsonite_eu"
  9     item_attributes = {
  10         "brand": "Samsonite",
  11         "brand_wikidata": "Q1203426",
  12     }
  13     allowed_domains = ["samsonite.com"]
  14 
  15     def start_requests(self):
  16         country_eu = [
  17             "AL",
  18             "CZ",
  19             "DE",
  20             "DK",
  21             "CY",
  22             "AT",
  23             "BE",
  24             "BG",
  25             "CH",
  26             "EE",
  27             "EL",
  28             "ES",
  29             "FI",
  30             "FR",
  31             "HR",
  32             "HU",
  33             "IE",
  34             "IS",
  35             "IT",
  36             "LT",
  37             "LU",
  38             "NL",
  39             "NO",
  40             "LV",
  41             "ME",
  42             "MT",
  43             "MK",
  44             "LI",
  45             "PL",
  46             "SI",
  47             "SK",
  48             "TR",
  49             "UK",
  50             "RS",
  51             "SE",
  52             "PT",
  53             "RO",
  54         ]
  55         template = "https://storelocator.samsonite.eu/data-exchange/getDealerLocatorMapV2_Radius.aspx?s=sams&country={}&search=dealer&lat=48.85799300000001&lng=2.381153&radius=100000"
  56         for country in country_eu:
  57             yield scrapy.Request(url=template.format(country), callback=self.parse)
  58 
  59     def parse(self, response):
  60         data = xmltodict.parse(response.text)
  61         if data.get("dealers"):
  62             stores = data.get("dealers", {}).get("dealer")
  63             stores = stores if type(stores) == list else [stores]
  64             for store in stores:
  65                 item = DictParser.parse(store)
  66                 item["ref"] = store.get("fld_Deal_Id")
  67                 item["street_address"] = store.get("fld_Deal_Address1")
  68                 item["city"] = store.get("fld_Deal_City1")
  69                 item["postcode"] = store.get("fld_Deal_Zip")
  70                 item["country"] = store.get("fld_Coun_Name")
  71                 item["phone"] = store.get("fld_Deal_Phone")
  72                 item["email"] = store.get("fld_Deal_Email")
  73 
  74                 yield item
  75
  [end of locations/spiders/samsonite_eu.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/samsonite_eu.py b/locations/spiders/samsonite_eu.py
  --- a/locations/spiders/samsonite_eu.py
  +++ b/locations/spiders/samsonite_eu.py
  @@ -1,15 +1,13 @@
   import scrapy
   import xmltodict
   
  -from locations.dict_parser import DictParser
  +from locations.items import Feature, add_social_media
   
   
   class SamsoniteEuSpider(scrapy.Spider):
       name = "samsonite_eu"
  -    item_attributes = {
  -        "brand": "Samsonite",
  -        "brand_wikidata": "Q1203426",
  -    }
  +    CHIC_ACCENT = {"brand": "Chic Accent"}
  +    SAMSONITE = {"brand": "Samsonite", "brand_wikidata": "Q1203426"}
       allowed_domains = ["samsonite.com"]
   
       def start_requests(self):
  @@ -51,6 +49,7 @@
               "SE",
               "PT",
               "RO",
  +            "GB",
           ]
           template = "https://storelocator.samsonite.eu/data-exchange/getDealerLocatorMapV2_Radius.aspx?s=sams&country={}&search=dealer&lat=48.85799300000001&lng=2.381153&radius=100000"
           for country in country_eu:
  @@ -62,13 +61,31 @@
               stores = data.get("dealers", {}).get("dealer")
               stores = stores if type(stores) == list else [stores]
               for store in stores:
  -                item = DictParser.parse(store)
  +                if store["fld_Deal_DeCl_ID"] != "9":
  +                    continue
  +                item = Feature()
  +                item["lat"] = store["Latitude"]
  +                item["lon"] = store["Longitude"]
                   item["ref"] = store.get("fld_Deal_Id")
                   item["street_address"] = store.get("fld_Deal_Address1")
                   item["city"] = store.get("fld_Deal_City1")
                   item["postcode"] = store.get("fld_Deal_Zip")
                   item["country"] = store.get("fld_Coun_Name")
  -                item["phone"] = store.get("fld_Deal_Phone")
  -                item["email"] = store.get("fld_Deal_Email")
  +                item["email"] = store.get("fld_Deal_Email") or ""
  +                item["website"] = store["fld_Deal_DetailPageUrl"]
  +
  +                if "chicaccent.com" in item["email"]:
  +                    item.update(self.CHIC_ACCENT)
  +                else:
  +                    item.update(self.SAMSONITE)
  +
  +                if phone := store.get("fld_Deal_Phone"):
  +                    phone = store["fld_Deal_Prefix"] + phone.lower()
  +
  +                    if "whatsapp" in phone:
  +                        phone, whats_app = phone.split("whatsapp")
  +                        add_social_media(item, "WhatsApp", whats_app.strip(" :"))
  +
  +                    item["phone"] = phone
   
                   yield item
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/samsonite_eu.py b/locations/spiders/samsonite_eu.py\n--- a/locations/spiders/samsonite_eu.py\n+++ b/locations/spiders/samsonite_eu.py\n@@ -1,15 +1,13 @@\n import scrapy\n import xmltodict\n \n-from locations.dict_parser import DictParser\n+from locations.items import Feature, add_social_media\n \n \n class SamsoniteEuSpider(scrapy.Spider):\n     name = \"samsonite_eu\"\n-    item_attributes = {\n-        \"brand\": \"Samsonite\",\n-        \"brand_wikidata\": \"Q1203426\",\n-    }\n+    CHIC_ACCENT = {\"brand\": \"Chic Accent\"}\n+    SAMSONITE = {\"brand\": \"Samsonite\", \"brand_wikidata\": \"Q1203426\"}\n     allowed_domains = [\"samsonite.com\"]\n \n     def start_requests(self):\n@@ -51,6 +49,7 @@\n             \"SE\",\n             \"PT\",\n             \"RO\",\n+            \"GB\",\n         ]\n         template = \"https://storelocator.samsonite.eu/data-exchange/getDealerLocatorMapV2_Radius.aspx?s=sams&country={}&search=dealer&lat=48.85799300000001&lng=2.381153&radius=100000\"\n         for country in country_eu:\n@@ -62,13 +61,31 @@\n             stores = data.get(\"dealers\", {}).get(\"dealer\")\n             stores = stores if type(stores) == list else [stores]\n             for store in stores:\n-                item = DictParser.parse(store)\n+                if store[\"fld_Deal_DeCl_ID\"] != \"9\":\n+                    continue\n+                item = Feature()\n+                item[\"lat\"] = store[\"Latitude\"]\n+                item[\"lon\"] = store[\"Longitude\"]\n                 item[\"ref\"] = store.get(\"fld_Deal_Id\")\n                 item[\"street_address\"] = store.get(\"fld_Deal_Address1\")\n                 item[\"city\"] = store.get(\"fld_Deal_City1\")\n                 item[\"postcode\"] = store.get(\"fld_Deal_Zip\")\n                 item[\"country\"] = store.get(\"fld_Coun_Name\")\n-                item[\"phone\"] = store.get(\"fld_Deal_Phone\")\n-                item[\"email\"] = store.get(\"fld_Deal_Email\")\n+                item[\"email\"] = store.get(\"fld_Deal_Email\") or \"\"\n+                item[\"website\"] = store[\"fld_Deal_DetailPageUrl\"]\n+\n+                if \"chicaccent.com\" in item[\"email\"]:\n+                    item.update(self.CHIC_ACCENT)\n+                else:\n+                    item.update(self.SAMSONITE)\n+\n+                if phone := store.get(\"fld_Deal_Phone\"):\n+                    phone = store[\"fld_Deal_Prefix\"] + phone.lower()\n+\n+                    if \"whatsapp\" in phone:\n+                        phone, whats_app = phone.split(\"whatsapp\")\n+                        add_social_media(item, \"WhatsApp\", whats_app.strip(\" :\"))\n+\n+                    item[\"phone\"] = phone\n \n                 yield item\n", "issue": "Samsonite spider finds dealers, not official stores\nThis spider is wrong, e.g., the stores in Norway are not official Samsonite stores but dealers carrying the Samsonite brand\r\n\r\nE.g., this is Chillout Travel Store, not a Samsonite store\r\nhttps://www.alltheplaces.xyz/map/#15.79/59.920398/10.757257\r\n\r\nThe website does list official stores and dealers separately, so it should be possible to import the right type?\r\nhttps://www.samsonite.no/samsonite-store/?search=dealer&city=&country=no&lat=59.920469259204786&lng=10.755597088646583&radius=20\r\n\r\n_Originally posted by @eisams in https://github.com/alltheplaces/alltheplaces/issues/4385#issuecomment-1586255246_\r\n            \n", "before_files": [{"content": "import scrapy\nimport xmltodict\n\nfrom locations.dict_parser import DictParser\n\n\nclass SamsoniteEuSpider(scrapy.Spider):\n    name = \"samsonite_eu\"\n    item_attributes = {\n        \"brand\": \"Samsonite\",\n        \"brand_wikidata\": \"Q1203426\",\n    }\n    allowed_domains = [\"samsonite.com\"]\n\n    def start_requests(self):\n        country_eu = [\n            \"AL\",\n            \"CZ\",\n            \"DE\",\n            \"DK\",\n            \"CY\",\n            \"AT\",\n            \"BE\",\n            \"BG\",\n            \"CH\",\n            \"EE\",\n            \"EL\",\n            \"ES\",\n            \"FI\",\n            \"FR\",\n            \"HR\",\n            \"HU\",\n            \"IE\",\n            \"IS\",\n            \"IT\",\n            \"LT\",\n            \"LU\",\n            \"NL\",\n            \"NO\",\n            \"LV\",\n            \"ME\",\n            \"MT\",\n            \"MK\",\n            \"LI\",\n            \"PL\",\n            \"SI\",\n            \"SK\",\n            \"TR\",\n            \"UK\",\n            \"RS\",\n            \"SE\",\n            \"PT\",\n            \"RO\",\n        ]\n        template = \"https://storelocator.samsonite.eu/data-exchange/getDealerLocatorMapV2_Radius.aspx?s=sams&country={}&search=dealer&lat=48.85799300000001&lng=2.381153&radius=100000\"\n        for country in country_eu:\n            yield scrapy.Request(url=template.format(country), callback=self.parse)\n\n    def parse(self, response):\n        data = xmltodict.parse(response.text)\n        if data.get(\"dealers\"):\n            stores = data.get(\"dealers\", {}).get(\"dealer\")\n            stores = stores if type(stores) == list else [stores]\n            for store in stores:\n                item = DictParser.parse(store)\n                item[\"ref\"] = store.get(\"fld_Deal_Id\")\n                item[\"street_address\"] = store.get(\"fld_Deal_Address1\")\n                item[\"city\"] = store.get(\"fld_Deal_City1\")\n                item[\"postcode\"] = store.get(\"fld_Deal_Zip\")\n                item[\"country\"] = store.get(\"fld_Coun_Name\")\n                item[\"phone\"] = store.get(\"fld_Deal_Phone\")\n                item[\"email\"] = store.get(\"fld_Deal_Email\")\n\n                yield item\n", "path": "locations/spiders/samsonite_eu.py"}]}