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

Method apply

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

Source from the content-addressed store, hash-verified

175 self.name = re.compile(name) if name else None
176
177 def apply(self, graph):
178 # Copy the graph. Don't change the original.
179 graph = copy.deepcopy(graph)
180
181 for node in graph.nodes.values():
182 if self.op:
183 node.op = self.op.sub(self.to, node.op)
184 # TODO: name is not tested yet
185 if self.name:
186 node.name = self.name.sub(self.to, node.name)
187 return graph
188
189
190# Transforms to simplify graphs by folding layers that tend to be

Callers 1

test_regexMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_regexMethod · 0.76