Returns the successor of the given list based on the level and whether TAB or the arrow keys are used
499656
function(oList, bArrow){
		function getNextOnSameLevel(oLst){
			var oParent = oLst.getParent();
			var aParentSubLists = oParent.getSubLists();
			var idx = oParent.indexOfSubList(oLst) + 1;
			if (idx < aParentSubLists.length) {
				return aParentSubLists[idx];
			}
			return null;
		}

		function getFirstChild(oLst){
			var aSubLists = oLst.getSubLists();
			if (aSubLists.length > 0) {
				return aSubLists[0];
			}
			return null;
		}

		function getNext(oLst){
			var oNextListRef = getNextOnSameLevel(oLst);
			if (oNextListRef) {
				return oNextListRef;
			}
			var oParent = oLst.getParent();
			if (oParent._iLevel > (bArrow ? 1 : 0)) {
				return getNext(oParent);
			} else {
				return null;
			}
		}

		if (oList._iLevel == 0) {
			return getFirstChild(oList);
		} else if (oList._iLevel == 1) {
			return bArrow ? getFirstChild(oList) : getNextOnSameLevel(oList);
		} else if (oList._iLevel > 1) {
			var oNextList = getFirstChild(oList);
			if (oNextList) {
				return oNextList;
			}

			return getNext(oList);
		}
		return null;
	}
531880
private int sequentialFindDelete(
    int              lower,
    int              upper,
    Object           delKey)
  {
    java.util.Comparator comp = deleteComparator();
    int xcc;                       /* Current compare result                */
    int idx = -1;                  /* The returned index (-1 if not found)  */
    for (int i = lower; i <= upper; i++)
    {
      xcc = comp.compare(delKey, _nodeKey[i]);
      if (xcc == 0)                /* Found a match                         */
        {
          idx = i;                 /* Remember current point                */
          break;
        }
    }
    return idx;
  }
231847
def get_next_sibling(self):
        
        siblings = self.get_siblings()
        ids = [obj.pk for obj in siblings]
        if self.pk in ids:
            idx = ids.index(self.pk)
            if idx < len(siblings) - 1:
                return siblings[idx + 1]
126210
function getKeyFromList(list, key, value) {
    for (var i = list.length - 1; i >= 0; i--) {
        if (list[i][key] == value) {
            return list[i];
        }
    }
    return false;
}
838895
def nextKey(self, key):
        """"""
        ans = self.nextNode(key)
        return (ans.key
                if ans is not None
                else None)
717689
function getLevelDepth(e, id, waypoint, cnt) {
    cnt = cnt || 0;
    if (e.id.indexOf(id) >= 0) {
        return cnt;
    }
    if ($(e).hasClass(waypoint)) {
        ++cnt;
    }
    return e.parentNode && getLevelDepth(e.parentNode, id, waypoint, cnt);
}
598841
public static <T, L extends List<T>> T getLast(List<T> list) {
        return isNullOrEmpty(list) ? null : list.get(list.size() - 1);
    }
759714
def get(self, key):
        
        if key not in self:
            self[key] = set(get_descendants(self._target_graph, key))
        return self[key]
24638
function sort_mx (mx_list) {
    const sorted = mx_list.sort((a,b) => a.priority - b.priority);

    // This isn't a very good shuffle but it'll do for now.
    for (let i=0,l=sorted.length-1; i<l; i++) {
        if (sorted[i].priority === sorted[i+1].priority) {
            if (Math.round(Math.random())) { // 0 or 1
                const j = sorted[i];
                sorted[i] = sorted[i+1];
                sorted[i+1] = j;
            }
        }
    }
    return sorted;
}
332727
def getSuccessors(jobGraph, alreadySeenSuccessors, jobStore):
        
        successors = set()
        def successorRecursion(jobGraph):
            # For lists of successors
            for successorList in jobGraph.stack:

                # For each successor in list of successors
                for successorJobNode in successorList:

                    # If successor not already visited
                    if successorJobNode.jobStoreID not in alreadySeenSuccessors:

                        # Add to set of successors
                        successors.add(successorJobNode.jobStoreID)
                        alreadySeenSuccessors.add(successorJobNode.jobStoreID)

                        # Recurse if job exists
                        # (job may not exist if already completed)
                        if jobStore.exists(successorJobNode.jobStoreID):
                            successorRecursion(jobStore.load(successorJobNode.jobStoreID))

        successorRecursion(jobGraph)  # Recurse from jobGraph

        return successors
323110
private static int next_idx( long [] tl ) {
    // Spin until we can CAS-acquire a fresh index
    while( true ) {
      int oldidx = (int)tl[0];
      int newidx = (oldidx+1)&(MAX_EVENTS-1);
      if( CAS( tl, 0, oldidx, newidx ) )
        return oldidx;
    }
  }
487399
function removeSubKeyFromList(list, sub, key, value) {
    for (var i = list.length - 1; i >= 0; i--) {
        if (a4p.isDefined(list[i][sub]) && (list[i][sub][key] == value)) {
            return list.splice(i, 1); // remove from array
        }
    }
    return false;
}
756081
private void rechecksqlistpl()
    {
    	if(data != null)
    	{
    		Node[] childrens = ((SimpleNode)data).getChildren();
    		if(childrens != null && childrens.length > 0)
    		{
    			boolean switchcase = true;
    			for(Node node:childrens)
    			{
    				if(!(node instanceof ASTText))
    				{
    					switchcase = false;
    					break;
    				}
    			}
    			if(switchcase)
    			{
    				this.esInfo.setTpl(false);
    				 
    			}
    			else
    			{
    				this.esInfo.setTpl(true);
    			}
    		}
    		
    	}
    }
1329990
function getNextLevel($level)
    {
        $levels = $this->getLevels();
        $level_incdeces = $this->getLevelIndeces();
        $level_index = $level_incdeces[$level];
        if (!isset($levels[$level_index + 1])) {
            return false;
        }
        $next_level = $levels[$level_index + 1];
        return $next_level;
    }
1195455
function next(prev, current, isPre) {
    if (prev && prev.parentNode === current || isPre(current)) {
        return current.nextSibling || current.parentNode;
    }

    return current.firstChild || current.nextSibling || current.parentNode;
}
1285714
def from_list(commands):
    
    def subtrees(commands, level):
        if not commands:
            return

        acc = []
        parent, *commands = commands

        for command in commands:
            if command['level'] > level:
                acc.append(command)
            else:
                yield (parent, acc)
                parent = command
                acc.clear()
        yield (parent, acc)

    def walk(commands, level=0):
        return [
            {
                'description': key['description'],
                'children': walk(subtree, level + 1),
                'id': key['id']
            }
            for key, subtree in subtrees(commands, level)
        ]

    return walk(commands)
1031593
function(newnode, oldnode, lastnode, id, ids) {
		var result = true,
			oldid = this._assistant.id(oldnode);
		if ((result = this._check(newnode, oldnode, lastnode, id, ids))) {
			if (oldid) {
				ids = gui.Object.copy(ids);
				lastnode = newnode;
				ids[oldid] = true;
				id = oldid;
			}
			result = this._crawl(newnode.firstChild, oldnode.firstChild, lastnode, id, ids);
		}
		return result;
	}