Python Check If Variable Is Instances