#NEWLINE# def processAnswer( self , resource , index_center , index_left , index_right , index_winner ) : #NEWLINE# #INDENT# if ( index_left == index_winner ) : #NEWLINE# #INDENT# q = [ index_left , index_right , index_center ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# q = [ index_right , index_left , index_center ] #NEWLINE# #UNINDENT# resource . append_list ( 'S' , q ) #NEWLINE# n = resource . get ( 'n' ) #NEWLINE# d = resource . get ( 'd' ) #NEWLINE# num_reported_answers = resource . increment ( 'num_reported_answers' ) #NEWLINE# if ( ( num_reported_answers % int ( n ) ) == 0 ) : #NEWLINE# #INDENT# daemon_args_dict = { #NEWLINE# #INDENT# 'task' : '__full_embedding_update' , #NEWLINE# 'args' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# resource . daemonProcess ( daemon_args_dict , time_limit = 30 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# daemon_args_dict = { #NEWLINE# #INDENT# 'task' : '__incremental_embedding_update' , #NEWLINE# 'args' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# resource . daemonProcess ( daemon_args_dict , time_limit = 5 ) #NEWLINE# #UNINDENT# return True