Add a node with a given base name to the Nugget and return ID.
776349
def add_node(self, name_base, attrs=None):
        """"""
        if name_base not in self.counters:
            node_id = name_base
        else:
            node_id = '%s_%d' % (name_base, self.counters[name_base])
        node = {'id': node_id}
        if attrs:
            node['attrs'] = attrs
        self.nodes.append(node)
        self.counters[node_id] += 1
        return node_id
1092452
public Node appendNode(Object name, Map attributes, Object value) {
        return new Node(this, name, attributes, value);
    }
69270
def _augment_node(node: BaseEntity) -> BaseEntity:
    """"""
    rv = node.copy()
    rv['id'] = node.as_sha512()
    rv['bel'] = node.as_bel()
    for m in chain(node.get(MEMBERS, []), node.get(REACTANTS, []), node.get(PRODUCTS, [])):
        m.update(_augment_node(m))
    return rv
597928
function spawnNodesWithId (n, factory, callback) {
  spawnNodes(n, factory, (err, nodes) => {
    if (err) return callback(err)
    map(nodes, identify, callback)
  })
}
70164
def _add_node(self, agent):
        """"""
        if agent is None:
            return
        node_label = _get_node_label(agent)
        if isinstance(agent, Agent) and agent.bound_conditions:
            bound_agents = [bc.agent for bc in agent.bound_conditions if
                            bc.is_bound]
            if bound_agents:
                bound_names = [_get_node_label(a) for a in bound_agents]
                node_label = _get_node_label(agent) + '/' + \
                             '/'.join(bound_names)
                self._complex_nodes.append([agent] + bound_agents)
            else:
                node_label = _get_node_label(agent)
        node_key = _get_node_key(agent)
        if node_key in self.existing_nodes:
            return
        self.existing_nodes.append(node_key)
        self.graph.add_node(node_key,
                            label=node_label,
                            **self.node_properties)
1054015
def get_node_name_from_id(node_id, nodes):
        
        node_name = ''
        for node in nodes:
            if node['id'] == node_id:
                node_name = node['properties']['name']
                break
        return node_name
57071
async def addNodeTag(self, iden, tag, valu=(None, None)):
        '''
        
        '''
        buid = s_common.uhex(iden)

        parts = tag.split('.')
        self._reqUserAllowed('tag:add', *parts)

        async with await self.cell.snap(user=self.user) as snap:
            with s_provenance.claim('coreapi', meth='tag:add', user=snap.user.iden):

                node = await snap.getNodeByBuid(buid)
                if node is None:
                    raise s_exc.NoSuchIden(iden=iden)

                await node.addTag(tag, valu=valu)
                return node.pack()
1005170
def add_node(self, payload):
        
        self.nodes.append(Node(len(self.nodes), payload))
        return len(self.nodes) - 1
762539
def addNode(self, node):
        
        LOGGER.info('Adding node {}({})'.format(node.name, node.address))
        message = {
            'addnode': {
                'nodes': [{
                    'address': node.address,
                    'name': node.name,
                    'node_def_id': node.id,
                    'primary': node.primary,
                    'drivers': node.drivers,
                    'hint': node.hint
                }]
            }
        }
        self.send(message)
331599
def add_node(self, node):
        """"""
        nodes = [n for n in self.nodes() if not isinstance(n, Source)]
        num_agents = len(nodes)
        curr_generation = int((num_agents - 1) / float(self.generation_size))
        node.generation = curr_generation

        if curr_generation == 0:
            if self.initial_source:
                source = min(
                    self.nodes(type=Source),
                    key=attrgetter('creation_time'))
                source.connect(whom=node)
                source.transmit(to_whom=node)
        else:
            prev_agents = Node.query\
                .filter_by(failed=False,
                           network_id=self.id,
                           generation=(curr_generation - 1))\
                .all()
            prev_fits = [p.fitness for p in prev_agents]
            prev_probs = [(f / (1.0 * sum(prev_fits))) for f in prev_fits]

            rnd = random.random()
            temp = 0.0
            for i, probability in enumerate(prev_probs):
                temp += probability
                if temp > rnd:
                    parent = prev_agents[i]
                    break

            parent.connect(whom=node)
            parent.transmit(to_whom=node)
38723
def add(node_name, **kwargs):
    
    result = {}
    kwargs = kwargs.copy()
    overwrite = kwargs.pop('overwrite', False)
    node = nago.core.get_node(node_name)
    if not node:
        node = nago.core.Node()
    elif not overwrite:
        result['status'] = 'error'
        result['message'] = "node %s already exists. add argument overwrite=1 to overwrite it." % (node_name)
        return result
    else:
        node.delete()
        node = nago.core.Node()
    node['host_name'] = node_name
    for k, v in kwargs.items():
        node[k] = v
    node.save()
    result['message'] = "node successfully saved"
    result['node_data'] = node.data
    return result
950896
def add_node(self, node_id, name, labels):
        
        node = self.graph_db.get_or_create_indexed_node('Node', 'node_id', node_id, {'node_id': node_id, 'name': name})
        try:
            node.add_labels(*labels)
        except NotImplementedError:
            pass
411079
function _new_node_at(bnode, level){

	ll("adding " + bnode.id() + " at level " + level + "!");

	// Create new vertex and add to set.
	var new_vertex = new bbop.layout.sugiyama.simple_vertex(bnode.id());
	new_vertex.level = level;
	vertex_set[ new_vertex.id() ] = new_vertex;
	
	// Check the node in to the 'seen' references.
	first_seen_reference[ new_vertex.id() ] = level;
	last_seen_reference[ new_vertex.id() ] = level;		 
    }
835060
def add_node(self, node):
        """"""
        nodes = self.nodes()

        # Start with a core of m0 fully-connected agents...
        if len(nodes) <= self.m0:
            other_nodes = [n for n in nodes if n.id != node.id]
            for n in other_nodes:
                node.connect(direction="both", whom=n)

        # ...then add newcomers one by one with preferential attachment.
        else:
            for idx_newvector in xrange(self.m):

                these_nodes = [
                    n for n in nodes if (
                        n.id != node.id and
                        not n.is_connected(direction="either", whom=node))]

                outdegrees = [
                    len(n.vectors(direction="outgoing")) for n in these_nodes]

                # Select a member using preferential attachment
                ps = [(d / (1.0 * sum(outdegrees))) for d in outdegrees]
                rnd = random.random() * sum(ps)
                cur = 0.0
                for i, p in enumerate(ps):
                    cur += p
                    if rnd < cur:
                        vector_to = these_nodes[i]

                # Create vector from newcomer to selected member and back
                node.connect(direction="both", whom=vector_to)
1018053
def add2node(self, othereplus, node):
        """"""
        node = node.upper()
        self.dt[node.upper()] = self.dt[node.upper()] + \
            othereplus.dt[node.upper()]
405465
def add_node(cls, cluster_id_label, parameters=None):
      
      conn = Qubole.agent(version=Cluster.api_version)
      parameters = {} if not parameters else parameters
      return conn.post(cls.element_path(cluster_id_label) + "/nodes", data={"parameters" : parameters})
1360054
def addinnode(self, otherplus, node, objectname):
        
        # do a test for unique object here
        newelement = otherplus.dt[node.upper()]