def get_descendants_with_duplicate_ids()

in project/paperbench/paperbench/rubric/tasks.py [0:0]


    def get_descendants_with_duplicate_ids(self) -> list["TaskNode"]:
        """
        Returns all descendants with duplicate IDs.
        """
        descendants = self.get_descendants_depth_first()
        node_ids = [node.id for node in descendants]
        duplicate_ids = {id for id in node_ids if node_ids.count(id) > 1}
        return [descendant for descendant in descendants if descendant.id in duplicate_ids]