link node's parent
762654
protected function link_nodes(&$node, $is_child)
	{
		$node->parent = $this->parent;
		$this->parent->nodes[] = $node;
		if ($is_child)
		{
			$this->parent->children[] = $node;
		}
	}
260845
def data_parent(self) -> Optional["InternalNode"]:
        """"""
        parent = self.parent
        while parent:
            if isinstance(parent, DataNode):
                return parent
            parent = parent.parent
644756
def url(self, node):
        
        a_node = node.findParent('a')
        if not a_node:
            return None

        if self.link_callback is None:
            return a_node.get('href')
        else:
            return self.link_callback(a_node.get('href'))
340770
def makeDoubleLinked(dom, parent=None):
    
    dom.parent = parent

    for child in dom.childs:
        child.parent = dom
        makeDoubleLinked(child, dom)
561585
function nodeOwnOnlyChildrenAttach(parentEl, beforeEl) {
    this.sel = document.createComment(this.id);
    insertBefore(this.sel, parentEl, beforeEl);

    for (var i = 0; i < this.aNode.children.length; i++) {
        var child = createNode(
            this.aNode.children[i],
            this,
            this.childScope || this.scope,
            this.childOwner || this.owner
        );
        this.children.push(child);
        child.attach(parentEl, beforeEl);
    }

    this.el = document.createComment(this.id);
    insertBefore(this.el, parentEl, beforeEl);

    this.lifeCycle = LifeCycle.attached;
}
807714
function(node, lines, parentName, depth) {

    // Default depth.
    if (_.isUndefined(depth)) {
      depth = 0;
    }

    // Default parentName.
    if (_.isUndefined(parentName)) {
      parentName = 'root';
    }

    if (isTask(node)) {

      // This is a task so add to lines and nothing further.
      lines.push({
        depth: depth,
        name: getName(node),
        parentName: parentName,
        description: node.description
      });

    } else if (isBranch(node)) {

      lines.push({
        depth: depth,
        name: getName(node),
        parentName: parentName
      });
      node.children.forEach(function(child) {
        recAdd(child, lines, getName(node), depth + 1);
      });

    } else {

      // This should never happen.
      assert(false);

    }

  }
605781
void linkLast(E e) {
        final Node<E> l = last;
        final Node<E> newNode = new Node<>(l, e, null);
        last = newNode;
        if (l == null)
            first = newNode;
        else
            l.next = newNode;
        size++;
        modCount++;
    }
1260234
function addRelToGraph(node){
    var children = [];
    for (var prop in node){
        if(node.hasOwnProperty(prop)){
            if (typeof node[prop] === 'object') {

                var linkedNodes = node[prop];
                // same for links
                if (colorsByLinkType[prop] == null) {
                    colorsByLinkType[prop] = getRandomColor();
                }
                
                for (var i = 0; i < linkedNodes.length; i++) {
                    //find node by id in the array (using jQuery)
                    const linkedNode = linkedNodes[i];
                    var nodeResult = getNodeFromId(linkedNode);
                    gChildrenNodes.push(nodeResult);
                    children.push(nodeResult);
                    //if the node is displayed, we add a link otherwise we will need to add it later
                    if (contains(gNodesDisplayed, nodeResult)){
                        g.addLink(node._id, nodeResult._id, prop);
                    } else {
                        nodesToBeLinked[nodeResult._id] = delayLinkCreation(node._id, nodeResult._id, prop);
                    }


                }
            }
        }
    }
    gNodesWithChildren[node._id] = children;
}
1325839
def parent(self, parent):
        
        self._parent = parent
        self.graph.add(
            (self.asNode(), RDF_NAMESPACES.CAPITAINS.parent, parent.asNode())
        )
        parent._add_member(self)
630739
function(node, inDragLayer) {
      // find top-level parent
      var parent = node;

      while (parent.parent().nonempty())
      {
        parent = parent.parent()[0];

        // var pstyle = parent._private.style;
        // if( pstyle.width.value !== 'auto' || pstyle.height.value !== 'auto' ){
        //   parent = node;
        //   break;
        // }
      }

      // no parent node: no node to add to the drag layer
      if (parent == node && inDragLayer)
      {
        return;
      }

      var nodes = parent.descendants().add(parent);

      for (var i=0; i < nodes.size(); i++)
      {

        nodes[i]._private.rscratch.inDragLayer = inDragLayer;

        // TODO when calling this function for a set of nodes, we visit same edges over and over again,
        // instead of adding edges for each node, it may be better to iterate all edges at once
        // or another solution is to find out the common ancestors and process only those nodes for edges
        for (var j=0; j<nodes[i]._private.edges.length; j++) {
          nodes[i]._private.edges[j]._private.rscratch.inDragLayer = inDragLayer;
        }
      }
    }
403421
function addLinkToParent(idNode, idParentNode){
    g.addLink(idParentNode, idNode, nodesToBeLinked[idNode].name);
    delete nodesToBeLinked[idNode];

    //we remove the node from childrenNodes
    var index = childrenNodes.indexOf(idNode);
    if (index > -1) {
        childrenNodes.splice(index, 1);
    }
}
640972
function traverse(node, callback) {
    callback(node);
    for (var i = 0, cn = node.childNodes, len = cn.length; i < len; i++) {
        var childNode = cn[i];
        if (childNode.tagName) {
            traverse(childNode, callback);
        }
    }
}
390924
function(node) {
            var parent = node.getParent();
            while(parent) {
                if(parent._id === this._id) {
                    return true;
                }
                parent = parent.getParent();
            }

            return false;
        }
824117
def parent_of(self, name):
        
        if not self._in_tag(name):
            return

        node = self.cur_node
        while node.tag != name:
            node = node.getparent()
        self.cur_node = node.getparent()
851764
void link(Node<K, V> sentinel, Node<K, V> node) {
    node.setPreviousInVariableOrder(sentinel.getPreviousInVariableOrder());
    node.setNextInVariableOrder(sentinel);

    sentinel.getPreviousInVariableOrder().setNextInVariableOrder(node);
    sentinel.setPreviousInVariableOrder(node);
  }
42253
function(parentEl) {
      
      var innerSpan;
      
      if (this.options.type === "link" || this.options.type === "submit-link") {
         
         this.el = inputEx.cn('a', {className: this.options.className, id:this.options.id, href:"#"});
         Dom.addClass(this.el,this.options.type === "link" ? "inputEx-Button-Link" : "inputEx-Button-Submit-Link");
         
         innerSpan = inputEx.cn('span', null, null, this.options.value);
         
         this.el.appendChild(innerSpan);
         
      // default type is "submit" input
      } else {
         
         this.el = inputEx.cn('input', {type: "submit", value: this.options.value, className: this.options.className, id:this.options.id});
         Dom.addClass(this.el,"inputEx-Button-Submit");
      }
      
      parentEl.appendChild(this.el);
      
      if (this.options.disabled) {
         this.disable();
      }
      
      this.initEvents();
      
      return this.el;
   }
181930
function Link(name, data, prev, next) {

    /**
     * @public
     * @memberOf {Link}
     * @property
     * @type {String}
     * */
    this.name = name;

    /**
     * @public
     * @memberOf {Link}
     * @property
     * @type {Link}
     * */
    this.prev = prev;

    /**
     * @public
     * @memberOf {Link}
     * @property
     * @type {Link}
     * */
    this.next = next;

    /**
     * @public
     * @memberOf {Link}
     * @property
     * @type {*}
     * */
    this.data = data;
}