Python Nested Function Variable Scope