import random


def choice(seq):
    """ Choose a random element from a non-empty sequence.
        (Based on the Python 2.x code for random.choice, and used for deterministic results across
         platforms as Python 3.x changed the way random.choice worked.)
    """
    return seq[int(random.random() * len(seq))]