pybitmessage.helper_random module¶
Convenience functions for random operations. Not suitable for security / cryptography operations.
-
randomshuffle
(population)[source]¶ Method randomShuffle.
shuffle the sequence x in place. shuffles the elements in list in place, so they are in a random order. As Shuffle will alter data in-place, so its input must be a mutable sequence. In contrast, sample produces a new list and its input can be much more varied (tuple, string, xrange, bytearray, set, etc)
-
randomsample
(population, k)[source]¶ Method randomSample.
return a k length list of unique elements chosen from the population sequence. Used for random sampling without replacement, its called partial shuffle.