A Python HMM code.