Well, from what one can digest from source, this is a combination of neural network and genetic algorithm implementation. The author's approach is described in head of the source file:
-- Intended for use with the BizHawk emulator and Super Mario World or Super Mario Bros. ROM.
-- For SMW, make sure you have a save state named "DP1.state" at the beginning of a level,
-- and put a copy in both the Lua folder and the root directory of BizHawk.
There seem to be no problem in following this approach in python. You can get inspiration from the author's code or even use prepacked solutions like pyevolve for genetic algorithm implementation in python.