python3 compatibility for get_instances function