turing machine python