prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  enterprise car hire spider missing ~6k outlets
  In the latest run of the enterprise.py spider from 2023-05-15, there are around 6000 fewer results than in the previous run from 2023-04-15.
  
  I think the cause is that the search API that ATP uses is no longer returning results for some major countries. For example, the following still work:
  * https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/IT
  * https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/BE
  * https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/MX
  
  but the following do not:
  * https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/GB
  * https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/US
  * https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/FR
  
  I'm not sure why the API has stopped returning for certain countries, or if there's anything we can do about it.
  
  If we want to look at alternative means, then it's possible that the "Airport Locations" and "Neighbourhood Locations" lists at https://www.enterprise.co.uk/en/car-hire/locations/uk.html are complete for GB. (Together they have 427 locations, compared with the 425 I extracted for my Chain Reaction tool from a previous ATP dataset.) But then you'd need to parse each branch page, and that's a lot more HTTP fetches. I haven't looked what other localised sites do in terms of location lists.
  
  </issue>
  <code>
  [start of locations/spiders/enterprise.py]
  1 import geonamescache
  2 from scrapy import Spider
  3 from scrapy.http import JsonRequest
  4 
  5 from locations.dict_parser import DictParser
  6 
  7 
  8 class EnterpriseSpider(Spider):
  9     name = "enterprise"
  10     item_attributes = {"brand": "Enterprise Rent-A-Car", "brand_wikidata": "Q17085454"}
  11     allowed_domains = ["prd.location.enterprise.com"]
  12 
  13     def start_requests(self):
  14         gc = geonamescache.GeonamesCache()
  15         countries = gc.get_countries()
  16         for country_code in countries.keys():
  17             yield JsonRequest(
  18                 url=f"https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/{country_code}"
  19             )
  20 
  21     def parse(self, response):
  22         for location in response.json():
  23             if location["closed"] or not location["physicalLocation"]:
  24                 continue
  25             item = DictParser.parse(location)
  26             item["ref"] = location["stationId"]
  27             item["name"] = location["locationNameTranslation"]
  28             item["street_address"] = ", ".join(filter(None, location["addressLines"]))
  29             item["phone"] = location["formattedPhone"]
  30             yield item
  31
  [end of locations/spiders/enterprise.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/enterprise.py b/locations/spiders/enterprise.py
  --- a/locations/spiders/enterprise.py
  +++ b/locations/spiders/enterprise.py
  @@ -8,15 +8,20 @@
   class EnterpriseSpider(Spider):
       name = "enterprise"
       item_attributes = {"brand": "Enterprise Rent-A-Car", "brand_wikidata": "Q17085454"}
  -    allowed_domains = ["prd.location.enterprise.com"]
  +    allowed_domains = ["prd.location.enterprise.com", "int1.location.enterprise.com"]
   
       def start_requests(self):
           gc = geonamescache.GeonamesCache()
           countries = gc.get_countries()
           for country_code in countries.keys():
  -            yield JsonRequest(
  -                url=f"https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/{country_code}"
  -            )
  +            # It appears that countries are sharded between two
  +            # servers. Other servers are int2, xqa1, xqa2, xqa3
  +            # but search of these servers reveals no additional
  +            # locations on top of just prd and int1.
  +            for subdomain in ["prd", "int1"]:
  +                yield JsonRequest(
  +                    url=f"https://{subdomain}.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/{country_code}"
  +                )
   
       def parse(self, response):
           for location in response.json():
  
verification_info: {"golden_diff": "diff --git a/locations/spiders/enterprise.py b/locations/spiders/enterprise.py\n--- a/locations/spiders/enterprise.py\n+++ b/locations/spiders/enterprise.py\n@@ -8,15 +8,20 @@\n class EnterpriseSpider(Spider):\n     name = \"enterprise\"\n     item_attributes = {\"brand\": \"Enterprise Rent-A-Car\", \"brand_wikidata\": \"Q17085454\"}\n-    allowed_domains = [\"prd.location.enterprise.com\"]\n+    allowed_domains = [\"prd.location.enterprise.com\", \"int1.location.enterprise.com\"]\n \n     def start_requests(self):\n         gc = geonamescache.GeonamesCache()\n         countries = gc.get_countries()\n         for country_code in countries.keys():\n-            yield JsonRequest(\n-                url=f\"https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/{country_code}\"\n-            )\n+            # It appears that countries are sharded between two\n+            # servers. Other servers are int2, xqa1, xqa2, xqa3\n+            # but search of these servers reveals no additional\n+            # locations on top of just prd and int1.\n+            for subdomain in [\"prd\", \"int1\"]:\n+                yield JsonRequest(\n+                    url=f\"https://{subdomain}.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/{country_code}\"\n+                )\n \n     def parse(self, response):\n         for location in response.json():\n", "issue": "enterprise car hire spider missing ~6k outlets\nIn the latest run of the enterprise.py spider from 2023-05-15, there are around 6000 fewer results than in the previous run from 2023-04-15.\r\n\r\nI think the cause is that the search API that ATP uses is no longer returning results for some major countries. For example, the following still work:\r\n* https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/IT\r\n* https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/BE\r\n* https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/MX\r\n\r\nbut the following do not:\r\n* https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/GB\r\n* https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/US\r\n* https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/FR\r\n\r\nI'm not sure why the API has stopped returning for certain countries, or if there's anything we can do about it.\r\n\r\nIf we want to look at alternative means, then it's possible that the \"Airport Locations\" and \"Neighbourhood Locations\" lists at https://www.enterprise.co.uk/en/car-hire/locations/uk.html are complete for GB. (Together they have 427 locations, compared with the 425 I extracted for my Chain Reaction tool from a previous ATP dataset.) But then you'd need to parse each branch page, and that's a lot more HTTP fetches. I haven't looked what other localised sites do in terms of location lists.\n", "before_files": [{"content": "import geonamescache\nfrom scrapy import Spider\nfrom scrapy.http import JsonRequest\n\nfrom locations.dict_parser import DictParser\n\n\nclass EnterpriseSpider(Spider):\n    name = \"enterprise\"\n    item_attributes = {\"brand\": \"Enterprise Rent-A-Car\", \"brand_wikidata\": \"Q17085454\"}\n    allowed_domains = [\"prd.location.enterprise.com\"]\n\n    def start_requests(self):\n        gc = geonamescache.GeonamesCache()\n        countries = gc.get_countries()\n        for country_code in countries.keys():\n            yield JsonRequest(\n                url=f\"https://prd.location.enterprise.com/enterprise-sls/search/location/enterprise/web/country/{country_code}\"\n            )\n\n    def parse(self, response):\n        for location in response.json():\n            if location[\"closed\"] or not location[\"physicalLocation\"]:\n                continue\n            item = DictParser.parse(location)\n            item[\"ref\"] = location[\"stationId\"]\n            item[\"name\"] = location[\"locationNameTranslation\"]\n            item[\"street_address\"] = \", \".join(filter(None, location[\"addressLines\"]))\n            item[\"phone\"] = location[\"formattedPhone\"]\n            yield item\n", "path": "locations/spiders/enterprise.py"}]}