We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Make Cypress tests work with Cypress@3.6.0
Running our tests with Cypress@3.5.0 doesn't work. Need to figure out what happened, until then pinning the version to 3.4.1 (#4284).

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `redash/app.py`
Content:
```
1 from flask import Flask
2 from werkzeug.contrib.fixers import ProxyFix
3 
4 from . import settings
5 
6 
7 class Redash(Flask):
8     """A custom Flask app for Redash"""
9     def __init__(self, *args, **kwargs):
10         kwargs.update({
11             'template_folder': settings.STATIC_ASSETS_PATH,
12             'static_folder': settings.STATIC_ASSETS_PATH,
13             'static_url_path': '/static',
14         })
15         super(Redash, self).__init__(__name__, *args, **kwargs)
16         # Make sure we get the right referral address even behind proxies like nginx.
17         self.wsgi_app = ProxyFix(self.wsgi_app, settings.PROXIES_COUNT)
18         # Configure Redash using our settings
19         self.config.from_object('redash.settings')
20 
21 
22 def create_app():
23     from . import authentication, extensions, handlers, limiter, mail, migrate, security
24     from .handlers import chrome_logger
25     from .handlers.webpack import configure_webpack
26     from .metrics import request as request_metrics
27     from .models import db, users
28     from .utils import sentry
29     from .version_check import reset_new_version_status
30 
31     sentry.init()
32     app = Redash()
33 
34     # Check and update the cached version for use by the client
35     app.before_first_request(reset_new_version_status)
36 
37     security.init_app(app)
38     request_metrics.init_app(app)
39     db.init_app(app)
40     migrate.init_app(app, db)
41     mail.init_app(app)
42     authentication.init_app(app)
43     limiter.init_app(app)
44     handlers.init_app(app)
45     configure_webpack(app)
46     extensions.init_app(app)
47     chrome_logger.init_app(app)
48     users.init_app(app)
49 
50     return app
51
```

Path: `redash/handlers/chrome_logger.py`
Content:
```
1 import time
2 import chromelogger
3 from flask import g, request
4 from flask_sqlalchemy import get_debug_queries
5 
6 
7 def log_queries():
8     total_duration = 0.0
9     queries_count = 0
10 
11     chromelogger.group("SQL Queries")
12 
13     for q in get_debug_queries():
14         total_duration += q.duration
15         queries_count += 1
16         chromelogger.info(q.statement % q.parameters)
17         chromelogger.info("Runtime: {:.2f}ms".format(1000 * q.duration))
18 
19     chromelogger.info("{} queries executed in {:.2f}ms.".format(queries_count, total_duration*1000))
20 
21     chromelogger.group_end("SQL Queries")
22 
23 
24 def chrome_log(response):
25     request_duration = (time.time() - g.start_time) * 1000
26     queries_duration = g.get('queries_duration', 0.0)
27     queries_count = g.get('queries_count', 0)
28 
29     group_name = '{} {} ({}, {:.2f}ms runtime, {} queries in {:.2f}ms)'.format(
30         request.method, request.path, response.status_code, request_duration, queries_count, queries_duration)
31 
32     chromelogger.group_collapsed(group_name)
33 
34     endpoint = (request.endpoint or 'unknown').replace('.', '_')
35     chromelogger.info('Endpoint: {}'.format(endpoint))
36     chromelogger.info('Content Type: {}'.format(response.content_type))
37     chromelogger.info('Content Length: {}'.format(response.content_length or -1))
38 
39     log_queries()
40 
41     chromelogger.group_end(group_name)
42 
43     header = chromelogger.get_header()
44     if header is not None:
45         response.headers.add(*header)
46 
47     return response
48 
49 
50 def init_app(app):
51     if not app.debug:
52         return
53 
54     app.after_request(chrome_log)
55
```
--- 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()

```

diff --git a/redash/app.py b/redash/app.py
--- a/redash/app.py
+++ b/redash/app.py
@@ -21,7 +21,6 @@
 
 def create_app():
     from . import authentication, extensions, handlers, limiter, mail, migrate, security
-    from .handlers import chrome_logger
     from .handlers.webpack import configure_webpack
     from .metrics import request as request_metrics
     from .models import db, users
@@ -44,7 +43,6 @@
     handlers.init_app(app)
     configure_webpack(app)
     extensions.init_app(app)
-    chrome_logger.init_app(app)
     users.init_app(app)
 
     return app
diff --git a/redash/handlers/chrome_logger.py b/redash/handlers/chrome_logger.py
deleted file mode 100644
--- a/redash/handlers/chrome_logger.py
+++ /dev/null
@@ -1,54 +0,0 @@
-import time
-import chromelogger
-from flask import g, request
-from flask_sqlalchemy import get_debug_queries
-
-
-def log_queries():
-    total_duration = 0.0
-    queries_count = 0
-
-    chromelogger.group("SQL Queries")
-
-    for q in get_debug_queries():
-        total_duration += q.duration
-        queries_count += 1
-        chromelogger.info(q.statement % q.parameters)
-        chromelogger.info("Runtime: {:.2f}ms".format(1000 * q.duration))
-
-    chromelogger.info("{} queries executed in {:.2f}ms.".format(queries_count, total_duration*1000))
-
-    chromelogger.group_end("SQL Queries")
-
-
-def chrome_log(response):
-    request_duration = (time.time() - g.start_time) * 1000
-    queries_duration = g.get('queries_duration', 0.0)
-    queries_count = g.get('queries_count', 0)
-
-    group_name = '{} {} ({}, {:.2f}ms runtime, {} queries in {:.2f}ms)'.format(
-        request.method, request.path, response.status_code, request_duration, queries_count, queries_duration)
-
-    chromelogger.group_collapsed(group_name)
-
-    endpoint = (request.endpoint or 'unknown').replace('.', '_')
-    chromelogger.info('Endpoint: {}'.format(endpoint))
-    chromelogger.info('Content Type: {}'.format(response.content_type))
-    chromelogger.info('Content Length: {}'.format(response.content_length or -1))
-
-    log_queries()
-
-    chromelogger.group_end(group_name)
-
-    header = chromelogger.get_header()
-    if header is not None:
-        response.headers.add(*header)
-
-    return response
-
-
-def init_app(app):
-    if not app.debug:
-        return
-
-    app.after_request(chrome_log)

{"golden_diff": "diff --git a/redash/app.py b/redash/app.py\n--- a/redash/app.py\n+++ b/redash/app.py\n@@ -21,7 +21,6 @@\n \n def create_app():\n     from . import authentication, extensions, handlers, limiter, mail, migrate, security\n-    from .handlers import chrome_logger\n     from .handlers.webpack import configure_webpack\n     from .metrics import request as request_metrics\n     from .models import db, users\n@@ -44,7 +43,6 @@\n     handlers.init_app(app)\n     configure_webpack(app)\n     extensions.init_app(app)\n-    chrome_logger.init_app(app)\n     users.init_app(app)\n \n     return app\ndiff --git a/redash/handlers/chrome_logger.py b/redash/handlers/chrome_logger.py\ndeleted file mode 100644\n--- a/redash/handlers/chrome_logger.py\n+++ /dev/null\n@@ -1,54 +0,0 @@\n-import time\n-import chromelogger\n-from flask import g, request\n-from flask_sqlalchemy import get_debug_queries\n-\n-\n-def log_queries():\n-    total_duration = 0.0\n-    queries_count = 0\n-\n-    chromelogger.group(\"SQL Queries\")\n-\n-    for q in get_debug_queries():\n-        total_duration += q.duration\n-        queries_count += 1\n-        chromelogger.info(q.statement % q.parameters)\n-        chromelogger.info(\"Runtime: {:.2f}ms\".format(1000 * q.duration))\n-\n-    chromelogger.info(\"{} queries executed in {:.2f}ms.\".format(queries_count, total_duration*1000))\n-\n-    chromelogger.group_end(\"SQL Queries\")\n-\n-\n-def chrome_log(response):\n-    request_duration = (time.time() - g.start_time) * 1000\n-    queries_duration = g.get('queries_duration', 0.0)\n-    queries_count = g.get('queries_count', 0)\n-\n-    group_name = '{} {} ({}, {:.2f}ms runtime, {} queries in {:.2f}ms)'.format(\n-        request.method, request.path, response.status_code, request_duration, queries_count, queries_duration)\n-\n-    chromelogger.group_collapsed(group_name)\n-\n-    endpoint = (request.endpoint or 'unknown').replace('.', '_')\n-    chromelogger.info('Endpoint: {}'.format(endpoint))\n-    chromelogger.info('Content Type: {}'.format(response.content_type))\n-    chromelogger.info('Content Length: {}'.format(response.content_length or -1))\n-\n-    log_queries()\n-\n-    chromelogger.group_end(group_name)\n-\n-    header = chromelogger.get_header()\n-    if header is not None:\n-        response.headers.add(*header)\n-\n-    return response\n-\n-\n-def init_app(app):\n-    if not app.debug:\n-        return\n-\n-    app.after_request(chrome_log)\n", "issue": "Make Cypress tests work with Cypress@3.6.0\nRunning our tests with Cypress@3.5.0 doesn't work. Need to figure out what happened, until then pinning the version to 3.4.1 (#4284).\n", "before_files": [{"content": "from flask import Flask\nfrom werkzeug.contrib.fixers import ProxyFix\n\nfrom . import settings\n\n\nclass Redash(Flask):\n    \"\"\"A custom Flask app for Redash\"\"\"\n    def __init__(self, *args, **kwargs):\n        kwargs.update({\n            'template_folder': settings.STATIC_ASSETS_PATH,\n            'static_folder': settings.STATIC_ASSETS_PATH,\n            'static_url_path': '/static',\n        })\n        super(Redash, self).__init__(__name__, *args, **kwargs)\n        # Make sure we get the right referral address even behind proxies like nginx.\n        self.wsgi_app = ProxyFix(self.wsgi_app, settings.PROXIES_COUNT)\n        # Configure Redash using our settings\n        self.config.from_object('redash.settings')\n\n\ndef create_app():\n    from . import authentication, extensions, handlers, limiter, mail, migrate, security\n    from .handlers import chrome_logger\n    from .handlers.webpack import configure_webpack\n    from .metrics import request as request_metrics\n    from .models import db, users\n    from .utils import sentry\n    from .version_check import reset_new_version_status\n\n    sentry.init()\n    app = Redash()\n\n    # Check and update the cached version for use by the client\n    app.before_first_request(reset_new_version_status)\n\n    security.init_app(app)\n    request_metrics.init_app(app)\n    db.init_app(app)\n    migrate.init_app(app, db)\n    mail.init_app(app)\n    authentication.init_app(app)\n    limiter.init_app(app)\n    handlers.init_app(app)\n    configure_webpack(app)\n    extensions.init_app(app)\n    chrome_logger.init_app(app)\n    users.init_app(app)\n\n    return app\n", "path": "redash/app.py"}, {"content": "import time\nimport chromelogger\nfrom flask import g, request\nfrom flask_sqlalchemy import get_debug_queries\n\n\ndef log_queries():\n    total_duration = 0.0\n    queries_count = 0\n\n    chromelogger.group(\"SQL Queries\")\n\n    for q in get_debug_queries():\n        total_duration += q.duration\n        queries_count += 1\n        chromelogger.info(q.statement % q.parameters)\n        chromelogger.info(\"Runtime: {:.2f}ms\".format(1000 * q.duration))\n\n    chromelogger.info(\"{} queries executed in {:.2f}ms.\".format(queries_count, total_duration*1000))\n\n    chromelogger.group_end(\"SQL Queries\")\n\n\ndef chrome_log(response):\n    request_duration = (time.time() - g.start_time) * 1000\n    queries_duration = g.get('queries_duration', 0.0)\n    queries_count = g.get('queries_count', 0)\n\n    group_name = '{} {} ({}, {:.2f}ms runtime, {} queries in {:.2f}ms)'.format(\n        request.method, request.path, response.status_code, request_duration, queries_count, queries_duration)\n\n    chromelogger.group_collapsed(group_name)\n\n    endpoint = (request.endpoint or 'unknown').replace('.', '_')\n    chromelogger.info('Endpoint: {}'.format(endpoint))\n    chromelogger.info('Content Type: {}'.format(response.content_type))\n    chromelogger.info('Content Length: {}'.format(response.content_length or -1))\n\n    log_queries()\n\n    chromelogger.group_end(group_name)\n\n    header = chromelogger.get_header()\n    if header is not None:\n        response.headers.add(*header)\n\n    return response\n\n\ndef init_app(app):\n    if not app.debug:\n        return\n\n    app.after_request(chrome_log)\n", "path": "redash/handlers/chrome_logger.py"}], "after_files": [{"content": "from flask import Flask\nfrom werkzeug.contrib.fixers import ProxyFix\n\nfrom . import settings\n\n\nclass Redash(Flask):\n    \"\"\"A custom Flask app for Redash\"\"\"\n    def __init__(self, *args, **kwargs):\n        kwargs.update({\n            'template_folder': settings.STATIC_ASSETS_PATH,\n            'static_folder': settings.STATIC_ASSETS_PATH,\n            'static_url_path': '/static',\n        })\n        super(Redash, self).__init__(__name__, *args, **kwargs)\n        # Make sure we get the right referral address even behind proxies like nginx.\n        self.wsgi_app = ProxyFix(self.wsgi_app, settings.PROXIES_COUNT)\n        # Configure Redash using our settings\n        self.config.from_object('redash.settings')\n\n\ndef create_app():\n    from . import authentication, extensions, handlers, limiter, mail, migrate, security\n    from .handlers.webpack import configure_webpack\n    from .metrics import request as request_metrics\n    from .models import db, users\n    from .utils import sentry\n    from .version_check import reset_new_version_status\n\n    sentry.init()\n    app = Redash()\n\n    # Check and update the cached version for use by the client\n    app.before_first_request(reset_new_version_status)\n\n    security.init_app(app)\n    request_metrics.init_app(app)\n    db.init_app(app)\n    migrate.init_app(app, db)\n    mail.init_app(app)\n    authentication.init_app(app)\n    limiter.init_app(app)\n    handlers.init_app(app)\n    configure_webpack(app)\n    extensions.init_app(app)\n    users.init_app(app)\n\n    return app\n", "path": "redash/app.py"}, {"content": null, "path": "redash/handlers/chrome_logger.py"}]}