'Sets a single key with a specified policy.
Helper function for set(), add(), and replace().
Args:
policy:  One of MemcacheSetRequest.SET, .ADD, .REPLACE or .CAS.
key: Key to add, set, or replace.  See docs on Client for details.
value: Value to set.
time: Expiration time, defaulting to 0 (never expiring).
namespace: a string specifying an optional namespace to use in
the request.
Returns:
True if stored, False on RPC error or policy error, e.g. a replace
that failed due to the item not already existing, or an add
failing due to the item not already existing.'

def _set_with_policy(self, policy, key, value, time=0, namespace=None):

    rpc = self._set_multi_async_with_policy(policy, {key: value}, time, '', namespace)
    status_dict = rpc.get_result()
    if (not status_dict):
        return False
    return (status_dict.get(key) == MemcacheSetResponse.STORED)
