This commit is contained in:
Родитель
ac1a9469ef
Коммит
6b8d5cb72c
|
@ -37,13 +37,15 @@ def dfs_walk(node, visitor):
|
|||
except AttributeError:
|
||||
pass
|
||||
|
||||
if visitor(node):
|
||||
accum.append(node)
|
||||
|
||||
visited.add(node)
|
||||
if visitor(node):
|
||||
accum.append(node)
|
||||
|
||||
visited.add(node)
|
||||
|
||||
return accum
|
||||
|
||||
|
||||
|
||||
def find_nodes_by_name(node, node_name):
|
||||
'''
|
||||
Finds nodes in the graph starting from `node` and doing a depth-first
|
||||
|
|
Загрузка…
Ссылка в новой задаче