def case_2(node, op_nodes):
    """ Case when node have only operator's like children.
    In that case choice operator with one node as top node.
    
    Example:
    E->[*->[a,a], +->[a]] to [+->[*->[a,a],a]]"""
    parent = node.parent
    if len(op_nodes[0].children) in (0, 1):
        top_op_node = op_nodes[0]
        buttom_op_node = op_nodes[1]
    elif len(op_nodes[1].children) in (0, 1):
        top_op_node = op_nodes[1]
        buttom_op_node = op_nodes[0]
    else:
        import pdb
        pdb.set_trace()
        raise BaseException('case_2 no top node error')
    top_op_node.add_child(buttom_op_node)
    if parent is not None:
        parent.replace_child(node, top_op_node)
        return parent
    else:
        top_op_node.parent = parent
        return top_op_node
