<qiyuangong>107_Binary_Tree_Level_Order_Traversal_II_1.py
def levelOrderBottom( root):
    if root is None:
        return []
    stack = [[root]]
    res = []
    while len(stack) > 0:
        top = stack.pop()
        res.insert(0, [t.val for t in top])
        temp = []
        for node in top:
            if node.left is not None:
                temp.append(node.left)
            if node.right is not None:
                temp.append(node.right)
        if len(temp) > 0:
            stack.append(temp)
    return res
def sample_funcname ( var_0 ) :
    if var_0 is None :
        return [ ]
    var_2 = [ [ var_0 ] ]
    var_3 = [ ]
    while len ( var_2 ) > 0 :
        var_7 = var_2.pop ( )
        var_3.insert ( 0 , [ var_9.val for var_9 in var_7 ] )
        var_11 = [ ]
        for var_12 in var_7 :
            if var_12.left is not None :
                var_11.append ( var_12.left )
            if var_12.right is not None :
                var_11.append ( var_12.right )
        if len ( var_11 ) > 0 :
            var_2.append ( var_11 )
    return var_3
