Python Finite State Engine (Machine) [Clone from Google Code]