prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Not all modules are cythonized
  Missing some modules, such as hooks and those in the util package.
  
  
  --- 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 imp
  2 import io
  3 import sys
  4 from os import path
  5 from setuptools import setup, find_packages, Extension
  6 
  7 VERSION = imp.load_source('version', path.join('.', 'falcon', 'version.py'))
  8 VERSION = VERSION.__version__
  9 
  10 # NOTE(kgriffs): python-mimeparse is newer than mimeparse, supports Py3
  11 # TODO(kgriffs): Fork and optimize/modernize python-mimeparse
  12 REQUIRES = ['six', 'python-mimeparse']
  13 
  14 PYPY = True
  15 CYTHON = False
  16 try:
  17     sys.pypy_version_info
  18 except AttributeError:
  19     PYPY = False
  20 
  21 if not PYPY:
  22     try:
  23         from Cython.Distutils import build_ext
  24         CYTHON = True
  25     except ImportError:
  26         print('\nWARNING: Cython not installed. '
  27               'Falcon will still work fine, but may run '
  28               'a bit slower.\n')
  29         CYTHON = False
  30 
  31 if CYTHON:
  32     ext_names = (
  33         'api',
  34         'api_helpers',
  35         'errors',
  36         'http_error',
  37         'request',
  38         'request_helpers',
  39         'responders',
  40         'response',
  41         'response_helpers',
  42     )
  43 
  44     cmdclass = {'build_ext': build_ext}
  45     ext_modules = [
  46         Extension('falcon.' + ext, [path.join('falcon', ext + '.py')])
  47         for ext in ext_names]
  48 else:
  49     cmdclass = {}
  50     ext_modules = []
  51 
  52 setup(
  53     name='falcon',
  54     version=VERSION,
  55     description='An unladen web framework for building APIs and app backends.',
  56     long_description=io.open('README.rst', 'r', encoding='utf-8').read(),
  57     classifiers=[
  58         'Development Status :: 5 - Production/Stable',
  59         'Environment :: Web Environment',
  60         'Natural Language :: English',
  61         'Intended Audience :: Developers',
  62         'Intended Audience :: System Administrators',
  63         'License :: OSI Approved :: Apache Software License',
  64         'Operating System :: MacOS :: MacOS X',
  65         'Operating System :: Microsoft :: Windows',
  66         'Operating System :: POSIX',
  67         'Topic :: Internet :: WWW/HTTP :: WSGI',
  68         'Topic :: Software Development :: Libraries :: Application Frameworks',
  69         'Programming Language :: Python',
  70         'Programming Language :: Python :: Implementation :: CPython',
  71         'Programming Language :: Python :: Implementation :: PyPy',
  72         'Programming Language :: Python :: 2.6',
  73         'Programming Language :: Python :: 2.7',
  74         'Programming Language :: Python :: 3.3',
  75         'Programming Language :: Python :: 3.4',
  76     ],
  77     keywords='wsgi web api framework rest http cloud',
  78     author='Kurt Griffiths',
  79     author_email='mail@kgriffs.com',
  80     url='http://falconframework.org',
  81     license='Apache 2.0',
  82     packages=find_packages(exclude=['tests']),
  83     include_package_data=True,
  84     zip_safe=False,
  85     install_requires=REQUIRES,
  86     setup_requires=[],
  87     cmdclass=cmdclass,
  88     ext_modules=ext_modules,
  89     test_suite='nose.collector',
  90     entry_points={
  91         'console_scripts': [
  92             'falcon-bench = falcon.cmd.bench:main'
  93         ]
  94     }
  95 )
  96
  ```
  --- 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
  @@ -1,8 +1,12 @@
  +import glob
   import imp
   import io
  -import sys
  +import os
   from os import path
   from setuptools import setup, find_packages, Extension
  +import sys
  +
  +MYDIR = path.abspath(os.path.dirname(__file__))
   
   VERSION = imp.load_source('version', path.join('.', 'falcon', 'version.py'))
   VERSION = VERSION.__version__
  @@ -29,22 +33,29 @@
           CYTHON = False
   
   if CYTHON:
  -    ext_names = (
  -        'api',
  -        'api_helpers',
  -        'errors',
  -        'http_error',
  -        'request',
  -        'request_helpers',
  -        'responders',
  -        'response',
  -        'response_helpers',
  -    )
  +    def list_modules(dirname):
  +        filenames = glob.glob(path.join(dirname, '*.py'))
  +
  +        module_names = []
  +        for name in filenames:
  +            module, ext = path.splitext(path.basename(name))
  +            if module != '__init__':
  +                module_names.append(module)
  +
  +        return module_names
   
  -    cmdclass = {'build_ext': build_ext}
       ext_modules = [
           Extension('falcon.' + ext, [path.join('falcon', ext + '.py')])
  -        for ext in ext_names]
  +        for ext in list_modules(path.join(MYDIR, 'falcon'))]
  +
  +    ext_modules += [
  +        Extension('falcon.util.' + ext,
  +                  [path.join('falcon', 'util', ext + '.py')])
  +
  +        for ext in list_modules(path.join(MYDIR, 'falcon', 'util'))]
  +
  +    cmdclass = {'build_ext': build_ext}
  +
   else:
       cmdclass = {}
       ext_modules = []
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -1,8 +1,12 @@\n+import glob\n import imp\n import io\n-import sys\n+import os\n from os import path\n from setuptools import setup, find_packages, Extension\n+import sys\n+\n+MYDIR = path.abspath(os.path.dirname(__file__))\n \n VERSION = imp.load_source('version', path.join('.', 'falcon', 'version.py'))\n VERSION = VERSION.__version__\n@@ -29,22 +33,29 @@\n         CYTHON = False\n \n if CYTHON:\n-    ext_names = (\n-        'api',\n-        'api_helpers',\n-        'errors',\n-        'http_error',\n-        'request',\n-        'request_helpers',\n-        'responders',\n-        'response',\n-        'response_helpers',\n-    )\n+    def list_modules(dirname):\n+        filenames = glob.glob(path.join(dirname, '*.py'))\n+\n+        module_names = []\n+        for name in filenames:\n+            module, ext = path.splitext(path.basename(name))\n+            if module != '__init__':\n+                module_names.append(module)\n+\n+        return module_names\n \n-    cmdclass = {'build_ext': build_ext}\n     ext_modules = [\n         Extension('falcon.' + ext, [path.join('falcon', ext + '.py')])\n-        for ext in ext_names]\n+        for ext in list_modules(path.join(MYDIR, 'falcon'))]\n+\n+    ext_modules += [\n+        Extension('falcon.util.' + ext,\n+                  [path.join('falcon', 'util', ext + '.py')])\n+\n+        for ext in list_modules(path.join(MYDIR, 'falcon', 'util'))]\n+\n+    cmdclass = {'build_ext': build_ext}\n+\n else:\n     cmdclass = {}\n     ext_modules = []\n", "issue": "Not all modules are cythonized\nMissing some modules, such as hooks and those in the util package.\n\n", "before_files": [{"content": "import imp\nimport io\nimport sys\nfrom os import path\nfrom setuptools import setup, find_packages, Extension\n\nVERSION = imp.load_source('version', path.join('.', 'falcon', 'version.py'))\nVERSION = VERSION.__version__\n\n# NOTE(kgriffs): python-mimeparse is newer than mimeparse, supports Py3\n# TODO(kgriffs): Fork and optimize/modernize python-mimeparse\nREQUIRES = ['six', 'python-mimeparse']\n\nPYPY = True\nCYTHON = False\ntry:\n    sys.pypy_version_info\nexcept AttributeError:\n    PYPY = False\n\nif not PYPY:\n    try:\n        from Cython.Distutils import build_ext\n        CYTHON = True\n    except ImportError:\n        print('\\nWARNING: Cython not installed. '\n              'Falcon will still work fine, but may run '\n              'a bit slower.\\n')\n        CYTHON = False\n\nif CYTHON:\n    ext_names = (\n        'api',\n        'api_helpers',\n        'errors',\n        'http_error',\n        'request',\n        'request_helpers',\n        'responders',\n        'response',\n        'response_helpers',\n    )\n\n    cmdclass = {'build_ext': build_ext}\n    ext_modules = [\n        Extension('falcon.' + ext, [path.join('falcon', ext + '.py')])\n        for ext in ext_names]\nelse:\n    cmdclass = {}\n    ext_modules = []\n\nsetup(\n    name='falcon',\n    version=VERSION,\n    description='An unladen web framework for building APIs and app backends.',\n    long_description=io.open('README.rst', 'r', encoding='utf-8').read(),\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'Environment :: Web Environment',\n        'Natural Language :: English',\n        'Intended Audience :: Developers',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: Apache Software License',\n        'Operating System :: MacOS :: MacOS X',\n        'Operating System :: Microsoft :: Windows',\n        'Operating System :: POSIX',\n        'Topic :: Internet :: WWW/HTTP :: WSGI',\n        'Topic :: Software Development :: Libraries :: Application Frameworks',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n    ],\n    keywords='wsgi web api framework rest http cloud',\n    author='Kurt Griffiths',\n    author_email='mail@kgriffs.com',\n    url='http://falconframework.org',\n    license='Apache 2.0',\n    packages=find_packages(exclude=['tests']),\n    include_package_data=True,\n    zip_safe=False,\n    install_requires=REQUIRES,\n    setup_requires=[],\n    cmdclass=cmdclass,\n    ext_modules=ext_modules,\n    test_suite='nose.collector',\n    entry_points={\n        'console_scripts': [\n            'falcon-bench = falcon.cmd.bench:main'\n        ]\n    }\n)\n", "path": "setup.py"}], "after_files": [{"content": "import glob\nimport imp\nimport io\nimport os\nfrom os import path\nfrom setuptools import setup, find_packages, Extension\nimport sys\n\nMYDIR = path.abspath(os.path.dirname(__file__))\n\nVERSION = imp.load_source('version', path.join('.', 'falcon', 'version.py'))\nVERSION = VERSION.__version__\n\n# NOTE(kgriffs): python-mimeparse is newer than mimeparse, supports Py3\n# TODO(kgriffs): Fork and optimize/modernize python-mimeparse\nREQUIRES = ['six', 'python-mimeparse']\n\nPYPY = True\nCYTHON = False\ntry:\n    sys.pypy_version_info\nexcept AttributeError:\n    PYPY = False\n\nif not PYPY:\n    try:\n        from Cython.Distutils import build_ext\n        CYTHON = True\n    except ImportError:\n        print('\\nWARNING: Cython not installed. '\n              'Falcon will still work fine, but may run '\n              'a bit slower.\\n')\n        CYTHON = False\n\nif CYTHON:\n    def list_modules(dirname):\n        filenames = glob.glob(path.join(dirname, '*.py'))\n\n        module_names = []\n        for name in filenames:\n            module, ext = path.splitext(path.basename(name))\n            if module != '__init__':\n                module_names.append(module)\n\n        return module_names\n\n    ext_modules = [\n        Extension('falcon.' + ext, [path.join('falcon', ext + '.py')])\n        for ext in list_modules(path.join(MYDIR, 'falcon'))]\n\n    ext_modules += [\n        Extension('falcon.util.' + ext,\n                  [path.join('falcon', 'util', ext + '.py')])\n\n        for ext in list_modules(path.join(MYDIR, 'falcon', 'util'))]\n\n    cmdclass = {'build_ext': build_ext}\n\nelse:\n    cmdclass = {}\n    ext_modules = []\n\nsetup(\n    name='falcon',\n    version=VERSION,\n    description='An unladen web framework for building APIs and app backends.',\n    long_description=io.open('README.rst', 'r', encoding='utf-8').read(),\n    classifiers=[\n        'Development Status :: 5 - Production/Stable',\n        'Environment :: Web Environment',\n        'Natural Language :: English',\n        'Intended Audience :: Developers',\n        'Intended Audience :: System Administrators',\n        'License :: OSI Approved :: Apache Software License',\n        'Operating System :: MacOS :: MacOS X',\n        'Operating System :: Microsoft :: Windows',\n        'Operating System :: POSIX',\n        'Topic :: Internet :: WWW/HTTP :: WSGI',\n        'Topic :: Software Development :: Libraries :: Application Frameworks',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: Implementation :: CPython',\n        'Programming Language :: Python :: Implementation :: PyPy',\n        'Programming Language :: Python :: 2.6',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n    ],\n    keywords='wsgi web api framework rest http cloud',\n    author='Kurt Griffiths',\n    author_email='mail@kgriffs.com',\n    url='http://falconframework.org',\n    license='Apache 2.0',\n    packages=find_packages(exclude=['tests']),\n    include_package_data=True,\n    zip_safe=False,\n    install_requires=REQUIRES,\n    setup_requires=[],\n    cmdclass=cmdclass,\n    ext_modules=ext_modules,\n    test_suite='nose.collector',\n    entry_points={\n        'console_scripts': [\n            'falcon-bench = falcon.cmd.bench:main'\n        ]\n    }\n)\n", "path": "setup.py"}]}