random.seed has changed in python 3, and while there's backwards
compatibility using `version=1`, random.randint and random.sample have
also changed. The most striaghtforward change without adding additional
dependencies then was to copy those methods from the python 2.7 source
code.