Python Defining Functions After Function Call