class_docstr: Tracking SQL queries in a code block.
  
  :param display_num: If True, displays the query number.
  :param display_time: If True, displays the query execution time.
  :param display_trace: If True, displays the simplified (one-line) stack trace
  :param display_sql: If True, displays the SQL statements
  :param display_parameters: If True, display SQL statement parameters
  :param print_fn: The function used to display the text. By default,``builtins.print``
class_docstr_tok: ["Tracking","SQL","queries","in","a","code","block",".",":","param","display_num",":","If","True",",","displays","the","query","number",".",":","param","display_time",":","If","True",",","displays","the","query","execution","time",".",":","param","display_trace",":","If","True",",","displays","the","simplified","(","one-line",")","stack","trace",":","param","display_sql",":","If","True",",","displays","the","SQL","statements",":","param","display_parameters",":","If","True",",","display","SQL","statement","parameters",":","param","print_fn",":","The","function","used","to","display","the","text",".","By","default",",","``","builtins.print","``"]
docstr: Executed after cursor.
  
  :param conn:  connection
  :param cursor:  cursor
  :param statement: statement
  :param parameters: parameters
  :param context: context
  :param executemany: whether many statements executed
  :return:
docstr_tok: ["Executed","after","cursor",".",":","param","conn",":","connection",":","param","cursor",":","cursor",":","param","statement",":","statement",":","param","parameters",":","parameters",":","param","context",":","context",":","param","executemany",":","whether","many","statements","executed",":","return",":"]
code: def after_cursor_execute(
      self,
      conn,
      cursor,
      statement,
      parameters,
      context,
      executemany,
  ):
      """
      Executed after cursor.
  
      :param conn:  connection
      :param cursor:  cursor
      :param statement: statement
      :param parameters: parameters
      :param context: context
      :param executemany: whether many statements executed
      :return:
      """
      total = time.monotonic() - conn.info["query_start_time"].pop()
      file_names = [
          f"{f.filename}:{f.name}:{f.lineno}"
          for f in traceback.extract_stack()
          if "sqlalchemy" not in f.filename
      ]
      file_name = file_names[-1] if file_names else ""
      stack = [
          f
          for f in traceback.extract_stack()
          if "sqlalchemy" not in f.filename
      ]
      stack_info = " > ".join(
          [
              f"{f.filename.rpartition('/')[-1]}:{f.name}:{f.lineno}"
              for f in stack
          ][-7:]
      )
      conn.info.setdefault("query_start_time", []).append(
          time.monotonic()
      )
  
      output_parts = []
      if self.display_num:
          output_parts.append(f"{self.query_count:>3}")
  
      if self.display_time:
          output_parts.append(f"{total:.5f}")
  
      if self.display_trace:
          output_parts.extend([f"{file_name}", f"{stack_info}"])
  
      if self.display_sql:
          sql_oneline = statement.replace("\n", " ")
          output_parts.append(f"{_pretty_format_sql(sql_oneline)}")
  
      if self.display_parameters:
          output_parts.append(f"{parameters}")
  
      self.print_fn(" | ".join(output_parts))
  
file_path: airflow/tests/test_utils/perf/perf_kit/sqlalchemy.py
imports: from __future__ import annotations
  import os
  import time
  import traceback
  from typing import Callable
  from sqlalchemy import event
label_desc: Use image node_id 3 for calling the TraceQueries obj's underlying member method code with example usage: obj.after_cursor_execute(conn, cursor, statement, parameters, context, executemany) without return types