#NEWLINE# def _parse_token_contents( token_contents ) : #NEWLINE# #INDENT# ( ( _ , experiment_name , alternative ) , remaining_tokens ) = ( token_contents [ : 3 ] , token_contents [ 3 : ] ) #NEWLINE# weight = None #NEWLINE# user_variable = None #NEWLINE# for ( offset , token ) in enumerate ( remaining_tokens ) : #NEWLINE# #INDENT# if ( '=' in token ) : #NEWLINE# #INDENT# ( name , expression ) = token . split ( '=' , 1 ) #NEWLINE# if ( name == 'weight' ) : #NEWLINE# #INDENT# weight = expression #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( name == 'user' ) : #NEWLINE# #INDENT# user_variable = template . Variable ( expression ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( offset == 0 ) : #NEWLINE# #INDENT# weight = token #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( experiment_name , alternative , weight , user_variable )