prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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).
  
  </issue>
  <code>
  [start of redash/app.py]
  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
  [end of redash/app.py]
  [start of redash/handlers/chrome_logger.py]
  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 of redash/handlers/chrome_logger.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/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)
  
verification_info: {"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"}]}