MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / dfs

Function dfs

tools/find_import_cycles.py:77–91  ·  view source on GitHub ↗
(node: str)

Source from the content-addressed store, hash-verified

75 cycles = []
76
77 def dfs(node: str):
78 visited.add(node)
79 stack.append(node)
80 on_stack.add(node)
81
82 for neighbor in edges.get(node, ()):
83 if neighbor not in visited:
84 dfs(neighbor)
85 elif neighbor in on_stack:
86 idx = stack.index(neighbor)
87 cycle = stack[idx:] + [neighbor]
88 cycles.append(cycle)
89
90 stack.pop()
91 on_stack.remove(node)
92
93 for node in edges:
94 if node not in visited:

Callers 1

find_cyclesFunction · 0.85

Calls 3

removeMethod · 0.80
addMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected