Remove just this node from the tree. The children of this node get attached to the parent.
182844
public void removeChildNode() throws ChildNodeException {
    Node parentLast;
    Node thisLast;

    // Add this nodes children to the end of the Parents children list
    if (!isLeaf() && hasParent()) {
      parentLast = getParentNode().getFirstChild().getPrevSibling();
      thisLast = getFirstChild().getPrevSibling();

      // add the first child to the end of the parent list
      parentLast.setNextSibling(getFirstChild());

      //point the last child to the start of the parent list
      thisLast.setNextSibling(getParentNode().getFirstChild());

      // Now remove self
      getParentNode().removeChild(this);
    }
  }
1334343
def detach_children(self):
        
        for node in self.get_child_nodes():
            node.set_parent(None)
        self._nodes = dict()
9961
public final void detachChildren() {
    for (Node child = first; child != null;) {
      Node nextChild = child.next;
      child.parent = null;
      child.next = null;
      child.previous = null;
      child = nextChild;
    }
    first = null;
  }
73422
def drop(self):
        
        if self.is_root:
            raise ValueError("Cannot drop root node!")

        parent = self.parent
        for child in self.children:
            child.parent = parent
            parent.children.add(child)
        self.children = set()

        parent.sequence_ids.update(self.sequence_ids)
        self.sequence_ids = set()

        parent.remove_child(self)
1263432
public void remove(DepTreeNode child) {
		if (children != null) {
			DepTreeNode node = children.get(child.getName());
			if (node == child) {
				children.remove(child.getName());
			}
		}
		child.setParent(null);
	}
1063251
def detach(self):
        
        if self.parent is not None:
            if self in self.parent.children:
                self.parent.children.remove(self)
            self.parent = None
        return self
925228
public boolean removeChild( AstNode child ) {
        boolean result = this.children.remove(child);
        if (result) {
            child.parent = null;
        }
        return result;
    }
16516
def remove(self, child):
        ''''''
        try:
            self.children.remove(child)
            if isinstance(child, String):
                child._parent = None
        except ValueError:
            pass
125112
public boolean remove(Tree child) {
		if (Config.META.equals(child.key)) {
			Tree meta = getMeta();
			if (meta != null && meta.parent != null) {
				meta.parent.meta = null;
				return true;
			}
		}
		return remove((test) -> {
			return test.key.equals(child.key);
		}
846199
public function remove()
    {
        unset($this->_nodes[$this->_pointer]);
        $this->_nodes = array_values($this->_nodes);
        return $this;
    }
1352184
def delete(self):
        
        # we'll have to manually run through all the nodes that are going
        # to be deleted and remove nodes from the list if an ancestor is
        # already getting removed, since that would be redundant
        removed = {}
        for node in self.order_by('depth', 'path'):
            found = False
            for depth in range(1, int(len(node.path) / node.steplen)):
                path = node._get_basepath(node.path, depth)
                if path in removed:
                    # we are already removing a parent of this node
                    # skip
                    found = True
                    break
            if not found:
                removed[node.path] = node

        # ok, got the minimal list of nodes to remove...
        # we must also remove their children
        # and update every parent node's numchild attribute
        # LOTS OF FUN HERE!
        parents = {}
        toremove = []
        for path, node in removed.items():
            parentpath = node._get_basepath(node.path, node.depth - 1)
            if parentpath:
                if parentpath not in parents:
                    parents[parentpath] = node.get_parent(True)
                parent = parents[parentpath]
                if parent and parent.numchild > 0:
                    parent.numchild -= 1
                    parent.save()
            if node.is_leaf():
                toremove.append(Q(path=node.path))
            else:
                toremove.append(Q(path__startswith=node.path))

        # Django will handle this as a SELECT and then a DELETE of
        # ids, and will deal with removing related objects
        if toremove:
            qset = get_result_class(self.model).objects.filter(reduce(operator.or_, toremove))
            super(MP_NodeQuerySet, qset).delete()
547099
def pop(self):
        
        node = self.nodes.pop()
        self.__keys.remove(node.key)
1268276
function removeChild(parent, element) {
    parent = getComponentNode(parent) || parent;
    element = getComponentNode(element) || element;
    parent.removeChild(element);
    return disconnect(element);
}
402106
function() {
                var nodes, i, node, self = this;
                // Remove all children
                if (self.firstChild) {
                    nodes = [];
                    // Collect the children
                    for (node = self.firstChild; node; node = walk(node, self)) {
                        nodes.push(node);
                    }
                    // Remove the children
                    i = nodes.length;
                    while (i--) {
                        node = nodes[i];
                        node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;
                    }
                }
                self.firstChild = self.lastChild = null;
                return self;
            }
566221
def __remove_child(self, parent_tree_node, index):
        
        # get parent and item
        parent_item = self.__mapping[id(parent_tree_node)]
        # manage the item model
        self.item_model_controller.begin_remove(index, index, parent_item.row, parent_item.id)
        child_item = parent_item.children[index]
        parent_item.remove_child(child_item)
        self.__mapping.pop(id(child_item.data["tree_node"]))
        self.item_model_controller.end_remove()
158572
def unlink(self):
		
		self.parentNode = None
		for child in self.childNodes:
			child.unlink()
		del self.childNodes[:]
603570
def _delete_subtree(self, nodes):
        
        nodes = nodes if isinstance(nodes, list) else [nodes]
        iobj = [
            (self._db[node]["parent"], node)
            for node in nodes
            if self._node_name_in_tree(node)
        ]
        for parent, node in iobj:
            # Delete link to parent (if not root node)
            del_list = self._get_subtree(node)
            if parent:
                self._db[parent]["children"].remove(node)
            # Delete children (sub-tree)
            for child in del_list:
                del self._db[child]
            if self._empty_tree():
                self._root = None
                self._root_hierarchy_length = None