prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  DEPENDENCY_LINKS in setup.py causing bug in logging_functions
  With the introduction of the `DEPENDENCY_LINKS` variable in `setup.py`, the logging of monitors is now failing to log the versions of depenencies listed, since the `REQUIRES` is not immediately followed by `setup()`:
  
  ```python
  for i, line in enumerate(data):
              if 'REQUIRES = [' in line:
                  begin = i + 1
              elif 'setup(' in line:
                  end = i - 2
  ```
  
  The solution is so simple move `DEPENDENCY _LINKS` to be defined before `REQUIRES`.
  
  </issue>
  <code>
  [start of setup.py]
  1 import numpy as np
  2 from setuptools import setup
  3 from setuptools import find_packages
  4 
  5 VERSION = '0.22.0'
  6 
  7 AUTHORS = 'Matthew Bourque, Misty Cracraft, Joe Filippazzo, Bryan Hilbert, '
  8 AUTHORS += 'Graham Kanarek, Catherine Martlin, Johannes Sahlmann, Ben Sunnquist'
  9 
  10 DESCRIPTION = 'The James Webb Space Telescope Quicklook Project'
  11 
  12 REQUIRES = [
  13     'asdf>=2.3.3',
  14     'astropy>=3.2.1',
  15     'astroquery>=0.3.9',
  16     'authlib',
  17     'bokeh>=1.0',
  18     'codecov',
  19     'django>=2.0',
  20     'flake8',
  21     'inflection',
  22     'ipython',
  23     'jinja2',
  24     'jsonschema==2.6.0',
  25     'jwedb>=0.0.3',
  26     'matplotlib',
  27     'numpy',
  28     'numpydoc',
  29     'pandas',
  30     'psycopg2',
  31     'pysiaf',
  32     'pytest',
  33     'pytest-cov',
  34     'scipy',
  35     'sphinx',
  36     'sqlalchemy',
  37     'stsci_rtd_theme',
  38     'twine'
  39 ]
  40 
  41 DEPENDENCY_LINKS = ['git+https://github.com/spacetelescope/jwst#0.13.0']
  42 
  43 setup(
  44     name='jwql',
  45     version=VERSION,
  46     description=DESCRIPTION,
  47     url='https://github.com/spacetelescope/jwql.git',
  48     author=AUTHORS,
  49     author_email='jwql@stsci.edu',
  50     license='BSD',
  51     keywords=['astronomy', 'python'],
  52     classifiers=['Programming Language :: Python'],
  53     packages=find_packages(),
  54     install_requires=REQUIRES,
  55     dependency_links=DEPENDENCY_LINKS,
  56     include_package_data=True,
  57     include_dirs=[np.get_include()],
  58 )
  59
  [end of setup.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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -9,6 +9,7 @@
   
   DESCRIPTION = 'The James Webb Space Telescope Quicklook Project'
   
  +DEPENDENCY_LINKS = ['git+https://github.com/spacetelescope/jwst#0.13.0']
   REQUIRES = [
       'asdf>=2.3.3',
       'astropy>=3.2.1',
  @@ -38,8 +39,6 @@
       'twine'
   ]
   
  -DEPENDENCY_LINKS = ['git+https://github.com/spacetelescope/jwst#0.13.0']
  -
   setup(
       name='jwql',
       version=VERSION,
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -9,6 +9,7 @@\n \n DESCRIPTION = 'The James Webb Space Telescope Quicklook Project'\n \n+DEPENDENCY_LINKS = ['git+https://github.com/spacetelescope/jwst#0.13.0']\n REQUIRES = [\n     'asdf>=2.3.3',\n     'astropy>=3.2.1',\n@@ -38,8 +39,6 @@\n     'twine'\n ]\n \n-DEPENDENCY_LINKS = ['git+https://github.com/spacetelescope/jwst#0.13.0']\n-\n setup(\n     name='jwql',\n     version=VERSION,\n", "issue": "DEPENDENCY_LINKS in setup.py causing bug in logging_functions\nWith the introduction of the `DEPENDENCY_LINKS` variable in `setup.py`, the logging of monitors is now failing to log the versions of depenencies listed, since the `REQUIRES` is not immediately followed by `setup()`:\r\n\r\n```python\r\nfor i, line in enumerate(data):\r\n            if 'REQUIRES = [' in line:\r\n                begin = i + 1\r\n            elif 'setup(' in line:\r\n                end = i - 2\r\n```\r\n\r\nThe solution is so simple move `DEPENDENCY _LINKS` to be defined before `REQUIRES`.\n", "before_files": [{"content": "import numpy as np\nfrom setuptools import setup\nfrom setuptools import find_packages\n\nVERSION = '0.22.0'\n\nAUTHORS = 'Matthew Bourque, Misty Cracraft, Joe Filippazzo, Bryan Hilbert, '\nAUTHORS += 'Graham Kanarek, Catherine Martlin, Johannes Sahlmann, Ben Sunnquist'\n\nDESCRIPTION = 'The James Webb Space Telescope Quicklook Project'\n\nREQUIRES = [\n    'asdf>=2.3.3',\n    'astropy>=3.2.1',\n    'astroquery>=0.3.9',\n    'authlib',\n    'bokeh>=1.0',\n    'codecov',\n    'django>=2.0',\n    'flake8',\n    'inflection',\n    'ipython',\n    'jinja2',\n    'jsonschema==2.6.0',\n    'jwedb>=0.0.3',\n    'matplotlib',\n    'numpy',\n    'numpydoc',\n    'pandas',\n    'psycopg2',\n    'pysiaf',\n    'pytest',\n    'pytest-cov',\n    'scipy',\n    'sphinx',\n    'sqlalchemy',\n    'stsci_rtd_theme',\n    'twine'\n]\n\nDEPENDENCY_LINKS = ['git+https://github.com/spacetelescope/jwst#0.13.0']\n\nsetup(\n    name='jwql',\n    version=VERSION,\n    description=DESCRIPTION,\n    url='https://github.com/spacetelescope/jwql.git',\n    author=AUTHORS,\n    author_email='jwql@stsci.edu',\n    license='BSD',\n    keywords=['astronomy', 'python'],\n    classifiers=['Programming Language :: Python'],\n    packages=find_packages(),\n    install_requires=REQUIRES,\n    dependency_links=DEPENDENCY_LINKS,\n    include_package_data=True,\n    include_dirs=[np.get_include()],\n)\n", "path": "setup.py"}]}