Python Function Variable Scope In Ruby