def leaves(self, unique=True):
        """Get the leaves of the tree starting at this root."""
        if not self.children:
            return [self]
        else:
            res = list()
            for child in self.children:
                for sub_child in child.leaves(unique=unique):
                    if not unique or sub_child not in res:
                        res.append(sub_child)
            return res
Get the leaves of the tree starting at this root.