MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _find_node

Function _find_node

graphify/serve.py:2540–2548  ·  view source on GitHub ↗

Return node IDs whose label or ID matches the search term (diacritic-insensitive). Results are ordered by precedence: exact source-file path match first, then exact (label/ID) match, then prefix match, then substring match. Node-ID exact matches are grouped with label exact matches.

(G: nx.Graph, label: str)

Source from the content-addressed store, hash-verified

2538
2539
2540def _find_node(G: nx.Graph, label: str) -> list[str]:
2541 """Return node IDs whose label or ID matches the search term (diacritic-insensitive).
2542
2543 Results are ordered by precedence: exact source-file path match first, then
2544 exact (label/ID) match, then prefix match, then substring match. Node-ID exact
2545 matches are grouped with label exact matches.
2546 """
2547 source_exact, exact, prefix, substring = _find_node_tiers(G, label)
2548 return source_exact + exact + prefix + substring
2549
2550
2551def find_node_ambiguity(G: nx.Graph, label: str) -> list[str]:

Calls 1

_find_node_tiersFunction · 0.85