Adding initial python port of decoder