prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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`.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  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 FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
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"}], "after_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\nDEPENDENCY_LINKS = ['git+https://github.com/spacetelescope/jwst#0.13.0']\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\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"}]}