def get_unique_parents(entity_list):
 unique_parents = set((entity.get_parent() for entity in entity_list))
 return list(unique_parents)

def get_unique_parents ( entity_list ) : unique_parents = set ( ( entity . get_parent ( ) for entity in entity_list ) ) return list ( unique_parents )
translate a list of entities to a list of their parents .