prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Anthropologie spider produces transposed coordinates
  https://www.alltheplaces.xyz/map/#7.69/-75.171/39.95
  
  ![image](https://github.com/alltheplaces/alltheplaces/assets/365751/549c74f8-f0ee-437d-aad5-b6c56cb747fb)
  
  The cause is the upstream data:
  
  https://www.anthropologie.com/stores/rittenhouse-square-philadelphia
  ![image](https://github.com/alltheplaces/alltheplaces/assets/365751/688ab3b4-18ed-435b-a6e1-733784d4c9a7)
  
  It might be worth doing any of the following:
  
  - Suspend the lat/long from the parser for now
  - Contact the company (I'll probably do that shortly) about the bug
  - Any kind of high level validations that can check the expected bounds for a scraper, vs the results?
  
  
  
  </issue>
  <code>
  [start of locations/spiders/anthropologie.py]
  1 from scrapy.spiders import SitemapSpider
  2 
  3 from locations.structured_data_spider import StructuredDataSpider
  4 
  5 
  6 class AnthropologieSpider(SitemapSpider, StructuredDataSpider):
  7     name = "anthropologie"
  8     item_attributes = {"brand": "Anthropologie", "brand_wikidata": "Q4773903"}
  9     allowed_domains = ["anthropologie.com"]
  10     sitemap_urls = ["https://www.anthropologie.com/store_sitemap.xml"]
  11     sitemap_rules = [("/stores/", "parse_sd")]
  12     requires_proxy = True
  13
  [end of locations/spiders/anthropologie.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/anthropologie.py b/locations/spiders/anthropologie.py
  --- a/locations/spiders/anthropologie.py
  +++ b/locations/spiders/anthropologie.py
  @@ -1,5 +1,6 @@
   from scrapy.spiders import SitemapSpider
   
  +from locations.items import set_closed
   from locations.structured_data_spider import StructuredDataSpider
   
   
  @@ -10,3 +11,17 @@
       sitemap_urls = ["https://www.anthropologie.com/store_sitemap.xml"]
       sitemap_rules = [("/stores/", "parse_sd")]
       requires_proxy = True
  +
  +    def pre_process_data(self, ld_data, **kwargs):
  +        ld_data["geo"]["latitude"], ld_data["geo"]["longitude"] = (
  +            ld_data["geo"]["longitude"],
  +            ld_data["geo"]["latitude"],
  +        )
  +
  +    def post_process_item(self, item, response, ld_data, **kwargs):
  +        item["branch"] = item.pop("name").removeprefix(" - Anthropologie Store")
  +
  +        if item["branch"].startswith("Closed - ") or item["branch"].endswith(" - Closed"):
  +            set_closed(item)
  +
  +        yield item
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/anthropologie.py b/locations/spiders/anthropologie.py\n--- a/locations/spiders/anthropologie.py\n+++ b/locations/spiders/anthropologie.py\n@@ -1,5 +1,6 @@\n from scrapy.spiders import SitemapSpider\n \n+from locations.items import set_closed\n from locations.structured_data_spider import StructuredDataSpider\n \n \n@@ -10,3 +11,17 @@\n     sitemap_urls = [\"https://www.anthropologie.com/store_sitemap.xml\"]\n     sitemap_rules = [(\"/stores/\", \"parse_sd\")]\n     requires_proxy = True\n+\n+    def pre_process_data(self, ld_data, **kwargs):\n+        ld_data[\"geo\"][\"latitude\"], ld_data[\"geo\"][\"longitude\"] = (\n+            ld_data[\"geo\"][\"longitude\"],\n+            ld_data[\"geo\"][\"latitude\"],\n+        )\n+\n+    def post_process_item(self, item, response, ld_data, **kwargs):\n+        item[\"branch\"] = item.pop(\"name\").removeprefix(\" - Anthropologie Store\")\n+\n+        if item[\"branch\"].startswith(\"Closed - \") or item[\"branch\"].endswith(\" - Closed\"):\n+            set_closed(item)\n+\n+        yield item\n", "issue": "Anthropologie spider produces transposed coordinates\nhttps://www.alltheplaces.xyz/map/#7.69/-75.171/39.95\r\n\r\n![image](https://github.com/alltheplaces/alltheplaces/assets/365751/549c74f8-f0ee-437d-aad5-b6c56cb747fb)\r\n\r\nThe cause is the upstream data:\r\n\r\nhttps://www.anthropologie.com/stores/rittenhouse-square-philadelphia\r\n![image](https://github.com/alltheplaces/alltheplaces/assets/365751/688ab3b4-18ed-435b-a6e1-733784d4c9a7)\r\n\r\nIt might be worth doing any of the following:\r\n\r\n- Suspend the lat/long from the parser for now\r\n- Contact the company (I'll probably do that shortly) about the bug\r\n- Any kind of high level validations that can check the expected bounds for a scraper, vs the results?\r\n\r\n\n", "before_files": [{"content": "from scrapy.spiders import SitemapSpider\n\nfrom locations.structured_data_spider import StructuredDataSpider\n\n\nclass AnthropologieSpider(SitemapSpider, StructuredDataSpider):\n    name = \"anthropologie\"\n    item_attributes = {\"brand\": \"Anthropologie\", \"brand_wikidata\": \"Q4773903\"}\n    allowed_domains = [\"anthropologie.com\"]\n    sitemap_urls = [\"https://www.anthropologie.com/store_sitemap.xml\"]\n    sitemap_rules = [(\"/stores/\", \"parse_sd\")]\n    requires_proxy = True\n", "path": "locations/spiders/anthropologie.py"}]}