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)
| 2538 | |
| 2539 | |
| 2540 | def _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 | |
| 2551 | def find_node_ambiguity(G: nx.Graph, label: str) -> list[str]: |