code: def set_parent(self, parent):
          
          if self._parent == parent:
              return
          if self._parent:
              self._parent.remove_child(self)
          self._parent = parent
          if parent:
              parent.add_child(self)
docs: Set the parent of the treeitem
  
          :param parent: parent treeitem
          :type parent: :class:`TreeItem` | None
          :returns: None
          :rtype: None
          :raises: None