Moves the root into the appropriate child.
779488
private HamtPMap<K, V> vacateRoot() {
    int bucket = bucket(this.hash);
    int bucketMask = 1 << bucket;
    int index = index(bucketMask);
    if ((mask & bucketMask) != 0) {
      HamtPMap<K, V> newChild = children[index].plus(this.key, shift(this.hash), this.value);
      return new HamtPMap<>(null, 0, null, mask, replaceChild(children, index, newChild));
    }
    HamtPMap<K, V> newChild =
        new HamtPMap<>(this.key, shift(this.hash), this.value, 0, emptyChildren());
    return new HamtPMap<>(null, 0, null, mask | bucketMask, insertChild(children, index, newChild));
  }
1206410
function moveUp(child) {
         var childIndex = this.getChildIndex(child);

         if (childIndex - 1 >= 0) {
           // note : we use an inverted loop
           this.swapChildren(child, this.getChildAt(childIndex - 1));
         }
       }
146943
protected function moveFirstChildBefore()
	{
		$branches = $this->getBranches();
		$this->choose->parentNode->insertBefore(array_pop($branches)->firstChild, $this->choose);
		foreach ($branches as $branch)
		{
			$branch->removeChild($branch->firstChild);
		}
	}
70545
protected void moveChildren(Element parent, Element destination)
    {
        NodeList children = parent.getChildNodes();
        while (children.getLength() > 0) {
            destination.appendChild(parent.removeChild(parent.getFirstChild()));
        }
    }
545642
def child_moved(self, child):
        
        super(UiKitView, self).child_moved(child)
        #: Remove and re-add in correct spot
        #: TODO: Should use exchangeSubviewAtIndex
        self.child_removed(child)
        self.child_added(child)
601065
public Tree parent(Tree root) {
        List<Tree> kids = root.children();
        return traverse(root, kids, this);
    }
1014135
private void condenseTree(IndexTreePath<E> subtree, Stack<N> stack) {
    N node = getNode(subtree.getEntry());
    // node is not root
    if(!isRoot(node)) {
      N parent = getNode(subtree.getParentPath().getEntry());
      int index = subtree.getIndex();
      if(hasUnderflow(node)) {
        if(parent.deleteEntry(index)) {
          stack.push(node);
        }
        else {
          node.adjustEntry(parent.getEntry(index));
        }
      }
      else {
        node.adjustEntry(parent.getEntry(index));
      }
      writeNode(parent);
      // get subtree to parent
      condenseTree(subtree.getParentPath(), stack);
    }

    // node is root
    else {
      if(hasUnderflow(node) && node.getNumEntries() == 1 && !node.isLeaf()) {
        N child = getNode(node.getEntry(0));
        final N newRoot;
        if(child.isLeaf()) {
          newRoot = createNewLeafNode();
          newRoot.setPageID(getRootID());
          for(int i = 0; i < child.getNumEntries(); i++) {
            newRoot.addLeafEntry(child.getEntry(i));
          }
        }
        else {
          newRoot = createNewDirectoryNode();
          newRoot.setPageID(getRootID());
          for(int i = 0; i < child.getNumEntries(); i++) {
            newRoot.addDirectoryEntry(child.getEntry(i));
          }
        }
        writeNode(newRoot);
        height--;
      }
    }
  }
1133832
function () {
        // Find the root node which transform needs update;
        var rootNodeIsDirty = this;
        while (rootNodeIsDirty && rootNodeIsDirty.getParent()
            && rootNodeIsDirty.getParent().transformNeedsUpdate()
        ) {
            rootNodeIsDirty = rootNodeIsDirty.getParent();
        }
        rootNodeIsDirty.update();
    }
582640
def add_child(self, child):
        ''''''
        super(RootNode, self).add_child(child)
        child.attr_wrapper = self.attr_wrapper
467089
def move(self, target, pos=None):
        

        pos = self._prepare_pos_var_for_move(pos)

        sib_order = None
        parent = None

        if pos in ('first-child', 'last-child', 'sorted-child'):
            # moving to a child
            if not target.is_leaf():
                target = target.get_last_child()
                pos = {'first-child': 'first-sibling',
                       'last-child': 'last-sibling',
                       'sorted-child': 'sorted-sibling'}[pos]
            else:
                parent = target
                if pos == 'sorted-child':
                    pos = 'sorted-sibling'
                else:
                    pos = 'first-sibling'
                    sib_order = 1

        if target.is_descendant_of(self):
            raise InvalidMoveToDescendant(
                _("Can't move node to a descendant."))

        if self == target and (
            (pos == 'left') or
            (pos in ('right', 'last-sibling') and
             target == target.get_last_sibling()) or
            (pos == 'first-sibling' and
             target == target.get_first_sibling())):
            # special cases, not actually moving the node so no need to UPDATE
            return

        if pos == 'sorted-sibling':
            if parent:
                self.parent = parent
            else:
                self.parent = target.parent
        else:
            if sib_order:
                self.sib_order = sib_order
            else:
                self.sib_order = self.__class__._get_new_sibling_order(pos,
                                                                       target)
            if parent:
                self.parent = parent
            else:
                self.parent = target.parent

        self.save()
144405
public function moveJStoParent()
    {
        /** @type AbstractView $this->owner */
        $this->owner->js = array_merge_recursive($this->owner->js, $this->js);
    }
1188164
function() {
			var parent = this.parent;
			var ix = parent.children.indexOf(this);
			var items = utils.flatten(arguments);
			spliceFn.apply(parent.children, [ix, 1].concat(items));
			
			// update parent
			items.forEach(function(item) {
				item.parent = parent;
			});
		}
1131269
def transform(root, opts={})
      new_copy = opts[:in_place] ? root : clone_sexp(root)
      scope_stack = ScopeStack.new
      transform_tree(new_copy, scope_stack)
      new_copy
    end
949909
def move_inside(self, parent_id):
          # noqa
        session = Session.object_session(self)
        self.parent_id = parent_id
        self.mptt_move_inside = parent_id
        session.add(self)
1359190
def _translate(self, x, y):
        """"""
        # we add our position relative to our parent and then call then next parent up
        return self.parent._translate((x + self.x), (y + self.y))
654280
def walk_tree(root):
    """"""
    yield root

    for child in root.children:
        for el in walk_tree(child):
            yield el
1077019
function positionRoot(wt) {
    wt.prelim = ( wt.children[0].prelim + 
                  wt.children[0].mod -
                  wt.children[0].x_size/2 +
                  wt.children[wt.num_children - 1].mod + 
                  wt.children[wt.num_children - 1].prelim +
                  wt.children[wt.num_children - 1].x_size/2) / 2;
  }