Python State Machine Classification Definition