code: def leaves(self, unique=True):
          
          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
docs: Get the leaves of the tree starting at this root.