CloneInstance
@return XPath2NodeIterator
332104
public function CloneInstance()
	{
		$result = new PrecedingNodeIterator();
		$result->AssignFrom( $this );
		$result->kind = $this->kind;
		return $result;
	}
1005081
public function CloneInstance()
	{
		$result = new XBRLFilterMemberNetwork( $this->context, $this->dimension, $this->member, $this->linkRole, $this->arcRole, $this->axis );
		if ( ! is_null( $this->index ) ) $result->index = $this->index;
		if ( ! is_null( $this->memberPath ) ) $result->memberPath = $this->memberPath;
		if ( ! is_null( $this->candidates ) ) $result->candidates = $this->candidates;
		return $result;
	}
834209
public function copyInstance()
    {
        if (
            $this->hasRequestParameter('destinationClassUri')
            && $this->hasRequestParameter('uri')
            && common_Utils::isUri($this->getRequestParameter('destinationClassUri'))
        ) {
            $this->validateInstanceRoot(
                $this->getRequestParameter('uri')
            );

            $this->signatureValidator->checkSignature(
                $this->getRequestParameter('signature'),
                $this->getRequestParameter('uri')
            );

            $instance  = $this->getCurrentInstance();
            $destinationClass = $this->getClass($this->getRequestParameter('destinationClassUri'));

            if ($this->hasWriteAccess($destinationClass->getUri())) {
                $copy = $this->getClassService()->cloneInstance($instance, $destinationClass);

                if(!is_null($copy)){
                    return $this->returnJson([
                        'success'  => true,
                        'data' => [
                            'label' => $copy->getLabel(),
                            'uri'   => $copy->getUri()
                        ]
                    ]);
                }
                return $this->returnJson([
                    'success'  => false,
                    'errorCode' => 204,
                    'errorMessage' =>  __("Unable to copy the resource")
                ], 204);
            }
            return $this->returnJson([
                'success'  => false,
                'errorCode' => 401,
                'errorMessage' =>  __("Permission denied to write in the selected class")
            ], 401);
        }
        return $this->returnJson([
            'success' => false,
            'errorCode' => 412,
            'errorMessage' => __('Missing Parameters')
        ], 412);
    }
1362085
function cloneNode(doc,node,deep){
	var node2 = new node.constructor();
	for(var n in node){
		var v = node[n];
		if(typeof v != 'object' ){
			if(v != node2[n]){
				node2[n] = v;
			}
		}
	}
	if(node.childNodes){
		node2.childNodes = new NodeList();
	}
	node2.ownerDocument = doc;
	switch (node2.nodeType) {
	case ELEMENT_NODE:
		var attrs	= node.attributes;
		var attrs2	= node2.attributes = new NamedNodeMap();
		var len = attrs.length
		attrs2._ownerElement = node2;
		for(var i=0;i<len;i++){
			node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
		}
		break;;
	case ATTRIBUTE_NODE:
		deep = true;
	}
	if(deep){
		var child = node.firstChild;
		while(child){
			node2.appendChild(cloneNode(doc,child,deep));
			child = child.nextSibling;
		}
	}
	return node2;
}
1228704
public function build(): CopyToRequest
	{
		$instance = new CopyToRequest();
		if ($this->nodeId === null) {
			throw new BuilderException('Property [nodeId] is required.');
		}
		$instance->nodeId = $this->nodeId;
		if ($this->targetNodeId === null) {
			throw new BuilderException('Property [targetNodeId] is required.');
		}
		$instance->targetNodeId = $this->targetNodeId;
		$instance->insertBeforeNodeId = $this->insertBeforeNodeId;
		return $instance;
	}
400836
public function xpath($path)
    {
        if ($path === '') {
            return clone $this;
        }
        $query = $this->_document->getQuery();

        $nodes = [];
        foreach ($this->_nodes as $node) {
            /**
             * @var \DOMNode $node2
             */
            foreach ($query->xpath($path, $node) as $node2) {
                $nodes[$node2->getNodePath()] = $node2;
            }
        }

        return new SelectorList($this, array_values($nodes));
    }
1318694
public ITestCaseGenerator cloneOf()
    {
    TupleGenerator other = new TupleGenerator();
    other.setRandomSeed( getRandomSeed());
    other.setDefaultTupleSize( getDefaultTupleSize());
    other.setCombiners( getCombiners().stream().map( TupleCombiner::cloneOf).collect( toList()));
    return other;
    }
945760
def clone(self):
        # TODO: check docstring
        

        new_node = self.__class__(self._name, self._demand)

        return new_node
670719
public function CloneInstance()
	{
		$result = new SpecialDescendantNodeIterator();
		$result->AssignFrom( $this );
		$result->kind = $this->kind;
		return $result;
	}
191721
function duplicate()
    {
        $schema = VF_Singleton::getInstance()->schema();
        $vehicleFinder = new VF_Vehicle_Finder($schema);
        $leaf = $schema->getLeafLevel() . '_id';
        $newProduct = parent::duplicate();
        foreach ($this->getFits() as $fit) {
            print_r($fit);
            exit;
            $vehicle = $vehicleFinder->findByLeaf($fit->$leaf);
            $newProduct->insertMapping($vehicle);
        }
        if ($this->isUniversal()) {
            $newProduct->setUniversal(true);
        }
        return $newProduct;
    }
98801
function clone(node, noChildren){
    var result = node.cloneNode(!noChildren);
    if (result.attachEvent) // clear event handlers for IE
      axis(result, AXIS_DESCENDANT_OR_SELF).forEach(eventUtils.clearHandlers);
    return result;
  }
284326
function deep_copy()
    {
        $node = $this->_frame->get_node();

        if ($node instanceof DOMElement && $node->hasAttribute("id")) {
            $node->setAttribute("data-dompdf-original-id", $node->getAttribute("id"));
            $node->removeAttribute("id");
        }

        $frame = new Frame($node->cloneNode());
        $frame->set_style(clone $this->_frame->get_original_style());

        $deco = Factory::decorate_frame($frame, $this->_dompdf, $this->_root);

        foreach ($this->get_children() as $child) {
            $deco->append_child($child->deep_copy());
        }

        return $deco;
    }
725887
public Document cloneDocument(DOMImplementation domImpl, Document document) {
    Element root = document.getDocumentElement();
    // New document
    Document result = domImpl.createDocument(root.getNamespaceURI(), root.getNodeName(), null);
    Element rroot = result.getDocumentElement();
    // Cloning the document element is a bit tricky.
    // This is adopted from DomUtilities#deepCloneDocument
    boolean before = true;
    for(Node n = document.getFirstChild(); n != null; n = n.getNextSibling()) {
      if(n == root) {
        before = false;
        copyAttributes(result, root, rroot);
        for(Node c = root.getFirstChild(); c != null; c = c.getNextSibling()) {
          final Node cl = cloneNode(result, c);
          if(cl != null) {
            rroot.appendChild(cl);
          }
        }
      }
      else {
        if(n.getNodeType() != Node.DOCUMENT_TYPE_NODE) {
          final Node cl = cloneNode(result, n);
          if(cl != null) {
            if(before) {
              result.insertBefore(cl, rroot);
            }
            else {
              result.appendChild(cl);
            }
          }
        }
      }
    }
    return result;
  }
629620
function () {
                var r = this.cloneImplementation();
                if (typeof (r) !== typeof (this))
                    throw new Error("Error in implementation of cloneImplementation: not returning object of correct type");
                r.name = this.name;
                r.grammarName = this.grammarName;
                r._createAstNode = this._createAstNode;
                return r;
            }
564859
function deep_copy() {
    $frame = new Frame($this->get_node()->cloneNode());
    $frame->set_style(clone $this->_frame->get_original_style());
    $deco = Frame_Factory::decorate_frame($frame, $this->_dompdf);
    $deco->set_root($this->_root);

    foreach ($this->get_children() as $child)
      $deco->append_child($child->deep_copy());

    return $deco;
  }
1317406
public static function fromSourceWithClone( $src, $clone )
	{
		$result = new BufferedNodeIterator();
		$result->src = $clone ? $src->CloneInstance() : $src;
		$result->buffer = array();
		return $result;
	}
820997
public static function OneOrMore( $iter )
	{
		$iter = $iter->CreateBufferedIterator();
		/**
		 * @var XPath2NodeIterator $probe
		 */
		$probe = $iter->CloneInstance();
		if ( ! $probe->MoveNext() )
		    throw XPath2Exception::withErrorCode( "FORG0004", Resources::FORG0004 );

		return $iter;
	}