Choose a random element from a non-empty sequence.

    Use this instead of random.choice, with random.random(), for reproducibility

def _choice(rand_gen: Callable[[], float], sequence: Sequence[T]) -> T:
    """Choose a random element from a non-empty sequence.

    Use this instead of random.choice, with random.random(), for reproducibility
    """
    return sequence[int(rand_gen() * len(sequence))]