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

Method siblings

hiddenlayer/graph.py:237–248  ·  view source on GitHub ↗

Returns all nodes that share the same parent (incoming node) with the given node, including the node itself.

(self, node)

Source from the content-addressed store, hash-verified

235 return incoming
236
237 def siblings(self, node):
238 """Returns all nodes that share the same parent (incoming node) with
239 the given node, including the node itself.
240 """
241 incoming = self.incoming(node)
242 # TODO: Not handling the case of multiple incoming nodes yet
243 if len(incoming) == 1:
244 incoming = incoming[0]
245 siblings = self.outgoing(incoming)
246 return siblings
247 else:
248 return [node]
249
250 def __getitem__(self, key):
251 if isinstance(key, list):

Callers 1

matchMethod · 0.80

Calls 2

incomingMethod · 0.95
outgoingMethod · 0.95

Tested by

no test coverage detected