def execute_query_return_result_proxy(query):
context = query._compile_context()<EOL>context.statement.use_labels = False<EOL>if query._autoflush and not query._populate_existing:<EOL><INDENT>query.session._autoflush()<EOL><DEDENT>conn = query._get_bind_args(<EOL>context,<EOL>query._connection_from_session,<EOL>close_with_result=True)<EOL>return conn.execute(context.statement, query._params)<EOL>
Execute a query, yield result proxy.

:param query: :class:`sqlalchemy.orm.Query`,
    has to be created from ``session.query(Object)``

:return: :class:`sqlalchemy.engine.result.ResultProxy`