def cxUniform(ind1, ind2, indpb):
 size = min(len(ind1), len(ind2))
 for i in xrange(size):
  if (random.random() < indpb):
   (ind1[i], ind2[i]) = (ind2[i], ind1[i])
 return (ind1, ind2)

def cxUniform ( ind1 , ind2 , indpb ) : size = min ( len ( ind1 ) , len ( ind2 ) ) for i in xrange ( size ) : if ( random . random ( ) < indpb ) : ( ind1 [ i ] , ind2 [ i ] ) = ( ind2 [ i ] , ind1 [ i ] ) return ( ind1 , ind2 )
executes a uniform crossover that modify in place the two :term:sequence individuals .