We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix NR reporting
See https://github.com/mozmeao/infra/issues/1106

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `snippets/wsgi/app.py`
Content:
```
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 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/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)

{"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"}], "after_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 newrelic.agent\nnewrelic.agent.initialize('newrelic.ini')\n\nimport os  # NOQA\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'snippets.settings')  # NOQA\n\nfrom django.core.wsgi import get_wsgi_application  # NOQA\napplication = get_wsgi_application()\n\nfrom raven.contrib.django.raven_compat.middleware.wsgi import Sentry  # NOQA\napplication = Sentry(application)\n", "path": "snippets/wsgi/app.py"}]}