<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def execute(self, query, params=None, cursor=None):
 """Execute query in pool. Returns future yielding closed cursor. You can get rows, lastrowid, etc from the cursor. :param cursor: cursor class(Cursor, DictCursor. etc.) :return: Future of cursor :rtype: Future """

        conn = yield self._get_conn()
        try:
            cur = conn.cursor(cursor)
            yield cur.execute(query, params)
            yield cur.close()
        except:
            self._close_conn(conn)
            raise
        else:
            self._put_conn(conn)
        raise Return(cur)