MCPcopy Index your code
hub / github.com/waleedka/hiddenlayer / search

Method search

hiddenlayer/graph.py:286–294  ·  view source on GitHub ↗

Searches the graph for a sub-graph that matches the given pattern and returns the first match it finds.

(self, pattern)

Source from the content-addressed store, hash-verified

284 self.remove(n)
285
286 def search(self, pattern):
287 """Searches the graph for a sub-graph that matches the given pattern
288 and returns the first match it finds.
289 """
290 for node in self.nodes.values():
291 match, following = pattern.match(self, node)
292 if match:
293 return match, following
294 return [], None
295
296
297 def sequence_id(self, sequence):

Callers 4

test_searchMethod · 0.95
applyMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80

Calls 1

matchMethod · 0.45

Tested by 1

test_searchMethod · 0.76