def next_inorder(self):
        # first check if there's a child widget
        firstchild = self.first_child()
        if firstchild is not None:
            return firstchild

        # now we need to hunt for the next sibling
        thisnode = self.get_node()
        nextnode = thisnode.next_sibling()
        depth = thisnode.get_depth()
        while nextnode is None and depth > 0:
            # keep going up the tree until we find an ancestor next sibling
            thisnode = thisnode.get_parent()
            nextnode = thisnode.next_sibling()
            depth -= 1
            assert depth == thisnode.get_depth()
        if nextnode is None:
            # we're at the end of the tree
            return None
        else:
            return nextnode.get_widget()
Perform Role Based Access Downgrade
dataset/ETHPy150Open AnyMesh/anyMesh-Python/example/urwid/treetools.py/TreeWidget.next_inorder--crossover with--dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/accounting/subscription_changes.py/DomainDowngradeActionHandler.response_role_based_access