@@ -0,0 +1,757 @@
+#!/usr/bin/env python%0A%0Aimport re%0A%0Adef parse(votestr):%0A    votes = (v.split(',') for v in (v for v in votestr.split()))%0A%0A    dash_vote = re.compile(r'%5E(%5Cd+)-(%5Cd+)$')%0A    votes = (range(int(dash_vote.match(v%5B0%5D).groups()%5B0%5D),%0A                   int(dash_vote.match(v%5B0%5D).groups()%5B1%5D) + 1) %5C%0A             if dash_vote.match(v%5B0%5D) else v for v in votes)%0A    try:%0A        votes = (int(v) for sub in votes for v in sub if v)%0A        votes = %5Bv for v in set(votes)%5D%0A    except ValueError as ve:%0A        from StringIO import StringIO%0A        buf = StringIO()%0A        print %3E%3E buf, %22Can't parse next voting:%22%0A        print %3E%3E buf, ' '*8 + votestr%0A        print %3E%3E buf, %22Parser error:%22, ve%0A        raise SyntaxError(buf.getvalue())%0A    votes.sort()%0A    return votes%0A%0A

Add votes parser