Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def create(edge_df, node_df, sources, dests, nodeid, node_map, name):
vg = graph_vector_pb2.VectorGraph()
vg.version = 1
vg.type = VectorGraph.DIRECTED
vg.vertexCount = len(node_map)
vg.edgeCount = len(edge_df)
if name is not None:
vg.name = name
addEdges(vg, sources, dests, node_map)
edge_types = storeEdgeAttributes(vg, edge_df)
node_types = storeNodeAttributes(vg, node_df, nodeid, node_map)
return {
'name': name,
'vgraph': vg,
'attributes': {
'nodes': node_types,
def create(edge_df, node_df, sources, dests, nodeid, node_map, name):
vg = graph_vector_pb2.VectorGraph()
vg.version = 1
vg.type = VectorGraph.DIRECTED
vg.vertexCount = len(node_map)
vg.edgeCount = len(edge_df)
if name is not None:
vg.name = name
addEdges(vg, sources, dests, node_map)
edge_types = storeEdgeAttributes(vg, edge_df)
node_types = storeNodeAttributes(vg, node_df, nodeid, node_map)
return {
'name': name,
'vgraph': vg,
'attributes': {
'nodes': node_types,
'edges': edge_types
},
from builtins import next
from builtins import str
import warnings
import random
import numpy
import pandas
from . import pygraphistry
from . import util
from . import graph_vector_pb2
from .graph_vector_pb2 import VectorGraph
EDGE = graph_vector_pb2.VectorGraph.EDGE
VERTEX = graph_vector_pb2.VectorGraph.VERTEX
# Creates the ETL2 protobuf vgraph from
# - edge_df: the edge dataframe
# - node_df: the node dataframe
# - sources: a series of edge sources
# - dests: a series of edge destinations
# - nodeid: The name of the nodeId column in node_df
# - node_map: A map from nodeId to a dense integer range [0, #nodes -1]
# - name: The name of the dataset.
def create(edge_df, node_df, sources, dests, nodeid, node_map, name):
vg = graph_vector_pb2.VectorGraph()
vg.version = 1
vg.type = VectorGraph.DIRECTED
vg.vertexCount = len(node_map)