def _set_multi_async_with_policy(self, policy, mapping, time=0,
                                   key_prefix='', namespace=None, rpc=None):
    if not isinstance(time, (int, long, float)):
      raise TypeError('Expiration must be a number.')
    if time < 0.0:
      raise ValueError('Expiration must not be negative.')

    request = MemcacheSetRequest()
    self._add_app_id(request)
    _add_name_space(request, namespace)
    user_key = {}
    server_keys = []
    set_cas_id = (policy == MemcacheSetRequest.CAS)
    for key, value in mapping.iteritems():
      server_key = _key_string(key, key_prefix, user_key)
      stored_value, flags = _validate_encode_value(value, self._do_pickle)
      server_keys.append(server_key)

      item = request.add_item()
      item.set_key(server_key)
      item.set_value(stored_value)
      item.set_flags(flags)
      item.set_set_policy(policy)
      item.set_expiration_time(int(math.ceil(time)))
      if set_cas_id:
        cas_id = self._cas_ids.get(server_key)

        if cas_id is not None:
          item.set_cas_id(cas_id)


          item.set_for_cas(True)

    response = MemcacheSetResponse()


    return self._make_async_call(rpc, 'Set', request, response,
                                 self.__set_with_policy_hook,
                                 (server_keys, user_key))
Async version of _set_multi_with_policy() -- note different return.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/memcache/__init__.py/Client._set_multi_async_with_policy