MCPcopy Create free account
hub / github.com/ActiveState/code / __getSiblings

Method __getSiblings

recipes/Python/577898_23_Tree/recipe-577898.py:270–280  ·  view source on GitHub ↗

Returns node's siblings

(self, node)

Source from the content-addressed store, hash-verified

268 return node.parent.getLink(node.parent.getLinkIdx(node) + 1)
269
270 def __getSiblings(self, node):
271 """ Returns node's siblings """
272 # check whether one of our siblings has two items
273 lS, rS, lCnt, rCnt = None, None, 0, 0
274 if self.__getRightSibling(node) is not None:
275 rS = self.__getRightSibling(node)
276 rCnt = rS.valcnt
277 if self.__getLeftSibling(node) is not None:
278 lS = self.__getLeftSibling(node)
279 lCnt = lS.valcnt
280 return lS, lCnt, rS, rCnt
281
282 def __swapValues(self, node1, a1, node2, a2):
283 """ Swap any two values in nodes """

Callers 1

__fixNodeRemoveMethod · 0.95

Calls 2

__getRightSiblingMethod · 0.95
__getLeftSiblingMethod · 0.95

Tested by

no test coverage detected