Php Declare Function Inside Function In Python