Python Check If Variable Is Not In Scope