prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Fix NR reporting
  See https://github.com/mozmeao/infra/issues/1106
  
  </issue>
  <code>
  [start of snippets/wsgi/app.py]
  1 """
  2 WSGI config for snippets project.
  3 
  4 It exposes the WSGI callable as a module-level variable named ``application``.
  5 
  6 For more information on this file, see
  7 https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
  8 """
  9 import os
  10 os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'snippets.settings')  # NOQA
  11 
  12 from django.core.wsgi import get_wsgi_application
  13 
  14 import newrelic.agent
  15 from decouple import config
  16 from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
  17 
  18 application = get_wsgi_application()
  19 
  20 application = Sentry(application)
  21 
  22 # Add NewRelic
  23 newrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')
  24 newrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)
  25 if newrelic_ini and newrelic_license_key:
  26     newrelic.agent.initialize(newrelic_ini)
  27     application = newrelic.agent.wsgi_application()(application)
  28
  [end of snippets/wsgi/app.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/snippets/wsgi/app.py b/snippets/wsgi/app.py
  --- a/snippets/wsgi/app.py
  +++ b/snippets/wsgi/app.py
  @@ -6,22 +6,14 @@
   For more information on this file, see
   https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
   """
  -import os
  -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'snippets.settings')  # NOQA
  -
  -from django.core.wsgi import get_wsgi_application
  -
   import newrelic.agent
  -from decouple import config
  -from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
  +newrelic.agent.initialize('newrelic.ini')
   
  +import os  # NOQA
  +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'snippets.settings')  # NOQA
  +
  +from django.core.wsgi import get_wsgi_application  # NOQA
   application = get_wsgi_application()
   
  +from raven.contrib.django.raven_compat.middleware.wsgi import Sentry  # NOQA
   application = Sentry(application)
  -
  -# Add NewRelic
  -newrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')
  -newrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)
  -if newrelic_ini and newrelic_license_key:
  -    newrelic.agent.initialize(newrelic_ini)
  -    application = newrelic.agent.wsgi_application()(application)
  
verification_info: {"golden_diff": "diff --git a/snippets/wsgi/app.py b/snippets/wsgi/app.py\n--- a/snippets/wsgi/app.py\n+++ b/snippets/wsgi/app.py\n@@ -6,22 +6,14 @@\n For more information on this file, see\n https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/\n \"\"\"\n-import os\n-os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'snippets.settings')  # NOQA\n-\n-from django.core.wsgi import get_wsgi_application\n-\n import newrelic.agent\n-from decouple import config\n-from raven.contrib.django.raven_compat.middleware.wsgi import Sentry\n+newrelic.agent.initialize('newrelic.ini')\n \n+import os  # NOQA\n+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'snippets.settings')  # NOQA\n+\n+from django.core.wsgi import get_wsgi_application  # NOQA\n application = get_wsgi_application()\n \n+from raven.contrib.django.raven_compat.middleware.wsgi import Sentry  # NOQA\n application = Sentry(application)\n-\n-# Add NewRelic\n-newrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')\n-newrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)\n-if newrelic_ini and newrelic_license_key:\n-    newrelic.agent.initialize(newrelic_ini)\n-    application = newrelic.agent.wsgi_application()(application)\n", "issue": "Fix NR reporting\nSee https://github.com/mozmeao/infra/issues/1106\n", "before_files": [{"content": "\"\"\"\nWSGI config for snippets project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/\n\"\"\"\nimport os\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'snippets.settings')  # NOQA\n\nfrom django.core.wsgi import get_wsgi_application\n\nimport newrelic.agent\nfrom decouple import config\nfrom raven.contrib.django.raven_compat.middleware.wsgi import Sentry\n\napplication = get_wsgi_application()\n\napplication = Sentry(application)\n\n# Add NewRelic\nnewrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')\nnewrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)\nif newrelic_ini and newrelic_license_key:\n    newrelic.agent.initialize(newrelic_ini)\n    application = newrelic.agent.wsgi_application()(application)\n", "path": "snippets/wsgi/app.py"}]}