<qiyuangong>156_Binary_Tree_Upside_Down_1.py
def upsideDownBinaryTree( root):
    node, parent, parentRight = root, None, None
    while node is not None:
        left = node.left
        node.left = parentRight
        parentRight = node.right
        node.right = parent
        parent = node
        node = left
    return parent
def sample_funcname ( var_0 ) :
    var_1 , var_3 , var_4 = var_0 , None , None
    while var_1 is not None :
        left = var_1.left
        var_1.left = var_4
        var_4 = var_1.right
        var_1.right = var_3
        var_3 = var_1
        var_1 = left
    return var_3
