Python port of JMP