#NEWLINE# def _incrdecr_async( self , key , is_negative , delta , namespace = None , initial_value = None , rpc = None ) : #NEWLINE# #INDENT# 'Async version of _incrdecr().\n\n    Returns:\n      A UserRPC instance whose get_result() method returns the same\n      kind of value as _incrdecr() returns.\n    ' #NEWLINE# if ( not isinstance ( delta , ( int , long ) ) ) : #NEWLINE# #INDENT# raise TypeError ( ( 'Delta must be an integer or long, received %r' % delta ) ) #NEWLINE# #UNINDENT# if ( delta < 0 ) : #NEWLINE# #INDENT# raise ValueError ( 'Delta must not be negative.' ) #NEWLINE# #UNINDENT# if ( not isinstance ( key , basestring ) ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# it = iter ( key ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if is_negative : #NEWLINE# #INDENT# delta = ( - delta ) #NEWLINE# #UNINDENT# return self . offset_multi_async ( dict ( ( ( k , delta ) for k in it ) ) , namespace = namespace , initial_value = initial_value , rpc = rpc ) #NEWLINE# #UNINDENT# #UNINDENT# request = MemcacheIncrementRequest ( ) #NEWLINE# self . _add_app_id ( request ) #NEWLINE# _add_name_space ( request , namespace ) #NEWLINE# response = MemcacheIncrementResponse ( ) #NEWLINE# request . set_key ( _key_string ( key ) ) #NEWLINE# request . set_delta ( delta ) #NEWLINE# if is_negative : #NEWLINE# #INDENT# request . set_direction ( MemcacheIncrementRequest . DECREMENT ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# request . set_direction ( MemcacheIncrementRequest . INCREMENT ) #NEWLINE# #UNINDENT# if ( initial_value is not None ) : #NEWLINE# #INDENT# request . set_initial_value ( long ( initial_value ) ) #NEWLINE# initial_flags = None #NEWLINE# if isinstance ( initial_value , int ) : #NEWLINE# #INDENT# initial_flags = TYPE_INT #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( initial_value , long ) : #NEWLINE# #INDENT# initial_flags = TYPE_LONG #NEWLINE# #UNINDENT# #UNINDENT# if ( initial_flags is not None ) : #NEWLINE# #INDENT# request . set_initial_flags ( initial_flags ) #NEWLINE# #UNINDENT# #UNINDENT# return self . _make_async_call ( rpc , 'Increment' , request , response , self . __incrdecr_hook , None )