def setup(self):
        super(GetBranchMixin, self).setup()

        qs = self.model._default_manager.all()
        if hasattr(self, 'root'):
            descendants = self.root.get_descendants()
            if isinstance(descendants, list):
                descendants = [d.pk for d in descendants]
            qs = qs.exclude(pk__in=descendants)

        if self.model is MPTTPlace:
            qs = qs.filter(level=1)
        elif self.model is TreePlace:
            qs = qs.filter(path__level=2)
        elif self.model is TreebeardALPlace:
            qs = qs.filter(parent__isnull=False, parent__parent__isnull=True)
        else:
            qs = qs.filter(depth=2)
        try:
            self.branch = qs[qs.count() // 2]
        except __HOLE__:
            raise SkipTest
dataset/ETHPy150Open BertrandBordage/django-tree/benchmark/base.py/GetBranchMixin.setup