Removes all elements named after each elements_or_paths. If clear_empty is True,
    for each XPATH, empty parents are removed if all their children are removed.
    :see: remove_element(parent_to_parse, element_path)
321177
def remove_elements(parent_to_parse, element_paths, clear_empty=False):
    

    element = get_element(parent_to_parse)
    removed = []

    if element is None or not element_paths:
        return removed

    if isinstance(element_paths, string_types):
        rem = remove_element(element, element_paths, clear_empty)
        removed.extend(rem if isinstance(rem, list) else [rem])
    else:
        for xpath in element_paths:
            rem = remove_element(element, xpath, clear_empty)
            removed.extend(rem if isinstance(rem, list) else [rem])

    return removed
345507
function () {
        var children = this._children;

        for (var idx = 0; idx < children.length; idx++) {
            children[idx]._parent = null;

            if (this._scene) {
                children[idx].traverse(this._removeSelfFromScene, this);
            }
        }

        this._children = [];
    }
1220073
public void clear() {
        List<Widget> children = getChildren();
        Log.d(TAG, "clear(%s): removing %d children", getName(), children.size());
        for (Widget child : children) {
            removeChild(child, true);
        }
        requestLayout();
    }
811405
def remove_element_attributes(elem_to_parse, *args):
    

    element = get_element(elem_to_parse)

    if element is None:
        return element

    if len(args):
        attribs = element.attrib
        return {key: attribs.pop(key) for key in args if key in attribs}

    return {}
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");
    }
  }
}
1094866
public function clearElements()
	{
		parent::clearElements();
		$types = new self();
		$types->fromFile();
		$this->elements = $types->elements;
	}
265832
function cleanLinks( el ) {
		var i;
		for ( i = 0; i < el.length; i++ ) {
			el[ i ].innerHTML = cleanPath( el[ i ].innerHTML );
		}
	}
852180
function removeElementById(elementId) {
  let el = document.getElementById(elementId);
  if (el) {
    el.parentNode.removeChild(el);
  }
}
1282056
void clear()
    {
        NodeBuilder current = this;
        while (current != null && current.upperBound != null)
        {
            current.clearSelf();
            current = current.child;
        }
        current = parent;
        while (current != null && current.upperBound != null)
        {
            current.clearSelf();
            current = current.parent;
        }
    }
1181293
def delete_retired
      # Iterate all children, and repeat recursively if a child itself has children, to delete all retired elements:
      children.each do |element|
        dict_element = LIBRARY.element(element.tag)
        delete(element.tag) if dict_element && dict_element.retired?
        element.delete_retired if element.children?
      end
    end
1029418
def remove_if_present(self, *tagnames):
        
        for tagname in tagnames:
            element = self.find(qn(tagname))
            if element is not None:
                self.remove(element)
550838
function(elem) {
		if (elem) {
			while (isWhitespace(elem.firstChild)) {
				// trim leading whitespace text nodes
				elem.removeChild(elem.firstChild);
			}
			// trim leading whitespace text
			trimPattern(elem.firstChild, LEADING);
			while (isWhitespace(elem.lastChild)) {
				// trim trailing whitespace text nodes
				elem.removeChild(elem.lastChild);
			}
			// trim trailing whitespace text
			trimPattern(elem.lastChild, TRAILING);
		}
	}
343260
def clear_children(self):
        
        if (self.get_children_metadata().is_read_only() or
                self.get_children_metadata().is_required()):
            raise errors.NoAccess()
        self._my_map['childIds'] = self._children_default
61836
def remove_all_attributes(element, exclude=None):
    
    if exclude is None:
        exclude = []
    for k in element.attrib.keys():
        if k not in exclude:
            element.attrib.pop(k)
1205184
function () {
            if (!el) {
                return;
            }

            if (el.nodeType === NODE_TYPE.TEXT_NODE) {
                while (el.nextSibling && el.nextSibling.nodeType === NODE_TYPE.TEXT_NODE) {
                    el.nodeValue += el.nextSibling.nodeValue;
                    el.parentNode.removeChild(el.nextSibling);
                }
            } else {
                dom(el.firstChild).normalizeTextNodes();
            }
            dom(el.nextSibling).normalizeTextNodes();
        }
1173231
def remove_certain_leaves(tr, to_remove=lambda node: False):
    

    tips = [tip for tip in tr if to_remove(tip)]
    for node in tips:
        if node.is_root():
            return None
        parent = node.up
        parent.remove_child(node)
        # If the parent node has only one child now, merge them.
        if len(parent.children) == 1:
            brother = parent.children[0]
            brother.dist += parent.dist
            if parent.is_root():
                brother.up = None
                tr = brother
            else:
                grandparent = parent.up
                grandparent.remove_child(parent)
                grandparent.add_child(brother)
    return tr
444573
function () {
		var element = this.element,
			childNodes = element.childNodes,
			i = childNodes.length;

		while (i--) {
			element.removeChild(childNodes[i]);
		}
	}