Finds the first node with no incoming links.
2728
private DNode calculateSourceNode() {
        DNode result = DNode.NOT_FOUND;
        
        for (DNode node : nodes) {
            List<DLink> links = getLinksTo(node);
            if (links.size() == 0) {
                result = node;
                break;
            }
        }
        return result;
    }
932916
def first(self):
        """"""
        page = self.get_page(num_elements=1)
        data = self.extract_data(page)
        if data:
            return data[0]
700205
def get_node(self, node_name):
        """"""
        for node in self.nodes:
            if node.__name__ == node_name:
                return node
562681
function getNonEmptyNeighbour( that, node, goBack ) {
		node = node[ goBack ? 'getPrevious' : 'getNext' ]( function( node ) {
			return ( isTextNode( node ) && !isEmptyTextNode( node ) ) ||
				( isHtml( node ) && !isFlowBreaker( node ) && !isLine( that, node ) );
		} );

		return node;
	}
1309618
private static Node getNthSibling(Node first, int index) {
    Node sibling = first;
    while (index != 0 && sibling != null) {
      sibling = sibling.getNext();
      index--;
    }
    return sibling;
  }
215770
function findNodeWithFirstChar(nodeList, char) {
    return [...nodeList].findIndex((el) => el.innerText.charAt(0).toLowerCase() === char.toLowerCase());
}
352442
function getNextLNode(node) {
    // View nodes don't have TNodes, so their next must be retrieved through their LView.
    if (node.tNode.type === 2 /* View */) {
        var viewData = node.data;
        return viewData[NEXT] ? viewData[NEXT][HOST_NODE] : null;
    }
    return node.tNode.next ? node.view[node.tNode.next.index] : null;
}
944427
function findPrevRowNode(node){
	var i, last, prev,
		parent = node.parent,
		siblings = parent ? parent.children : null;

	if(siblings && siblings.length > 1 && siblings[0] !== node){
		// use the lowest descendant of the preceeding sibling
		i = $.inArray(node, siblings);
		prev = siblings[i - 1];
		_assert(prev.tr);
		// descend to lowest child (with a <tr> tag)
		while(prev.children){
			last = prev.children[prev.children.length - 1];
			if(!last.tr){
				break;
			}
			prev = last;
		}
	}else{
		// if there is no preceding sibling, use the direct parent
		prev = parent;
	}
	return prev;
}
832501
def find_cycle(self):
      """"""
      for node in self.nodes:
         cyc = self._follow_children(node)
         if len(cyc) > 0:
            return [self._nodes[x] for x in cyc]
      return None
923388
def find_node(self, x: int, y: int) -> Optional["BSP"]:
        
        if not self.contains(x, y):
            return None
        for child in self.children:
            found = child.find_node(x, y)  # type: Optional["BSP"]
            if found:
                return found
        return self
854065
def find_segment_first(self, *args, **kwargs):
        """"""

        for m in self.find_segments(*args, **kwargs):
            return m

        return None
114701
private void findBestWithoutFirst(List<DatanodeDescriptor> listOfNodes,
      DatanodeDescriptor[] result) {

    readLock();
    try {
      for (int in2 = 0; in2 < listOfNodes.size(); in2++) {
        DatanodeDescriptor n2 = listOfNodes.get(in2);

        for (int in3 = in2 + 1; in3 < listOfNodes.size(); in3++) {
          DatanodeDescriptor n3 = listOfNodes.get(in3);
          if (n2.getNetworkLocation().equals(n3.getNetworkLocation())) {
            RackRingInfo rackInfo = racksMap.get(n2.getNetworkLocation());
            assert (rackInfo != null);
            final int rackSize = rackInfo.rackNodes.size();
            final Integer idN2 = rackInfo.findNode(n2);
            final Integer idN3 = rackInfo.findNode(n3);

            if (idN2 != null && idN3 != null) {
              int dist = (idN3 - idN2 + rackSize) % rackSize;
              if (dist >= machineWindow) {
                dist = rackSize - dist; // try n2 - n3
              }

              if (dist < machineWindow) {
                result[0] = null;
                result[1] = n2;
                result[2] = n3;
                return;
              }
            }
          }
        }
      }
    } finally {
      readUnlock();
    }
  }
1164482
def find_first(data, what):
    '''
    
    '''
    for i, line in enumerate(data):
        if contains(line, what):
            return i
            
    return None
657683
def get_span(self, first_line_no: int) -> Tuple[int, int]:
        
        if not self.nodes:
            raise EmptyBlock('span requested from {} block with no nodes'.format(self.line_type))
        return (
            get_first_token(self.nodes[0]).start[0] - first_line_no,
            get_last_token(self.nodes[-1]).start[0] - first_line_no,
        )
673615
function findFirstTextNode(node) {
          var walker;

          if (node) {
            walker = new TreeWalker(node, node);

            for (node = walker.current(); node; node = walker.next()) {
              if (node.nodeType === 3) {
                return node;
              }
            }
          }
        }
1250974
public E peekFirst() {
        final Node<E> f = first;
        return (f == null) ? null : f.item;
     }
822712
function findDeepestNode(node) {
	while (node.children.length) {
		node = node.children[node.children.length - 1];
	}

	return node;
}