code: def iter_up(self, include_self=True):
          
          if include_self: yield self
          parent = self.parent
          while parent is not None:
              yield parent
              try:
                  parent = parent.parent
              except AttributeError:
                  return
docs: Iterates up the tree to the root.