MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / _has_self_loop

Method _has_self_loop

workflow/cycle_manager.py:90–95  ·  view source on GitHub ↗

Check if a node has a self-loop.

(self, node_id: str, nodes: Dict[str, Node])

Source from the content-addressed store, hash-verified

88 return self.cycles
89
90 def _has_self_loop(self, node_id: str, nodes: Dict[str, Node]) -> bool:
91 """Check if a node has a self-loop."""
92 node = nodes.get(node_id)
93 if not node:
94 return False
95 return any(edge_link.target.id == node_id for edge_link in node.iter_outgoing_edges())
96
97 def _strong_connect(self, node_id: str, nodes: Dict[str, Node]) -> None:
98 """Recursive part of Tarjan's algorithm."""

Callers 1

_strong_connectMethod · 0.95

Calls 2

iter_outgoing_edgesMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected