Python Code for System F6