#NEWLINE# def _set_multi_async_with_policy( self , policy , mapping , time = 0 , key_prefix = '' , namespace = None , rpc = None ) : #NEWLINE# #INDENT# 'Async version of _set_multi_with_policy() -- note different return.\n\n    Returns:\n      A UserRPC instance whose get_result() method returns None if\n      there was a network error, or a dict mapping (user) keys to\n      status values otherwise, where each status is one of STORED,\n      NOT_STORED, ERROR, or EXISTS.\n    ' #NEWLINE# if ( not isinstance ( time , ( int , long , float ) ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Expiration must be a number.' ) #NEWLINE# #UNINDENT# if ( set_cas_id < 0.0 ) : #NEWLINE# #INDENT# raise ValueError ( 'Expiration must not be negative.' ) #NEWLINE# #UNINDENT# request = MemcacheSetRequest ( ) #NEWLINE# self . _add_app_id ( request ) #NEWLINE# _add_name_space ( request , namespace ) #NEWLINE# user_key = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# server_keys = [ ] #NEWLINE# set_cas_id = ( policy == MemcacheSetRequest . CAS ) #NEWLINE# for ( key , value ) in mapping . iteritems ( ) : #NEWLINE# #INDENT# server_key = _key_string ( key , key_prefix , user_key ) #NEWLINE# ( stored_value , flags ) = _validate_encode_value ( value , self . _do_pickle ) #NEWLINE# server_keys . append ( server_key ) #NEWLINE# item = request . add_item ( ) #NEWLINE# item . set_key ( server_key ) #NEWLINE# item . set_value ( stored_value ) #NEWLINE# item . set_flags ( flags ) #NEWLINE# item . set_set_policy ( policy ) #NEWLINE# item . set_expiration_time ( int ( math . ceil ( time ) ) ) #NEWLINE# if set_cas_id : #NEWLINE# #INDENT# cas_id = self . _cas_ids . get ( server_key ) #NEWLINE# if ( cas_id is not None ) : #NEWLINE# #INDENT# item . set_cas_id ( cas_id ) #NEWLINE# item . set_for_cas ( True ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# response = MemcacheSetResponse ( ) #NEWLINE# return self . _make_async_call ( rpc , 'Set' , request , response , self . __set_with_policy_hook , ( server_keys , user_key ) )