def mutShuffleIndexes(individual, indpb):
 size = len(individual)
 for i in xrange(size):
  if (random.random() < indpb):
   swap_indx = random.randint(0, (size - 2))
   if (swap_indx >= i):
    swap_indx += 1
   (individual[i], individual[swap_indx]) = (individual[swap_indx], individual[i])
 return (individual,)

def mutShuffleIndexes ( individual , indpb ) : size = len ( individual ) for i in xrange ( size ) : if ( random . random ( ) < indpb ) : swap_indx = random . randint ( 0 , ( size - 2 ) ) if ( swap_indx >= i ) : swap_indx += 1 ( individual [ i ] , individual [ swap_indx ] ) = ( individual [ swap_indx ] , individual [ i ] ) return ( individual , )
shuffle the attributes of the input individual and return the mutant .