How to define free-variable in python?,foo()