adds a vertex to the graph and returns it
772734
def createVertex(self, collectionName, docAttributes, waitForSync = False) :
        """"""
        url = "%s/vertex/%s" % (self.URL, collectionName)

        store = DOC.DocumentStore(self.database[collectionName], validators=self.database[collectionName]._fields, initDct=docAttributes)
        # self.database[collectionName].validateDct(docAttributes)
        store.validate()

        r = self.connection.session.post(url, data = json.dumps(docAttributes, default=str), params = {'waitForSync' : waitForSync})

        data = r.json()
        if r.status_code == 201 or r.status_code == 202 :
            return self.database[collectionName][data["vertex"]["_key"]]

        raise CreationError("Unable to create vertice, %s" % data["errorMessage"], data)
794051
function(evt, x, y) {

        if (!this.can('vertexAdd')) return;

        // Store the index at which the new vertex has just been placed.
        // We'll be update the very same vertex position in `pointermove()`.
        var vertexIdx = this.addVertex({ x: x, y: y }, { ui: true });
        this.eventData(evt, {
            action: 'vertex-move',
            vertexIdx: vertexIdx
        });
    }
1327051
def add_vertex(self, x, y, z):
        
        self.vert_data.write(
            struct.pack('<f', x) +
            struct.pack('<f', y) +
            struct.pack('<f', z)
        )

        # retain min/max values
        self.vert_min = _list3_min(self.vert_min, (x, y, z))
        self.vert_max = _list3_max(self.vert_max, (x, y, z))
1346375
def Sum(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().SumVertex, label, cast_to_double_vertex(input_vertex))
92772
private Vertex interpolate(Vertex start, Vertex end, double t)
	{
		double x = interpolate(start.getX(), end.getX(), t);
		double y = interpolate(start.getY(), end.getY(), t);
		double z = interpolate(start.getZ(), end.getZ(), t);

		return new Vertex(x, y, z);
	}
1100357
def new_graph(self, graph, typ):
        """"""
        graph = self.pack(graph)
        return self.sql('new_graph', graph, typ)
1070656
def addNodeToGraph(nodeName, graphFileHandle, label, width=0.3, height=0.3, shape="circle", colour="black", fontsize=14):
    
    graphFileHandle.write("node[width=%s,height=%s,shape=%s,colour=%s,fontsize=%s];\n" % (width, height, shape, colour, fontsize))
    graphFileHandle.write("%s [label=\"%s\"];\n" % (nodeName, label))
348443
public void addVertex(V vertex) {
        if (containsVertex(vertex)) {
            return;
        }

        neighbors.put(vertex, new ArrayList<V>());
    }
1218676
def add_vertex(self, x, y, z, name):
        
        self.vertices[name] = Vertex(x, y, z, name)
        return self.vertices[name]
1039874
def connect_from(self, vertex, weight=1):
        
        for edge in self.edges_in:
            if vertex == edge.vertex_out:
                return edge
        return Edge(vertex, self, weight)
610258
def addEdgeToGraph(parentNodeName, childNodeName, graphFileHandle, colour="black", length="10", weight="1", dir="none", label="", style=""):
    
    graphFileHandle.write('edge[color=%s,len=%s,weight=%s,dir=%s,label="%s",style=%s];\n' % (colour, length, weight, dir, label, style))
    graphFileHandle.write("%s -- %s;\n" % (parentNodeName, childNodeName))
173118
def get_vertex(self, key):
    
    if key in self.vertex_map:
      return self.vertex_map[key]
    vertex = self.new_vertex()
    self.vertex_map[key] = vertex
    return vertex
1103241
def remove_vertex(self, vertex):
        
        try:
            self.vertices.pop(vertex)
            self.succ.pop(vertex)
        except KeyError:
            raise GraphInsertError("Vertex %s doesn't exist." % (vertex,))
        if vertex in self.nodes:
            self.nodes.pop(vertex)
        for element in self.vertices:
            if vertex in self.vertices[element]:
                self.vertices[element].remove(vertex)
        edges = []  # List for edges that include vertex
        for element in self.edges:
            if vertex in element:
                edges.append(element)
        for element in edges:
            del self.edges[element]
        for element in self.pred:
            if vertex in self.pred[element]:
                self.pred[element].remove(vertex)
        for element in self.succ:
            if vertex in self.succ[element]:
                self.succ[element].remove(vertex)
258689
private void insert(Geometry geom, GeometryIndex index, Coordinate coordinate)
			throws GeometryIndexNotFoundException {
		if (index.hasChild() && geom.getGeometries() != null && geom.getGeometries().length > index.getValue()) {
			insert(geom.getGeometries()[index.getValue()], index.getChild(), coordinate);
		} else if (index.getType() == GeometryIndexType.TYPE_EDGE) {
			insertAfterEdge(geom, index, coordinate);
		} else if (index.getType() == GeometryIndexType.TYPE_VERTEX) {
			insertAfterVertex(geom, index, coordinate);
		} else {
			throw new GeometryIndexNotFoundException("Could not match index with given geometry.");
		}
	}
417289
def add_edge(self, u, v, **attr):
        
        if u not in self.vertices:
            self.vertices[u] = []
            self.pred[u] = []
            self.succ[u] = []
        if v not in self.vertices:
            self.vertices[v] = []
            self.pred[v] = []
            self.succ[v] = []
        vertex = (u, v)
        self.edges[vertex] = {}
        self.edges[vertex].update(attr)
        self.vertices[u].append(v)
        self.pred[v].append(u)
        self.succ[u].append(v)
528179
def go_from(self, vertex):
        
        if self.vertex_out:
            self.vertex_out.edges_out.remove(self)
        self.vertex_out = vertex
        vertex.edges_out.add(self)
218767
function it_leavesNewVertexWithNewValue() {
			it("leaves a new vertex in the graph with a new value", function () {
				callItWith('newKey', 'newValue');
				expect(graph.hasVertex('newKey')).toBeTruthy();
				expect(graph.vertexValue('newKey')).toBe('newValue');
				expect(graph.vertexCount()).toBe(originalVertexCount + 1);
			});
		}