Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _check_dataset_size(self, elist, nlist):
edge_count = len(elist.index)
node_count = len(nlist.index)
graph_size = edge_count + node_count
if edge_count > 8e6:
util.error('Maximum number of edges (8M) exceeded: %d.' % edge_count)
if node_count > 8e6:
util.error('Maximum number of nodes (8M) exceeded: %d.' % node_count)
if graph_size > 1e6:
util.warn('Large graph: |nodes| + |edges| = %d. Layout/rendering might be slow.' % graph_size)
def bind(df, pbname, attrib, default=None):
bound = getattr(self, attrib)
if bound:
if bound in df.columns.tolist():
df[pbname] = df[bound]
else:
util.warn('Attribute "%s" bound to %s does not exist.' % (bound, attrib))
elif default:
df[pbname] = df[default]