Working python code for simplified file parsing and Transition class.