Expander that expands only the first node on the fringe.
775884
def _first_expander(fringe, iteration, viewer):
    '''
    
    '''
    current = fringe[0]
    neighbors = current.expand(local_search=True)

    if viewer:
        viewer.event('expanded', [current], [neighbors])

    fringe.extend(neighbors)
715419
def dnode(self, node):
        """"""
        new_node = copy(node)
        new_node.lineno += self.dline
        new_node.col_offset += self.dcol
        return new_node
35794
function expandTree(treeId) {
	var ul = document.getElementById(treeId);
	if (ul == null) { return false; }
	expandCollapseList(ul,nodeOpenClass);
}
205334
def _expand(self, coeffsin, nmax):
        
        falpha = _shtools.SlepianCoeffs(self.tapers, coeffsin, nmax)

        return SlepianCoeffs(falpha, self)
469213
public void expand() {
    join(p, r.first());
    join(r.last(), n);
    // Necessary so that garbage collector
    // can delete rule and guard.
    r.theGuard.r = null;
    r.theGuard = null;
  }
980276
def avl_split_first(root):
    
    if root is None:
        raise IndexError('Empty tree has no maximum element')
    root, left, right = avl_release_kids(root)
    if left is None:
        new_root, first_node = right, root
    else:
        new_left, first_node = avl_split_first(left)
        new_root = avl_join(new_left, right, root)
    return (new_root, first_node)
624330
def expand(self, local_search=False):
        ''''''
        new_nodes = []
        for action in self.problem.actions(self.state):
            new_state = self.problem.result(self.state, action)
            cost = self.problem.cost(self.state,
                                     action,
                                     new_state)
            nodefactory = self.__class__
            new_nodes.append(nodefactory(state=new_state,
                                         parent=None if local_search else self,
                                         problem=self.problem,
                                         action=action,
                                         cost=self.cost + cost,
                                         depth=self.depth + 1))
        return new_nodes
1311672
private void findBestWithFirst(DatanodeDescriptor first,
      List<DatanodeDescriptor> listOfNodes, DatanodeDescriptor[] result) {
    for (int in2 = 0; in2 < listOfNodes.size(); in2++) {
      DatanodeDescriptor n2 = listOfNodes.get(in2);
      if (!first.equals(n2)) {
        if (result[1] == null && inWindow(first, n2)) {
          result[0] = first;
          result[1] = n2;
        }

        for (int in3 = in2 + 1; in3 < listOfNodes.size(); in3++) {
          DatanodeDescriptor n3 = listOfNodes.get(in3);
          if (!first.equals(n3)
              && inWindow(first, n3, n2)) {
            result[0] = first;
            result[1] = n2;
            result[2] = n3;
            return;
          }
        }
      }
    }
  }
44639
def expand_region(tuple_of_s, a, b, start=0, stop=None):
    ''''''
    return tuple(expand_slice(s, a, b, start=start, stop=stop)
                 for s in tuple_of_s)
748950
function expand(x, n) {
  var ans=int2bigInt(0, (x.length>n ? x.length : n)*bpe, 0);
  copy_(ans, x);
  return ans;
}
1262064
def expand_squeeze_to_nd(x, n, squeeze_dim=2, expand_dim=-1):
  """"""
  if len(x.shape) > n:
    while len(x.shape) != n:
      x = tf.squeeze(x, [squeeze_dim])
  else:
    while len(x.shape) != n:
      x = tf.expand_dims(x, expand_dim)
  return x
1323943
def expand(self, line, do_expand, force=False, vislevels=0, level=-1):
        """"""

        lastchild = self.GetLastChild(line, level)
        line += 1

        while line <= lastchild:
            if force:
                if vislevels > 0:
                    self.ShowLines(line, line)
                else:
                    self.HideLines(line, line)
            elif do_expand:
                self.ShowLines(line, line)

            if level == -1:
                level = self.GetFoldLevel(line)

            if level & stc.STC_FOLDLEVELHEADERFLAG:
                if force:
                    self.SetFoldExpanded(line, vislevels - 1)
                    line = self.expand(line, do_expand, force, vislevels - 1)

                else:
                    expandsub = do_expand and self.GetFoldExpanded(line)
                    line = self.expand(line, expandsub, force, vislevels - 1)
            else:
                line += 1

        return line
897502
def expand_focussed(self):
        
        if implementsCollapseAPI(self._tree):
            w, focuspos = self.get_focus()
            self._tree.expand(focuspos)
            self._walker.clear_cache()
            self.refresh()
952669
def expand_slice(s, a, b, start=0, stop=None):
    ''''''
    n1 = max(s.start - a, start)
    n2 = s.stop + b
    if stop is not None:
        n2 = min(n2, stop)

    return slice(n1, n2, 1)
29907
def _create_genetic_expander(problem, mutation_chance):
    '''
    
    '''
    def _expander(fringe, iteration, viewer):
        fitness = [x.value for x in fringe]
        sampler = InverseTransformSampler(fitness, fringe)
        new_generation = []

        expanded_nodes = []
        expanded_neighbors = []

        for _ in fringe:
            node1 = sampler.sample()
            node2 = sampler.sample()
            child = problem.crossover(node1.state, node2.state)
            action = 'crossover'
            if random.random() < mutation_chance:
                # Noooouuu! she is... he is... *IT* is a mutant!
                child = problem.mutate(child)
                action += '+mutation'

            child_node = SearchNodeValueOrdered(state=child, problem=problem, action=action)
            new_generation.append(child_node)

            expanded_nodes.append(node1)
            expanded_neighbors.append([child_node])
            expanded_nodes.append(node2)
            expanded_neighbors.append([child_node])

        if viewer:
            viewer.event('expanded', expanded_nodes, expanded_neighbors)

        fringe.clear()
        for node in new_generation:
            fringe.append(node)

    return _expander
462584
function expandCollapseList(ul,cName,itemId) {
	if (!ul.childNodes || ul.childNodes.length==0) { return false; }
	// Iterate LIs
	for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
		var item = ul.childNodes[itemi];
		if (itemId!=null && item.id==itemId) { return true; }
		if (item.nodeName == "LI") {
			// Iterate things in this LI
			var subLists = false;
			for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) {
				var sitem = item.childNodes[sitemi];
				if (sitem.nodeName=="UL") {
					subLists = true;
					var ret = expandCollapseList(sitem,cName,itemId);
					if (itemId!=null && ret) {
						item.className=cName;
						return true;
					}
				}
			}
			if (subLists && itemId==null) {
				item.className = cName;
			}
		}
	}
}
191444
private void expand()
    {
        int i;
        if (isCompact) {
            byte[]  tempArray;
            hashes = new int[INDEXCOUNT];
            tempArray = new byte[UNICODECOUNT];
            for (i = 0; i < UNICODECOUNT; ++i) {
                byte value = elementAt((char)i);
                tempArray[i] = value;
                touchBlock(i >> BLOCKSHIFT, value);
            }
            for (i = 0; i < INDEXCOUNT; ++i) {
                indices[i] = (char)(i<<BLOCKSHIFT);
            }
            values = null;
            values = tempArray;
            isCompact = false;
        }
    }