def is_sub_to_all(self, *super_entities):
if super_entities:<EOL><INDENT>if len(super_entities) == <NUM_LIT:1>:<EOL><INDENT>has_subset = EntityRelationship.objects.filter(<EOL>super_entity=super_entities[<NUM_LIT:0>]).values_list('<STR_LIT>', flat=True)<EOL><DEDENT>else:<EOL><INDENT>has_subset = EntityRelationship.objects.filter(<EOL>super_entity__in=super_entities).values('<STR_LIT>').annotate(Count('<STR_LIT>')).filter(<EOL>super_entity__count=len(set(super_entities))).values_list('<STR_LIT>', flat=True)<EOL><DEDENT>return self.filter(id__in=has_subset)<EOL><DEDENT>else:<EOL><INDENT>return self<EOL><DEDENT>
Given a list of super entities, return the entities that have those as a subset of their super entities.