#NEWLINE# def from_outputs( outputs ) : #NEWLINE# #INDENT# extracted_outputs = [ ] #NEWLINE# for output in outputs : #NEWLINE# #INDENT# output = c_uint64 ( output ) . value #NEWLINE# extracted_outputs . append ( ( output >> 32 ) ) #NEWLINE# extracted_outputs . append ( ( output & ( ( 1 << 32 ) - 1 ) ) ) #NEWLINE# #UNINDENT# state = java . next_bits . predict_state ( extracted_outputs ) #NEWLINE# for i in range ( 1 , ( int ( ( len ( extracted_outputs ) / 2 ) ) + 1 ) ) : #NEWLINE# #INDENT# if state : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# for inds in combinations ( range ( 0 , len ( extracted_outputs ) , 2 ) , i ) : #NEWLINE# #INDENT# test_outputs = extracted_outputs [ : ] #NEWLINE# for index in inds : #NEWLINE# #INDENT# test_outputs [ index ] += 1 #NEWLINE# #UNINDENT# state = java . next_bits . predict_state ( test_outputs ) #NEWLINE# if state : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( state is None ) : #NEWLINE# #INDENT# raise RuntimeError ( 'Unable to recover internal state. (Not enough values?)' ) #NEWLINE# #UNINDENT# gen = java . next_bits . generate_values ( state , 32 ) #NEWLINE# while True : #NEWLINE# #INDENT# num = c_int64 ( ( next ( gen ) << 32 ) ) . value #NEWLINE# num += c_int32 ( next ( gen ) ) . value #NEWLINE# ( yield c_int64 ( num ) . value )