Replace this element with the given DOMElement.
518359
def replace_with(self, other):
        """"""
        self.after(other)
        self.parent.pop(self._own_index)
        return other
8116
void addElement(KElement element) {
		if (!this.elements.contains(element)) {
			element.setIndex(this.elements.size());
			this.elements.add(element);
		}
	}
600848
private function replaceElementsWithPara(Element $node): ?self {
        // Check to see if the node no longer exist.
        // 'Ghost' nodes have their ownerDocument property set to null - will throw a warning on access.
        // Use another common property with isset() - won't throw any warnings.
        if (!isset($node->nodeName)) {
            return null;
        }

        $newEl = $this->document()->createElement('p');

        $newEl->append($node->contents()->detach());

        foreach ($node->attributes as $attr) {
            $newEl->attr($attr->localName, $attr->nodeValue);
        }

        $node->replaceWith($newEl);

        return $this;
    }
233834
function replaceNode(replacementNode, node) {
  remove(replacementNode)
  node.parentNode.insertBefore(replacementNode, node)
  remove(node)
}
302242
public static void replaceOrAppend(Element e, Widget widget) {
    assert e != null && widget != null;
    if ($(e).widget() != null && $(e).widget().isAttached()) {
      replaceWidget($(e).widget(), widget, true);
    } else {
      detachWidget(widget);
      replaceOrAppend(e, widget.getElement());
      attachWidget(widget, getFirstParentWidget(widget));
    }
  }
644458
def replacenode(self, othereplus, node):
        """"""
        node = node.upper()
        self.dt[node.upper()] = othereplus.dt[node.upper()]
1029187
public function replace(QuiteSimpleXMLElement $element)
    {
        $oldNode = $this->asDOMElement();
        $newNode = $oldNode->ownerDocument->importNode(
            $element->asDOMElement(),
            true
        );
        $oldNode->parentNode->replaceChild($newNode, $oldNode);
    }
1359887
public E insert(E element) {
        E evicted = null;
        if (size() >= capacity) {
            if (evictPolicy == EvictPolicy.REJECT_NEW) {
                // reject the new element
                return element;
            }
            // Evict first, so we do not need to resize
            evicted = evict();
        }
        deque.offerLast(element);
        return evicted;
    }
601489
public void replace(T item) throws IOException {
        removeAll((Class)item.getClass());
        data.add(item);
        onModified();
    }
982302
public void replace(TLVElement childToBeReplaced, TLVElement newChild) {
        for (int i = 0; i < children.size(); i++) {
            if (children.get(i).equals(childToBeReplaced)) {
                children.set(i, newChild);
                return;
            }
        }
    }
40800
public function replace($source)
    {
        foreach ($this as $node) {
            if ($node instanceof Element) {
                $node->replace($source);
            }
        }
    }
813536
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
  {

    error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);  //"replaceChild not supported!");

    return null;
  }
1274573
def add(self, element):
        """"""
        key = self._transform(element)
        if key not in self._elements:
            self._elements[key] = element
62823
function replace (obj, key, val) {
  if (obj.hasOwnProperty(key)) obj[key] = val;
  return obj;
}
577732
def replace(document, search, replace):
    
    newdocument = document
    searchre = re.compile(search)
    for element in newdocument.iter():
        if element.tag == '{%s}t' % nsprefixes['w']:  # t (text) elements
            if element.text:
                if searchre.search(element.text):
                    element.text = re.sub(search, replace, element.text)
    return newdocument
333904
def _replace_element_by_own_content(self, element):
        
        # pylint: disable=no-self-use

        if element.has_children_elements():
            children = element.get_children_elements()
            for child in children:
                element.insert_before(child)
            element.remove_node()
        elif element.has_children():
            element.replace_node(element.get_first_node_child())
526477
def update_from_element(self, elem):
        """"""
        self._elem = elem

        for attrname in self.attributes:
            try:
                delattr(self, attrname)
            except AttributeError:
                pass

        document_url = elem.attrib.get('href')
        if document_url is not None:
            self._url = document_url

        return self