def getBranchNode(self, node, bva): ''' If a node exists already for the specified branch, return it. Otherwise, create a new one and return that... ''' for knode in vg_path.getNodeKids(node): if vg_path.getNodeProp(knode, 'bva') == bva: return knode return self.newCodePathNode(node, bva)