visit a Expr node by returning a fresh instance of it
432817
def visit_expr(self, node, parent):
        """"""
        newnode = nodes.Expr(node.lineno, node.col_offset, parent)
        newnode.postinit(self.visit(node.value, newnode))
        return newnode
1032284
def visit_comprehension(self, node, parent):
        """"""
        newnode = nodes.Comprehension(parent)
        newnode.postinit(
            self.visit(node.target, newnode),
            self.visit(node.iter, newnode),
            [self.visit(child, newnode) for child in node.ifs],
            getattr(node, "is_async", None),
        )
        return newnode
532181
def visit_If(self, node):
        """"""
        # do not optimize ifs that have a block inside so that it doesn't
        # break super().
        if node.find(nodes.Block) is not None:
            return self.generic_visit(node)
        try:
            val = self.visit(node.test).as_const()
        except nodes.Impossible:
            return self.generic_visit(node)
        if val:
            body = node.body
        else:
            body = node.else_
        result = []
        for node in body:
            result.extend(self.visit_list(node))
        return result
1181970
def _expr2bddnode(expr):
    """"""
    if expr.is_zero():
        return BDDNODEZERO
    elif expr.is_one():
        return BDDNODEONE
    else:
        top = expr.top

        # Register this variable
        _ = bddvar(top.names, top.indices)

        root = top.uniqid
        lo = _expr2bddnode(expr.restrict({top: 0}))
        hi = _expr2bddnode(expr.restrict({top: 1}))
        return _bddnode(root, lo, hi)
1369039
def to_nnf(self):
        """"""
        node = self.node.to_nnf()
        if node is self.node:
            return self
        else:
            return _expr(node)
1098931
def visit_generatorexp(self, node):
        """"""
        return "(%s %s)" % (
            node.elt.accept(self),
            " ".join(n.accept(self) for n in node.generators),
        )
144433
def visit_tuple(self, node, parent):
        """"""
        context = self._get_context(node)
        newnode = nodes.Tuple(
            ctx=context, lineno=node.lineno, col_offset=node.col_offset, parent=parent
        )
        newnode.postinit([self.visit(child, newnode) for child in node.elts])
        return newnode
417995
def visit_Program(self, node):
        """"""
        for child in node.children:
            if not isinstance(child, FunctionDeclaration):
                self.visit(child)
540702
def p_expr_new(p):
    ''
    p[0] = ast.New(p[2], p[3], lineno=p.lineno(1))
684360
def visit_repr(self, node, parent):
        """"""
        newnode = nodes.Repr(node.lineno, node.col_offset, parent)
        newnode.postinit(self.visit(node.value, newnode))
        return newnode
1203977
def visit_generatorexp(self, node, parent):
        """"""
        newnode = nodes.GeneratorExp(node.lineno, node.col_offset, parent)
        newnode.postinit(
            self.visit(node.elt, newnode),
            [self.visit(child, newnode) for child in node.generators],
        )
        return newnode
426682
def generic_visit(self, node):
        
        if (isinstance(node, ast.stmt) and
                not isinstance(node, ast.FunctionDef)):

            new_node = self.wrap_with_try(node)

            # handling try except statement
            if isinstance(node, self.ast_try_except):
                self.try_except_handler(node)
                return new_node

            # Run recursively on all sub nodes
            super(ErrorsCatchTransformer, self).generic_visit(node)

            return new_node

        # Run recursively on all sub nodes
        return super(ErrorsCatchTransformer, self).generic_visit(node)
1198005
def from_expr(cls, expr):
        """"""
        return cls(expr.args, expr.kwargs, cls=expr.__class__)
707803
def expressionToAST(ex):
    
    return ASTNode(ex.astType, ex.astKind, ex.value,
                   [expressionToAST(c) for c in ex.children])
85812
def func(self, node):
        ''
        _, params, _, _, _, expr = node
        params = map(self.eval, params)
        def func(*args):
            env = dict(self.env.items() + zip(params, args))
            return Mini(env).eval(expr)
        return func
257781
def visit_IfExp(self, node: ast.IfExp) -> Any:
        """"""
        test = self.visit(node=node.test)

        if test:
            result = self.visit(node=node.body)
        else:
            result = self.visit(node=node.orelse)

        self.recomputed_values[node] = result
        return result
816103
private Object eval(ExpressionContext expr) {
    Object res = expr;
    while(res instanceof ExpressionContext)
      res = ((ExpressionContext)res).accept(visitor);
    if(res instanceof LValue)
      res = ((LValue) res).get(expr);
    return res;
  }