#NEWLINE# def generate( full_path ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# chosen = random . sample ( set ( common . sentences ) , 10 ) #NEWLINE# for i in range ( 10 ) : #NEWLINE# #INDENT# sentence = chosen [ i ] #NEWLINE# f = open ( ( ( ( ( full_path + os . sep ) + 'test' ) + str ( i ) ) + '.in' ) , 'w' ) #NEWLINE# f . write ( ( '%s\n' % sentence ) ) #NEWLINE# f . close ( ) #NEWLINE# output = pig_latin ( sentence ) #NEWLINE# f = open ( ( ( ( ( full_path + os . sep ) + 'test' ) + str ( i ) ) + '.out' ) , 'w' ) #NEWLINE# f . write ( ( '%s\n' % output ) ) #NEWLINE# f . close ( ) #NEWLINE# #UNINDENT# return 1 #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return 0