#NEWLINE# def randomizeData( random , inputPath , outputPath ) : #NEWLINE# #INDENT# lines_seen = set ( ) #NEWLINE# data = [ ] #NEWLINE# newDataFile = open ( outputPath , 'w' ) #NEWLINE# for line in open ( inputPath , 'r' ) : #NEWLINE# #INDENT# if ( line != '\n' ) : #NEWLINE# #INDENT# if ( line not in lines_seen ) : #NEWLINE# #INDENT# data . append ( ( random . random ( ) , line ) ) #NEWLINE# lines_seen . add ( line ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# data . sort ( ) #NEWLINE# newDataFile = open ( data , 'w' ) #NEWLINE# for ( _ , line ) in data : #NEWLINE# #INDENT# newDataFile . write ( line ) #NEWLINE# #UNINDENT# newDataFile . close ( )