Recursively Add many Simons for performances testing.
180009
private void addManySimons(String prefix, int depth, int groupWidth, int leafWidth, int splitWidth) {
		if (depth == 0) {
			// Generate Simons of type Stopwatch
			final int sibblings = randomInt(Math.min(1, groupWidth / 2), leafWidth);
			for (int i = 0; i < sibblings; i++) {
				String name = prefix + "." + ALPHABET.charAt(i);
				addStopwatchSplits(SimonManager.getStopwatch(name), splitWidth);
			}
		} else {
			// Generate Simons of type Unknown
			final int sibblings = randomInt(Math.min(1, groupWidth / 2), groupWidth);
			for (int i = 0; i < sibblings; i++) {
				String name = prefix + "." + ALPHABET.charAt(i);
				addManySimons(name, depth - 1, groupWidth, leafWidth, splitWidth);
			}
		}
	}
1266263
def insert_many(self, it):
        """"""
        unique_indexes = self._uniqueIndexes  # [ind for ind in self._indexes.values() if ind.is_unique]
        NO_SUCH_ATTR = object()
        new_objs = list(it)
        if unique_indexes:
            for ind in unique_indexes:
                ind_attr = ind.attr
                new_keys = dict((getattr(obj, ind_attr, NO_SUCH_ATTR), obj) for obj in new_objs)
                if not ind.accept_none and (None in new_keys or NO_SUCH_ATTR in new_keys):
                    raise KeyError("unique key cannot be None or blank for index %s" % ind_attr, 
                                    [ob for ob in new_objs if getattr(ob, ind_attr, NO_SUCH_ATTR) is None])
                if len(new_keys) < len(new_objs):
                    raise KeyError("given sequence contains duplicate keys for index %s" % ind_attr)
                for key in new_keys:
                    if key in ind:
                        obj = new_keys[key]
                        raise KeyError("duplicate unique key value '%s' for index %s" % (getattr(obj, ind_attr), ind_attr), 
                                       new_keys[key])
                    
        for obj in new_objs:
            self.obs.append(obj)
            for attr, ind in self._indexes.items():
                obval = getattr(obj, attr)
                ind[obval] = obj

        return self
561569
private void addDescendantElements() {
		for (Node node : nodes) {
			Collection<Node> nodes = new LinkedHashSet<Node>();

			if (initialPart) {
				nodes.add(node);
			}
			
			nodes.addAll(helper.getDescendentNodes(node));

			for(Node n : nodes)
				if (matchTag(n))
					result.add(n);
		}
	}
791853
def append(self, node):
        """"""
        if node.parent == self.key and not self.elapsed_time:
            self.children.append(node)
        else:
            # Recursive call
            for child in self.children:
                if not child.elapsed_time:
                    child.append(node)
488448
def _gen_mods(self, action, records, existing_rrsets):
        '''
        
        '''
        return [r.mod(action, existing_rrsets) for r in records]
161722
private void setup(Collection<T> items, int ps, Comparator<T> sort) {
		Collection<T> list;
		Iterator<T> it;

		if( sort == null ) {
			list = items;
		}
		else {
			list = new TreeSet<T>(sort);
			list.addAll(items);			
		}
		sorter = sort;
		pageSize = ps;
        pages = new ArrayList<Collection<T>>();
		it = list.iterator();		
		while( it.hasNext() ) {
			ArrayList<T> page = new ArrayList<T>();
			
			pages.add(page);
			for(int i=0; i<ps; i++ ) {
                T ob;
                
				if( !it.hasNext() ) {
					break;
				}
                ob = it.next();
				page.add(ob);
			}
		}
	}
1331694
def add(self, member, score):
        """"""
        return self.client.zadd(self.name, member, score)
570789
public void addDefaultSimons() {
		addTime("A", 100);
		addTime("B", 200);
		addTime("C", 300);
		addTime("A", 200);
		addTime("A", 300);
		addTime("B", 100);
		addCounter("X", 1L);
		addCounter("X", 4L);
		addCounter("X", 2L);
		addStopwatchSplits(SimonManager.getStopwatch("$Proxy"), 5);
	}
1275533
def reinforce(self, **kwargs):
        
        results = reinforce_grid(
            self, max_while_iterations=kwargs.get(
                'max_while_iterations', 10),
            copy_graph=kwargs.get('copy_graph', False),
            timesteps_pfa=kwargs.get('timesteps_pfa', None),
            combined_analysis=kwargs.get('combined_analysis', False))

        # add measure to Results object
        if not kwargs.get('copy_graph', False):
            self.network.results.measures = 'grid_expansion'

        return results
1205108
public void addPlugins(final String s) {
        final StringTokenizer t = new StringTokenizer(s, REQUIREMENT_SEPARATOR);
        while (t.hasMoreTokens()) {
            plugins.add(t.nextToken());
        }
    }
836385
def add_to_subset(self, id, s):
        
        n = self.node(id)
        if 'meta' not in n:
            n['meta'] = {}
        meta = n['meta']
        if 'subsets' not in meta:
            meta['subsets'] = []
        meta['subsets'].append(s)
960366
final void addChild(AbstractSimon simon) {
		children.add(simon);
		simon.setParent(this);
		simon.enabled = enabled;
	}
1192774
def _recursive_upsert(context, params, data):
    """"""
    children = params.get("children", {})
    nested_calls = []
    for child_params in children:
        key = child_params.get("key")
        child_data_list = ensure_list(data.pop(key))
        if isinstance(child_data_list, dict):
            child_data_list = [child_data_list]
        if not (isinstance(child_data_list, list) and
                all(isinstance(i, dict) for i in child_data_list)):
            context.log.warn(
                "Expecting a dict or a lost of dicts as children for key", key
            )
            continue
        if child_data_list:
            table_suffix = child_params.get("table_suffix", key)
            child_params["table"] = params.get("table") + "_" + table_suffix
            # copy some properties over from parent to child
            inherit = child_params.get("inherit", {})
            for child_data in child_data_list:
                for dest, src in inherit.items():
                    child_data[dest] = data.get(src)
                nested_calls.append((child_params, child_data))
    # Insert or update data
    _upsert(context, params, data)
    for child_params, child_data in nested_calls:
        _recursive_upsert(context, child_params, child_data)
1315182
async def add_all(self, recursive=False):
        
        tasks = [self.auto_add(device, recursive=recursive)
                 for device in self.get_all_handleable_leaves()]
        results = await gather(*tasks)
        success = all(results)
        return success
39514
void  addValToSets(List<RBBINode> sets, int val) {
        for (RBBINode usetNode : sets) {
            addValToSet(usetNode, val);
        }
    }
31212
def add_info (self, s):
        
        if s not in self.info:
            self.info.append(s)
130655
public void addChildren(int index, List<? extends N> children) {
    List<N> origChildren = Lists.newArrayList(this.children);
    int origNumChildren = this.children.size();
    // Temporarily remove the original children from index onward (in reverse order).
    for (int i = origNumChildren - 1; i >= index; i--) {
      removeChild(i);
    }
    // Add the new children.
    addChildren(children);
    // Add back the original children that we temporarily removed (in correct order).
    addChildren(origChildren.subList(index, origNumChildren));
  }