code: def query(stmt, args=(), factory=None):
      
      ctx = Context.current()
      factory = ctx.default_factory if factory is None else factory
      with ctx.mdr:
          return factory(ctx.execute(stmt, args), ctx.mdr)
docs: Execute a query. This returns an iterator of the result set.