'Get the range of indices where there are subnodes of the given node.
See Also
Orange.widgets.model.owclassificationtreegraph.OWTreeGraph'

def _subnode_range(self, node):

    def find_largest_idx(n):
        'It    is    necessary    to    locate    the    node    with    the    largest    index    in    the\n                                                children    in    order    to    get    a    good    range.    This    is    necessary    with    trees\n                                                that    are    not    right    aligned,    which    can    happen    when    visualising\n                                                random    forest    trees.'
        if (self._tree.children_left[n] == self.NO_CHILD):
            return n
        l_node = find_largest_idx(self._tree.children_left[n])
        r_node = find_largest_idx(self._tree.children_right[n])
        return max(l_node, r_node)
    right = left = node
    if (self._tree.children_left[left] == self.NO_CHILD):
        assert (self._tree.children_right[node] == self.NO_CHILD)
        return (node, node)
    else:
        left = self._tree.children_left[left]
        right = find_largest_idx(right)
        return (left, (right + 1))
