#NEWLINE# @ classmethod #NEWLINE# def generate_new_thread_id( cls , exploration_id ) : #NEWLINE# #INDENT# 'Generates a new thread id, unique within the exploration.\n\n        Exploration ID + the generated thread ID is globally unique.\n        ' #NEWLINE# for _ in range ( _MAX_RETRIES ) : #NEWLINE# #INDENT# thread_id = ( utils . base64_from_int ( utils . get_current_time_in_millisecs ( ) ) + utils . base64_from_int ( utils . get_random_int ( _RAND_RANGE ) ) ) #NEWLINE# if ( not cls . get_by_exp_and_thread_id ( _ , thread_id ) ) : #NEWLINE# #INDENT# return thread_id #NEWLINE# #UNINDENT# #UNINDENT# raise Exception ( 'New thread id generator is producing too many collisions.' )