#NEWLINE# def my_variator( random , candidates , args ) : #NEWLINE# #INDENT# mutants = [ ] #NEWLINE# for c in candidates : #NEWLINE# #INDENT# points = random . sample ( range ( len ( random ) ) , 2 ) #NEWLINE# ( x , y ) = ( min ( points ) , max ( points ) ) #NEWLINE# if ( x == 0 ) : #NEWLINE# #INDENT# mutants . append ( ( c [ y : : ( - 1 ) ] + c [ ( y + 1 ) : ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# mutants . append ( ( ( c [ : x ] + c [ y : ( x - 1 ) : ( - 1 ) ] ) + c [ ( y + 1 ) : ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# return mutants