Perform clean-up about nodes that will never be built. Invokes
        a user defined function on all of these nodes (including all
        of their parents).
489106
def will_not_build(self, nodes, node_func=lambda n: None):
        

        T = self.trace

        pending_children = self.pending_children

        to_visit = set(nodes)
        pending_children = pending_children - to_visit

        if T:
            for n in nodes:
                T.write(self.trace_message('       removing node %s from the pending children set\n' %
                        self.trace_node(n)))
        try:
            while len(to_visit):
                node = to_visit.pop()
                node_func(node)

                # Prune recursion by flushing the waiting children
                # list immediately.
                parents = node.waiting_parents
                node.waiting_parents = set()

                to_visit = to_visit | parents
                pending_children = pending_children - parents

                for p in parents:
                    p.ref_count = p.ref_count - 1
                    if T: T.write(self.trace_message('       removing parent %s from the pending children set\n' %
                                  self.trace_node(p)))
        except KeyError:
            # The container to_visit has been emptied.
            pass

        # We have the stick back the pending_children list into the
        # taskmaster because the python 1.5.2 compatibility does not
        # allow us to use in-place updates
        self.pending_children = pending_children
1300479
function() {
        for (var i = 0, length = this.children.length; i < length; i++) {
          this.children[i].destroy();
        }

        this.children = [];

        eachDestroyable(this, function(item) {
          item.destroy();
        });

        this.parent = undefined;
        this.isDestroyed = true;
      }
1324614
def runtime_cleanup(self, selected_uids):
        
        self.run_count = 0
        self.num_nodes = len(selected_uids)
        self.node_results = []
        self._skipped_children = {}
        self._skipped_children = {}
        self._raise_next_tick = None
1080123
function unwrapElements(parent, wrapper) {
  var el = wrapper.childNodes[0];

  // ok, so this looks weird, right?
  // turns out, appending nodes to another node will remove them
  // from the live NodeList, so we can keep iterating over the
  // first item in that list and grab all of them. Nice!
  while (el) {
    parent.appendChild(el);
    el = wrapper.childNodes[0];
  }

  parent.removeChild(wrapper);
}
69177
function cleanUpAST(ast) {
  return walk(ast, function(node, replace) {
    if (node.type === 'Block') {
      var lastIdx = 0;
      var newNodes = [];
      node.nodes.forEach(function(innerNode, i) {
        if (innerNode.type === 'Block' && !innerNode.yield) {
          if (i > 0) newNodes = newNodes.concat(node.nodes.slice(lastIdx, i));
          lastIdx = i + 1;
          newNodes = newNodes.concat(cleanUpAST(innerNode).nodes);
        }
      });
      node.nodes = newNodes.concat(node.nodes.slice(lastIdx));
    }
  });
}
16108
function removeNotNeededNodes(parentElements, newChildren, oldChildren) {
  let remaining = parentElements.childNodes.length;
  if (oldChildren.length !== remaining) {
    console.warn(
      "ZLIQ: Something other then ZLIQ has manipulated the children of the element",
      parentElements,
      ". This can lead to sideffects. Consider using the 'isolated' attribute for this element to prevent updates."
    );
  }

  for (; remaining > newChildren.length; remaining--) {
    let childToRemove = parentElements.childNodes[remaining - 1];
    parentElements.removeChild(childToRemove);

    if (oldChildren.length < remaining) {
      continue;
    } else {
      let { cycle } = oldChildren[remaining - 1];

      triggerLifecycle(childToRemove, { cycle }, "removed");
    }
  }
}
420481
def cleanup(parent = Object, current = @top)
      return unless all_project_objects_lookup[current]
      current.constants.each {|const| cleanup current, current.const_get(const)}
      parent.send(:remove_const, current.to_s.split('::').last.to_sym)
    end
611279
function clean(collection) {
    var ns = /\S/;
    collection.each(function(el) {
        var d = el,
            n = d.firstChild,
            ni = -1,
            nx;
        while (n) {
            nx = n.nextSibling;
            if (n.nodeType == 3 && !ns.test(n.nodeValue)) {
                d.removeChild(n);
            } else {
                n.nodeIndex = ++ni; // FIXME not sure what this is for, and causes IE to bomb (the setter) - @rem
            }
            n = nx;
        }
    });
}
85386
function remove(node, isRemoveChild) {
  if (!node || !node.parentNode) { return; }
  if (node.removeNode) { return node.removeNode(isRemoveChild); }

  const parent = node.parentNode;
  if (!isRemoveChild) {
    const nodes = [];
    for (let i = 0, len = node.childNodes.length; i < len; i++) {
      nodes.push(node.childNodes[i]);
    }

    for (let i = 0, len = nodes.length; i < len; i++) {
      parent.insertBefore(nodes[i], node);
    }
  }

  parent.removeChild(node);
}
1007020
function deleteGlobals() {
  Object.keys(NODEIFY_FUNCTIONS).forEach((nodeifyName) => {
    delete global[nodeifyName];
  });

  Object.keys(PROMISE_TYPES).forEach((promiseName) => {
    delete global[promiseName];
  });
}
225519
function() {
      
      // Remove from DOM
      if(Dom.inDocument(this.el)) {
         this.el.parentNode.removeChild(this.el);
      }
      
      // recursively purge element
      Event.purgeElement(this.el, true);
   }
301645
function empty(node) {
		while (node && node.hasChildNodes()) {
			var child = node.firstChild;
			node.removeChild(child);
		}
	}
802189
function walkAll(nodes){
    var result = undefined
    for (var i=0;i<nodes.length;i++){
      var childNode = nodes[i]
      if (childNode.type === 'EmptyStatement') continue
      result = walk(childNode)
      if (result instanceof ReturnValue){
        return result
      }
    }
    return result
  }
573477
def cleanup(self):
        
        now = time.time()
        expired = now - NODE_TIMEOUT
        if self.conn.zremrangebyscore(self.key, 0, expired):
            self._notify()
606644
def prune(nodes)
      nodes.each do |node|
        node.parent.children.reject!{|n| n == node} if (node != @root) && (node.diff_score < @score_threshold)
      end
    end
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
1204932
function cleanup()
    {
        // destroy loop variable(s)
        foreach ( $this->LoopVariablesNames as $varName )
            $this->Tpl->unsetVariable( $varName, $this->RootNamespace );
    }