Python implementation of the F4PL