prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bioclim data missing hdr files when downloaded to path
   retriever download Bioclim -p
  
  
  </issue>
  <code>
  [start of scripts/bioclim_2pt5.py]
  1 #retriever
  2 
  3 """Retriever script for direct download of Bioclim data"""
  4 
  5 from retriever.lib.templates import Script
  6 
  7 
  8 class main(Script):
  9     def __init__(self, **kwargs):
  10         Script.__init__(self, **kwargs)
  11         self.name = "Bioclim 2.5 Minute Climate Data"
  12         self.shortname = "Bioclim"
  13         self.ref = "http://worldclim.org/bioclim"
  14         self.urls = {"climate": "http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip"}
  15         self.description = "Bioclimatic variables that are derived from the monthly temperature and rainfall values in order to generate more biologically meaningful variables."
  16         self.citation = "Hijmans, R.J., S.E. Cameron, J.L. Parra, P.G. Jones and A. Jarvis, 2005. Very high resolution interpolated climate surfaces for global land areas. International Journal of Climatology 25: 1965-1978."
  17         self.tags = ["Data Type > Compilation"]
  18         
  19     def download(self, engine=None, debug=False):
  20         if engine.name != "Download Only":
  21             raise Exception("The Bioclim dataset contains only non-tabular data files, and can only be used with the 'download only' engine.")
  22         Script.download(self, engine, debug)
  23         file_names = ["bio%s.bil" % file_num for file_num in range(1, 20)]
  24         self.engine.download_files_from_archive(self.urls["climate"], file_names)
  25         self.engine.register_files(file_names)
  26 
  27 SCRIPT = main()
  28
  [end of scripts/bioclim_2pt5.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/scripts/bioclim_2pt5.py b/scripts/bioclim_2pt5.py
  --- a/scripts/bioclim_2pt5.py
  +++ b/scripts/bioclim_2pt5.py
  @@ -20,8 +20,12 @@
           if engine.name != "Download Only":
               raise Exception("The Bioclim dataset contains only non-tabular data files, and can only be used with the 'download only' engine.")
           Script.download(self, engine, debug)
  -        file_names = ["bio%s.bil" % file_num for file_num in range(1, 20)]
  +        file_names = []
  +        for file_num in range(1, 20):
  +            for ext in (['bil', 'hdr']):
  +                file_names += ["bio{0}.{1}".format(file_num, ext)]
           self.engine.download_files_from_archive(self.urls["climate"], file_names)
           self.engine.register_files(file_names)
   
   SCRIPT = main()
  +
  
verification_info: {"golden_diff": "diff --git a/scripts/bioclim_2pt5.py b/scripts/bioclim_2pt5.py\n--- a/scripts/bioclim_2pt5.py\n+++ b/scripts/bioclim_2pt5.py\n@@ -20,8 +20,12 @@\n         if engine.name != \"Download Only\":\n             raise Exception(\"The Bioclim dataset contains only non-tabular data files, and can only be used with the 'download only' engine.\")\n         Script.download(self, engine, debug)\n-        file_names = [\"bio%s.bil\" % file_num for file_num in range(1, 20)]\n+        file_names = []\n+        for file_num in range(1, 20):\n+            for ext in (['bil', 'hdr']):\n+                file_names += [\"bio{0}.{1}\".format(file_num, ext)]\n         self.engine.download_files_from_archive(self.urls[\"climate\"], file_names)\n         self.engine.register_files(file_names)\n \n SCRIPT = main()\n+\n", "issue": "Bioclim data missing hdr files when downloaded to path\n retriever download Bioclim -p\n\n", "before_files": [{"content": "#retriever\n\n\"\"\"Retriever script for direct download of Bioclim data\"\"\"\n\nfrom retriever.lib.templates import Script\n\n\nclass main(Script):\n    def __init__(self, **kwargs):\n        Script.__init__(self, **kwargs)\n        self.name = \"Bioclim 2.5 Minute Climate Data\"\n        self.shortname = \"Bioclim\"\n        self.ref = \"http://worldclim.org/bioclim\"\n        self.urls = {\"climate\": \"http://biogeo.ucdavis.edu/data/climate/worldclim/1_4/grid/cur/bio_2-5m_bil.zip\"}\n        self.description = \"Bioclimatic variables that are derived from the monthly temperature and rainfall values in order to generate more biologically meaningful variables.\"\n        self.citation = \"Hijmans, R.J., S.E. Cameron, J.L. Parra, P.G. Jones and A. Jarvis, 2005. Very high resolution interpolated climate surfaces for global land areas. International Journal of Climatology 25: 1965-1978.\"\n        self.tags = [\"Data Type > Compilation\"]\n        \n    def download(self, engine=None, debug=False):\n        if engine.name != \"Download Only\":\n            raise Exception(\"The Bioclim dataset contains only non-tabular data files, and can only be used with the 'download only' engine.\")\n        Script.download(self, engine, debug)\n        file_names = [\"bio%s.bil\" % file_num for file_num in range(1, 20)]\n        self.engine.download_files_from_archive(self.urls[\"climate\"], file_names)\n        self.engine.register_files(file_names)\n\nSCRIPT = main()\n", "path": "scripts/bioclim_2pt5.py"}]}