#NEWLINE# def try_lock( self , key , lease_time = ( - 1 ) , timeout = ( - 1 ) ) : #NEWLINE# #INDENT# check_not_none ( key , "key can't be None" ) #NEWLINE# key_data = self . _to_data ( key ) #NEWLINE# return self . _encode_invoke_on_key ( multi_map_try_lock_codec , key_data , key = key_data , thread_id = thread_id ( ) , lease = to_millis ( self ) , timeout = to_millis ( timeout ) )