def plan(self):
        current = []
        if self.prim:
            current.append({'primitive': self.prim['name'],
                            'ns': self.ns,
                            'weight': self.prim['weight'],
                            'timeout': self.prim['timeout']})

        if 1 > len(self.children):
            raise ValueError('solution tree not pruned')

        if len(self.children) == 1:
            current += self.children[0].plan()

        current_sorted = sorted(current, key=lambda x: x['weight'],
                                reverse=True)

        if self.parent is None:
            return [{'primitive': x['primitive'],
                     'timeout': x['timeout'],
                     'ns': x['ns']} for x in current_sorted]
        return current_sorted
dataset/ETHPy150Open rcbops/opencenter/opencenter/webapp/solver.py/Solver.plan/swapped operands of `>`