(node)
return (isinstance(node, Node)
            and len(node.children) == 3
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[1], Node)
            and isinstance(node.children[2], Leaf)
            and node.children[0].value == "("
            and node.children[2].value == ")")
Does the node represent a tuple literal?
Does the node represent a tuple literal?
Does the node represent a tuple literal?
def is_tuple(node):
    """Does the node represent a tuple literal?"""
    if isinstance(node, Node) and node.children == [LParen(), RParen()]:
        return True
    return (isinstance(node, Node)
            and len(node.children) == 3
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[1], Node)
            and isinstance(node.children[2], Leaf)
            and node.children[0].value == "("
            and node.children[2].value == ")")
def is_tuple ( node ) : if isinstance ( node , Node ) and node . children == [ LParen ( ) , RParen ( ) ] : return True return ( isinstance ( node , Node ) and len ( node . children ) == 3 and isinstance ( node . children [ 0 ] , Leaf ) and isinstance ( node . children [ 1 ] , Node ) and isinstance ( node . children [ 2 ] , Leaf ) and node . children [ 0 ] . value == "(" and node . children [ 2 ] . value == ")" )