code: def get_parent(self, update=False):
          
          if self.is_root():
              return
          try:
              if update:
                  del self._cached_parent_obj
              else:
                  return self._cached_parent_obj
          except AttributeError:
              pass
          # parent = our most direct ancestor
          self._cached_parent_obj = self.get_ancestors().reverse()[0]
          return self._cached_parent_obj
docs: :returns: the parent node of the current node object.
              Caches the result in the object itself to help in loops.