Create the new node
182421
function create_node(error, result) {
    if(error) {
      callback(error);
    } else {
      parentNodeData = result;
      Node.create({
        guid: context.guid,
        type: type
      }, function(error, result) {
        if(error) {
          callback(error);
          return;
        }
        node = result;
        node.nlinks += 1;
        context.putObject(node.id, node, update_parent_node_data);
      });
    }
  }
101648
def node(self, content):
        
        ns = content.type.namespace()
        if content.type.form_qualified:
            node = Element(content.tag, ns=ns)
            if ns[0]:
                node.addPrefix(ns[0], ns[1])
        else:
            node = Element(content.tag)
        self.encode(node, content)
        log.debug("created - node:\n%s", node)
        return node
1220716
Node createFor(Node init, Node cond, Node incr, Node body) {
    return IR.forNode(init, cond, incr, body);
  }
126983
def add_nodes(self, nodes):
        '''
        '''
        new_nodes, master_map = self._add_nodes_as_master(nodes)

        for n in new_nodes:
            if n.name not in master_map:
                continue
            master_name = master_map[n.name]
            target = self.get_node(master_name)
            if not target:
                raise NodeNotFound(master_name)
            n.replicate(target.name)
            n.flush_cache()
            target.flush_cache()
302818
function(node) {
			var newNode = node.cloneNode(true);
			if(this.hasAttribute(node, 'id')){
				this.removeAttribute(node, 'id')
			}
			return newNode;
		}
518268
static <E> Node<E> newNode(E item) {
        Node<E> node = new Node<E>();
        U.putObject(node, ITEM, item);
        return node;
    }
913122
function Node (config) {
    RED.nodes.createNode(this, config);
    var node = this;

    // Invoked when the node has received an input as part of a flow.
    this.on('input', function (msg) {
      processOnInput(msg, config, node);
    });
  }
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;		 
    }
1086154
def create_node(doc, node_name, content=nil) #:doc:
      node = Nokogiri::XML::Node.new(node_name, doc)
      node.content = content if content
      node
    end
98614
function createTree(){
    for (var i = 0; i < gRootNodes.length; ++i){
        var node = {
            _id : gRootNodes[i]._id, //todo : id instead of name?
            node : gRootNodes[i],
            parent : "root",
            childNodes : loadChildNodes(gRootNodes[i])
        };
        gTree.childNodes.push(node);
    }
}
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)
109574
def add_node(self, node):
        """"""
        nodes = self.nodes()

        if len(nodes) > 1:
            first_node = min(nodes, key=attrgetter("creation_time"))
            first_node.connect(direction="both", whom=node)
1009335
function(html, current, position) {

      var x, newNode, node, firstChild;

      // create a new node
      newNode = document.createElement('div');
      newNode.innerHTML = html;

      // get new new node
      newNode = newNode.childNodes[0];

      // create new node in mirror
      if (position == 'before') {

        // insert element
        current.parentNode.insertBefore(newNode, current);

      }

      // re-init sortable
      hashedit.setupSortable();

      return newNode;

    }
112997
def insert_node(self, node):
        
        if self._is_node_reserved(node):
            return False

        # Put node in map
        self._node_map[node.get_id()] = node
        return True
1183421
def add_node(self, node):
        """"""
        other_nodes = [n for n in self.nodes() if n.id != node.id]

        for n in other_nodes:
            if isinstance(n, Source):
                node.connect(direction="from", whom=n)
            else:
                node.connect(direction="both", whom=n)
1005170
def add_node(self, payload):
        
        self.nodes.append(Node(len(self.nodes), payload))
        return len(self.nodes) - 1
51576
def new_node(self):
        """"""
        node_id = self.generate_node_id()

        node = {'id': node_id,
                'edges': [],
                'data': {}
        }

        self.nodes[node_id] = node

        self._num_nodes += 1

        return node_id