prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Suspicious point coordinates from moneygram spider.
  Found this in alltheplaces.xyz 2023-06-17, `moneygram` spider.
  
  
  <img width="1281" alt="image" src="https://github.com/alltheplaces/alltheplaces/assets/35237910/fbdccf94-5e1f-46c4-96a5-e24d6982b55c">
  
  
  
  </issue>
  <code>
  [start of locations/spiders/moneygram.py]
  1 from locations.hours import OpeningHours
  2 from locations.storefinders.where2getit import Where2GetItSpider
  3 
  4 
  5 class MoneyGramSpider(Where2GetItSpider):
  6     name = "moneygram"
  7     item_attributes = {"brand": "MoneyGram", "brand_wikidata": "Q1944412"}
  8     api_brand_name = "moneygram"
  9     api_key = "46493320-D5C3-11E1-A25A-4A6F97B4DA77"
  10     separate_api_call_per_country = True
  11 
  12     def parse_item(self, item, location):
  13         hours_string = ""
  14         for day_name in ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]:
  15             if location.get(day_name + "_hours"):
  16                 hours_string = f"{hours_string} {day_name}: " + location.get(day_name + "_hours")
  17         item["opening_hours"] = OpeningHours()
  18         item["opening_hours"].add_ranges_from_string(hours_string)
  19         yield item
  20
  [end of locations/spiders/moneygram.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/moneygram.py b/locations/spiders/moneygram.py
  --- a/locations/spiders/moneygram.py
  +++ b/locations/spiders/moneygram.py
  @@ -1,3 +1,5 @@
  +import reverse_geocoder
  +
   from locations.hours import OpeningHours
   from locations.storefinders.where2getit import Where2GetItSpider
   
  @@ -10,10 +12,25 @@
       separate_api_call_per_country = True
   
       def parse_item(self, item, location):
  +        # MoneyGram compiles location information provided by
  +        # franchises that provide MoneyGram services. Some of these
  +        # franchises are providing bad location information which
  +        # should be ignored.
  +        #
  +        # 1. Ignore Polish post office locations outside of Poland.
  +        if item["country"] == "PL" and item["name"][:3] == "UP ":
  +            if result := reverse_geocoder.get(
  +                (float(location["latitude"]), float(location["longitude"])), mode=1, verbose=False
  +            ):
  +                if result["cc"] != "PL":
  +                    item.pop("lat")
  +                    item.pop("lon")
  +
           hours_string = ""
           for day_name in ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]:
               if location.get(day_name + "_hours"):
                   hours_string = f"{hours_string} {day_name}: " + location.get(day_name + "_hours")
           item["opening_hours"] = OpeningHours()
           item["opening_hours"].add_ranges_from_string(hours_string)
  +
           yield item
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/moneygram.py b/locations/spiders/moneygram.py\n--- a/locations/spiders/moneygram.py\n+++ b/locations/spiders/moneygram.py\n@@ -1,3 +1,5 @@\n+import reverse_geocoder\n+\n from locations.hours import OpeningHours\n from locations.storefinders.where2getit import Where2GetItSpider\n \n@@ -10,10 +12,25 @@\n     separate_api_call_per_country = True\n \n     def parse_item(self, item, location):\n+        # MoneyGram compiles location information provided by\n+        # franchises that provide MoneyGram services. Some of these\n+        # franchises are providing bad location information which\n+        # should be ignored.\n+        #\n+        # 1. Ignore Polish post office locations outside of Poland.\n+        if item[\"country\"] == \"PL\" and item[\"name\"][:3] == \"UP \":\n+            if result := reverse_geocoder.get(\n+                (float(location[\"latitude\"]), float(location[\"longitude\"])), mode=1, verbose=False\n+            ):\n+                if result[\"cc\"] != \"PL\":\n+                    item.pop(\"lat\")\n+                    item.pop(\"lon\")\n+\n         hours_string = \"\"\n         for day_name in [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]:\n             if location.get(day_name + \"_hours\"):\n                 hours_string = f\"{hours_string} {day_name}: \" + location.get(day_name + \"_hours\")\n         item[\"opening_hours\"] = OpeningHours()\n         item[\"opening_hours\"].add_ranges_from_string(hours_string)\n+\n         yield item\n", "issue": "Suspicious point coordinates from moneygram spider.\nFound this in alltheplaces.xyz 2023-06-17, `moneygram` spider.\r\n\r\n\r\n<img width=\"1281\" alt=\"image\" src=\"https://github.com/alltheplaces/alltheplaces/assets/35237910/fbdccf94-5e1f-46c4-96a5-e24d6982b55c\">\r\n\r\n\n", "before_files": [{"content": "from locations.hours import OpeningHours\nfrom locations.storefinders.where2getit import Where2GetItSpider\n\n\nclass MoneyGramSpider(Where2GetItSpider):\n    name = \"moneygram\"\n    item_attributes = {\"brand\": \"MoneyGram\", \"brand_wikidata\": \"Q1944412\"}\n    api_brand_name = \"moneygram\"\n    api_key = \"46493320-D5C3-11E1-A25A-4A6F97B4DA77\"\n    separate_api_call_per_country = True\n\n    def parse_item(self, item, location):\n        hours_string = \"\"\n        for day_name in [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]:\n            if location.get(day_name + \"_hours\"):\n                hours_string = f\"{hours_string} {day_name}: \" + location.get(day_name + \"_hours\")\n        item[\"opening_hours\"] = OpeningHours()\n        item[\"opening_hours\"].add_ranges_from_string(hours_string)\n        yield item\n", "path": "locations/spiders/moneygram.py"}]}