prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  SQLAlchemy executemany not detected in hooks
  In the Django ORM integration, we record `executemany` calls as the `SQL/Many` operation, but this is missing in the SQLAlchemy integration.
  
  </issue>
  <code>
  [start of src/scout_apm/sqlalchemy.py]
  1 # coding=utf-8
  2 from __future__ import absolute_import, division, print_function, unicode_literals
  3 
  4 from sqlalchemy import event
  5 
  6 from scout_apm.core.tracked_request import TrackedRequest
  7 
  8 
  9 def before_cursor_execute(conn, cursor, statement, parameters, context, executemany):
  10     tracked_request = TrackedRequest.instance()
  11     span = tracked_request.start_span(operation="SQL/Query")
  12     span.tag("db.statement", statement)
  13 
  14 
  15 def after_cursor_execute(conn, cursor, statement, parameters, context, executemany):
  16     tracked_request = TrackedRequest.instance()
  17     span = tracked_request.current_span()
  18     if span is not None:
  19         tracked_request.callset.update(statement, 1, span.duration())
  20         if tracked_request.callset.should_capture_backtrace(statement):
  21             span.capture_backtrace()
  22     tracked_request.stop_span()
  23 
  24 
  25 def instrument_sqlalchemy(engine):
  26     if getattr(engine, "_scout_instrumented", False):
  27         return
  28     event.listen(engine, "before_cursor_execute", before_cursor_execute)
  29     event.listen(engine, "after_cursor_execute", after_cursor_execute)
  30     engine._scout_instrumented = True
  31
  [end of src/scout_apm/sqlalchemy.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/sqlalchemy.py b/src/scout_apm/sqlalchemy.py
  --- a/src/scout_apm/sqlalchemy.py
  +++ b/src/scout_apm/sqlalchemy.py
  @@ -7,8 +7,12 @@
   
   
   def before_cursor_execute(conn, cursor, statement, parameters, context, executemany):
  +    if executemany:
  +        operation = "SQL/Many"
  +    else:
  +        operation = "SQL/Query"
       tracked_request = TrackedRequest.instance()
  -    span = tracked_request.start_span(operation="SQL/Query")
  +    span = tracked_request.start_span(operation=operation)
       span.tag("db.statement", statement)
  
verification_info: {"golden_diff": "diff --git a/src/scout_apm/sqlalchemy.py b/src/scout_apm/sqlalchemy.py\n--- a/src/scout_apm/sqlalchemy.py\n+++ b/src/scout_apm/sqlalchemy.py\n@@ -7,8 +7,12 @@\n \n \n def before_cursor_execute(conn, cursor, statement, parameters, context, executemany):\n+    if executemany:\n+        operation = \"SQL/Many\"\n+    else:\n+        operation = \"SQL/Query\"\n     tracked_request = TrackedRequest.instance()\n-    span = tracked_request.start_span(operation=\"SQL/Query\")\n+    span = tracked_request.start_span(operation=operation)\n     span.tag(\"db.statement\", statement)\n", "issue": "SQLAlchemy executemany not detected in hooks\nIn the Django ORM integration, we record `executemany` calls as the `SQL/Many` operation, but this is missing in the SQLAlchemy integration.\n", "before_files": [{"content": "# coding=utf-8\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom sqlalchemy import event\n\nfrom scout_apm.core.tracked_request import TrackedRequest\n\n\ndef before_cursor_execute(conn, cursor, statement, parameters, context, executemany):\n    tracked_request = TrackedRequest.instance()\n    span = tracked_request.start_span(operation=\"SQL/Query\")\n    span.tag(\"db.statement\", statement)\n\n\ndef after_cursor_execute(conn, cursor, statement, parameters, context, executemany):\n    tracked_request = TrackedRequest.instance()\n    span = tracked_request.current_span()\n    if span is not None:\n        tracked_request.callset.update(statement, 1, span.duration())\n        if tracked_request.callset.should_capture_backtrace(statement):\n            span.capture_backtrace()\n    tracked_request.stop_span()\n\n\ndef instrument_sqlalchemy(engine):\n    if getattr(engine, \"_scout_instrumented\", False):\n        return\n    event.listen(engine, \"before_cursor_execute\", before_cursor_execute)\n    event.listen(engine, \"after_cursor_execute\", after_cursor_execute)\n    engine._scout_instrumented = True\n", "path": "src/scout_apm/sqlalchemy.py"}]}