prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Django: CursorWrapper expects a sequence or None for params 
  As seen in this partial traceback:
  ```
    File "python3.6/site-packages/scout_apm/django/instruments/sql.py", line 29, in execute
      return self.cursor.execute(sql, params)
    File "python3.6/site-packages/django/db/backends/utils.py", line 80, in execute
      return super(CursorDebugWrapper, self).execute(sql, params)
    File "python3.6/site-packages/django/db/backends/utils.py", line 65, in execute
      return self.cursor.execute(sql, params)
  IndexError: tuple index out of range
  ```
  Currently making a PR to hopefully fix =)
  
  </issue>
  <code>
  [start of src/scout_apm/django/instruments/sql.py]
  1 from __future__ import absolute_import
  2 import logging
  3 
  4 from scout_apm.core.monkey import monkeypatch_method
  5 from scout_apm.core.tracked_request import TrackedRequest
  6 
  7 try:
  8     from django.db.backends.base.base import BaseDatabaseWrapper
  9 except ImportError:
  10     # Backwards compatibility for Django <1.8
  11     from django.db.backends import BaseDatabaseWrapper
  12 
  13 try:
  14     from django.db.backends.utils import CursorWrapper
  15 except ImportError:
  16     # Backwards compatibility for Django <1.9
  17     from django.db.backends.util import CursorWrapper
  18 
  19 logger = logging.getLogger(__name__)
  20 
  21 
  22 class _DetailedTracingCursorWrapper(CursorWrapper):
  23     def execute(self, sql, params=()):
  24         tr = TrackedRequest.instance()
  25         span = tr.start_span(operation='SQL/Query')
  26         span.tag('db.statement', sql)
  27 
  28         try:
  29             return self.cursor.execute(sql, params)
  30         finally:
  31             tr.stop_span()
  32 
  33     def executemany(self, sql, param_list):
  34         span = TrackedRequest.instance().start_span(operation='SQL/Many')
  35         span.tag('db.statement', sql)
  36 
  37         try:
  38             return self.cursor.executemany(sql, param_list)
  39         finally:
  40             TrackedRequest.instance().stop_span()
  41 
  42 
  43 # pylint: disable=too-few-public-methods
  44 class SQLInstrument:
  45 
  46     # The linter thinks the methods we monkeypatch are not used
  47     # pylint: disable=W0612
  48     # pylint: disable=no-method-argument
  49     @staticmethod
  50     def install():
  51         """
  52         Installs ScoutApm SQL Instrumentation by monkeypatching the `cursor`
  53         method of BaseDatabaseWrapper, to return a wrapper that instruments any
  54         calls going through it.
  55         """
  56         @monkeypatch_method(BaseDatabaseWrapper)
  57         def cursor(original, self, *args, **kwargs):
  58             result = original(*args, **kwargs)
  59             return _DetailedTracingCursorWrapper(result, self)
  60 
  61         logger.debug('Monkey patched SQL')
  62
  [end of src/scout_apm/django/instruments/sql.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/src/scout_apm/django/instruments/sql.py b/src/scout_apm/django/instruments/sql.py
  --- a/src/scout_apm/django/instruments/sql.py
  +++ b/src/scout_apm/django/instruments/sql.py
  @@ -20,7 +20,7 @@
   
   
   class _DetailedTracingCursorWrapper(CursorWrapper):
  -    def execute(self, sql, params=()):
  +    def execute(self, sql, params=None):
           tr = TrackedRequest.instance()
           span = tr.start_span(operation='SQL/Query')
           span.tag('db.statement', sql)
  
verification_info: {"golden_diff": "diff --git a/src/scout_apm/django/instruments/sql.py b/src/scout_apm/django/instruments/sql.py\n--- a/src/scout_apm/django/instruments/sql.py\n+++ b/src/scout_apm/django/instruments/sql.py\n@@ -20,7 +20,7 @@\n \n \n class _DetailedTracingCursorWrapper(CursorWrapper):\n-    def execute(self, sql, params=()):\n+    def execute(self, sql, params=None):\n         tr = TrackedRequest.instance()\n         span = tr.start_span(operation='SQL/Query')\n         span.tag('db.statement', sql)\n", "issue": "Django: CursorWrapper expects a sequence or None for params \nAs seen in this partial traceback:\r\n```\r\n  File \"python3.6/site-packages/scout_apm/django/instruments/sql.py\", line 29, in execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"python3.6/site-packages/django/db/backends/utils.py\", line 80, in execute\r\n    return super(CursorDebugWrapper, self).execute(sql, params)\r\n  File \"python3.6/site-packages/django/db/backends/utils.py\", line 65, in execute\r\n    return self.cursor.execute(sql, params)\r\nIndexError: tuple index out of range\r\n```\r\nCurrently making a PR to hopefully fix =)\n", "before_files": [{"content": "from __future__ import absolute_import\nimport logging\n\nfrom scout_apm.core.monkey import monkeypatch_method\nfrom scout_apm.core.tracked_request import TrackedRequest\n\ntry:\n    from django.db.backends.base.base import BaseDatabaseWrapper\nexcept ImportError:\n    # Backwards compatibility for Django <1.8\n    from django.db.backends import BaseDatabaseWrapper\n\ntry:\n    from django.db.backends.utils import CursorWrapper\nexcept ImportError:\n    # Backwards compatibility for Django <1.9\n    from django.db.backends.util import CursorWrapper\n\nlogger = logging.getLogger(__name__)\n\n\nclass _DetailedTracingCursorWrapper(CursorWrapper):\n    def execute(self, sql, params=()):\n        tr = TrackedRequest.instance()\n        span = tr.start_span(operation='SQL/Query')\n        span.tag('db.statement', sql)\n\n        try:\n            return self.cursor.execute(sql, params)\n        finally:\n            tr.stop_span()\n\n    def executemany(self, sql, param_list):\n        span = TrackedRequest.instance().start_span(operation='SQL/Many')\n        span.tag('db.statement', sql)\n\n        try:\n            return self.cursor.executemany(sql, param_list)\n        finally:\n            TrackedRequest.instance().stop_span()\n\n\n# pylint: disable=too-few-public-methods\nclass SQLInstrument:\n\n    # The linter thinks the methods we monkeypatch are not used\n    # pylint: disable=W0612\n    # pylint: disable=no-method-argument\n    @staticmethod\n    def install():\n        \"\"\"\n        Installs ScoutApm SQL Instrumentation by monkeypatching the `cursor`\n        method of BaseDatabaseWrapper, to return a wrapper that instruments any\n        calls going through it.\n        \"\"\"\n        @monkeypatch_method(BaseDatabaseWrapper)\n        def cursor(original, self, *args, **kwargs):\n            result = original(*args, **kwargs)\n            return _DetailedTracingCursorWrapper(result, self)\n\n        logger.debug('Monkey patched SQL')\n", "path": "src/scout_apm/django/instruments/sql.py"}]}