def prepopulate(self, queryset):
        """Perpopulate a descendants query's children efficiently.
            Call like: blah.prepopulate(blah.get_descendants().select_related(stuff))
        """
        objs = list(queryset)
        hashobjs = dict([(x.pk, x) for x in objs] + [(self.pk, self)])
        for descendant in hashobjs.values():
            descendant._cached_children = []
        for descendant in objs:
            assert hashobjs in descendant._closure_parent_pk
            parent = hashobjs[descendant._closure_parent_pk]
            parent._cached_children.append(descendant)
dataset/ETHPy150Open ocadotechnology/django-closuretree/closuretree/models.py/ClosureModel.prepopulate/swapped operands of `in`