#NEWLINE# @ profile #NEWLINE# def search_and_find_best_sequence( self , examples_to_learn_from , verbose = False ) : #NEWLINE# #INDENT# examples_to_learn_from = self . fix_unicode ( examples_to_learn_from ) #NEWLINE# ( input_strings , output_strings ) = ( [ ] , [ ] ) #NEWLINE# for ( frm , to ) in examples_to_learn_from : #NEWLINE# #INDENT# input_strings . append ( frm ) #NEWLINE# output_strings . append ( to ) #NEWLINE# #UNINDENT# t1 = time . time ( ) #NEWLINE# ( permutations_tested , transforms_tested ) = self . search_permutations ( examples_to_learn_from , verbose ) #NEWLINE# chosen_transformations = self . best_cur_seq #NEWLINE# best_cost = self . best_distance #NEWLINE# if verbose : #NEWLINE# #INDENT# print ( 'Took {0:.2f}s to find best sequence' . format ( ( time . time ( ) - t1 ) ) ) #NEWLINE# #UNINDENT# return ( chosen_transformations , best_cost )