code: def __init__(self, options):
      if sys.version_info < (3,):
          self.u = eval("u''")
          import thread
  
          self.threadid = thread.get_ident
          self.stringtypes = (unicode, str)
          self.numtypes = (int, long, float)
          self.binarytypes = (buffer,)
      else:
          self.u = ""
          import _thread
  
          self.threadid = _thread.get_ident
          self.stringtypes = (str,)
          self.numtypes = (int, float)
          self.binarytypes = (bytes,)
      self.options = options
      if options.output in ("-", "stdout"):
          self._writer = sys.stdout.write
      elif options.output == "stderr":
          self._writer = sys.stderr.write
      else:
          self._writer = open(options.output, "wt").write
  
      try:
          import apsw
  
          apsw.connection_hooks.append(self.connection_hook)
      except:
          sys.stderr.write(self.u + "Unable to import apsw\n")
          raise
  
      self.mapping_open_flags = apsw.mapping_open_flags
      self.zeroblob = apsw.zeroblob
      self.apswConnection = apsw.Connection
  
      self.newcursor = {}
      self.threadsused = {}  # really want a set
      self.queries = {}
      self.timings = {}
      self.rowsreturned = 0
      self.numcursors = 0
      self.numconnections = 0
      self.timestart = time.time()
  
imports: import time
  import sys
  import weakref
label_desc: Use image node_id 1 to create a new APSWTracer object from inherited base classes: object with example: obj = APSWTracer(options)