compiling javascript code to python