Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def parse_interactions(lines, comments='#', directed=False, delimiter=None, nodetype=None, timestamptype=None,
keys=None):
if not directed:
G = DynGraph()
else:
G = DynDiGraph()
for line in lines:
p = line.find(comments)
if p >= 0:
line = line[:p]
if not len(line):
continue
s = line.strip().split(delimiter)
if len(s) != 4:
continue
else:
def parse_snapshots(lines, comments='#', directed=False, delimiter=None, nodetype=None, timestamptype=None, keys=None):
if not directed:
G = DynGraph()
else:
G = DynDiGraph()
for line in lines:
p = line.find(comments)
if p >= 0:
line = line[:p]
if not len(line):
continue
# split line, should have 2 or more
s = line.strip().split(delimiter)
if len(s) < 3:
continue
if len(s) == 3:
u = s.pop(0)
v = s.pop(0)
def parse_snapshots(lines, comments='#', directed=False, delimiter=None, nodetype=None, timestamptype=None, keys=None):
if not directed:
G = DynGraph()
else:
G = DynDiGraph()
for line in lines:
p = line.find(comments)
if p >= 0:
line = line[:p]
if not len(line):
continue
# split line, should have 2 or more
s = line.strip().split(delimiter)
if len(s) < 3:
continue
if len(s) == 3:
u = s.pop(0)
v = s.pop(0)
t = s.pop(0)
e = None
def parse_interactions(lines, comments='#', directed=False, delimiter=None, nodetype=None, timestamptype=None,
keys=None):
if not directed:
G = DynGraph()
else:
G = DynDiGraph()
for line in lines:
p = line.find(comments)
if p >= 0:
line = line[:p]
if not len(line):
continue
s = line.strip().split(delimiter)
if len(s) != 4:
continue
else:
u = s.pop(0)
v = s.pop(0)
def read_ids(path, delimiter=None, timestamptype=None):
f = open(path)
ids = {}
for line in f:
s = line.rstrip().split(delimiter)
ids[timestamptype(s[-1])] = None
if len(line) == 4:
if s[-2] not in ['+', '-']:
ids[timestamptype(s[-2])] = None
f.flush()
f.close()
ids = compact_timeslot(ids.keys())
return ids
@not_implemented()
def add_edges_from(self, ebunch, attr_dict=None, **attr):
pass
@not_implemented()
def remove_edge(self, u, v):
pass
@not_implemented()
def get_edge_attributes(G, name):
pass
@not_implemented()
def add_edges_from(self, ebunch, attr_dict=None, **attr):
pass
@not_implemented()
def remove_edges_from(self, ebunch):
pass