Python Test If Variable Is Defined