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

Method apply

hiddenlayer/transforms.py:91–101  ·  view source on GitHub ↗
(self, graph)

Source from the content-addressed store, hash-verified

89 self.pattern = ge.GEParser(pattern).parse()
90
91 def apply(self, graph):
92 # Copy the graph. Don't change the original.
93 graph = copy.deepcopy(graph)
94
95 while True:
96 matches, _ = graph.search(self.pattern)
97 if not matches:
98 break
99 # Remove found nodes
100 graph.remove(matches)
101 return graph
102
103
104class PruneBranch():

Callers 1

test_pruneMethod · 0.95

Calls 2

searchMethod · 0.80
removeMethod · 0.80

Tested by 1

test_pruneMethod · 0.76