code: def check_stmt_trace(self, cx, expected):
      try:
          traced = []
          cx.set_trace_callback(lambda stmt: traced.append(stmt))
          yield
      finally:
          self.assertEqual(traced, expected)
          cx.set_trace_callback(None)
  
imports: import contextlib
  import sqlite3
  import unittest
  from test.support.os_helper import TESTFN, unlink
  from .util import memory_database, cx_limit, with_tracebacks
  from .util import MemoryDatabaseMixin
label_desc: Use image node_id 1 for calling the TraceCallbackTests obj's underlying member method code with example usage: obj.check_stmt_trace(cx, expected) without return types