Just a note-to-self to prevent me from reinventing the wheel again.
A shuffle that always produces a predictable output.
e.g.
>>> x = [0,1,2,3,4,5,6,7,8,9]
>>> dshuffle(x)
[7, 8, 1, 5, 3, 4, 2, 0, 9, 6]
>>> dshuffle(x)
[7, 8, 1, 5, 3, 4, 2, 0, 9, 6]
>>> dshuffle(x)
[7, 8, 1, 5, 3, 4, 2, 0, 9, 6]
Update the state to get new predictable values:
>>> rnd = Random(1) # different seed
>>> rnd_state = rnd.getstate()
>>> x = [0,1,2,3,4,5,6,7,8,9]
>>> dshuffle(x)
[6, 8, 9, 7, 5, 3, 0, 4, 1, 2]
>>> dshuffle(x)
[6, 8, 9, 7, 5, 3, 0, 4, 1, 2]
>>> dshuffle(x)
[6, 8, 9, 7, 5, 3, 0, 4, 1, 2]