<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, args, consistency):
 """ Execute a CQL query against the server. :param query: The CQL query to execute :type query: str. :param args: The arguments to substitute :type args: dict. :param consistency: The consistency level :type consistency: ConsistencyLevel In order to avoid unpleasant issues of CQL injection (Hey, just because there's no SQL doesn't mean that Little Bobby Tables won't mess things up for you like in XKCD #327) you probably want to use argument substitution instead of concatting strings together to build a query. Thus, like the official CQL driver for non-Twisted python that comes with the Cassandra distro, we do variable substitution. Example:: d = client.execute("UPDATE :table SET 'fff' = :val WHERE " "KEY = :key",{"val":1234, "key": "fff", "table": "blah"}) :returns: A Deferred that fires with either None, an int, or an on the CQL query. e.g. a UPDATE would return None, whereas a SELECT would return an int or some rows Example output:: [{"fff": 1222}] """

        prep_query = prepare(query, args)

        def _execute(client):
            exec_d = client.execute_cql3_query(prep_query,
                                               ttypes.Compression.NONE, consistency)
            if self._disconnect_on_cancel:
                cancellable_d = Deferred(lambda d: self.disconnect())
                exec_d.chainDeferred(cancellable_d)
                return cancellable_d
            else:
                return exec_d

        def _proc_results(result):
            if result.type == ttypes.CqlResultType.ROWS:
                return self._unmarshal_result(result.schema, result.rows,
                                              unmarshallers)
            elif result.type == ttypes.CqlResultType.INT:
                return result.num
            else:
                return None

        d = self._connection()
        d.addCallback(_execute)
        d.addCallback(_proc_results)
        return d