python reseeds the random number generator each time