def METHOD_NAME(self, seq):
    """Return a random element from a (non-empty) sequence.
    If the seqence is empty, raises IndexError.
    """
    if len(seq) == 0:
        raise IndexError("empty sequence")
    return seq[self.randrange(len(seq))]