visit an Arguments node by returning a fresh instance of it
544901
def visit_arguments(self, node, parent):
        """"""
        vararg, kwarg = node.vararg, node.kwarg
        if PY34:
            newnode = nodes.Arguments(
                vararg.arg if vararg else None, kwarg.arg if kwarg else None, parent
            )
        else:
            newnode = nodes.Arguments(vararg, kwarg, parent)
        args = [self.visit(child, newnode) for child in node.args]
        defaults = [self.visit(child, newnode) for child in node.defaults]
        varargannotation = None
        kwargannotation = None
        # change added in 82732 (7c5c678e4164), vararg and kwarg
        # are instances of `_ast.arg`, not strings
        if vararg:
            if PY34:
                if node.vararg.annotation:
                    varargannotation = self.visit(node.vararg.annotation, newnode)
                vararg = vararg.arg
        if kwarg:
            if PY34:
                if node.kwarg.annotation:
                    kwargannotation = self.visit(node.kwarg.annotation, newnode)
                kwarg = kwarg.arg
        if PY3:
            kwonlyargs = [self.visit(child, newnode) for child in node.kwonlyargs]
            kw_defaults = [
                self.visit(child, newnode) if child else None
                for child in node.kw_defaults
            ]
            annotations = [
                self.visit(arg.annotation, newnode) if arg.annotation else None
                for arg in node.args
            ]
            kwonlyargs_annotations = [
                self.visit(arg.annotation, newnode) if arg.annotation else None
                for arg in node.kwonlyargs
            ]
        else:
            kwonlyargs = []
            kw_defaults = []
            annotations = []
            kwonlyargs_annotations = []

        newnode.postinit(
            args=args,
            defaults=defaults,
            kwonlyargs=kwonlyargs,
            kw_defaults=kw_defaults,
            annotations=annotations,
            kwonlyargs_annotations=kwonlyargs_annotations,
            varargannotation=varargannotation,
            kwargannotation=kwargannotation,
        )
        # save argument names in locals:
        if vararg:
            newnode.parent.set_local(vararg, newnode)
        if kwarg:
            newnode.parent.set_local(kwarg, newnode)
        return newnode
777435
def _visit_or_none(node, attr, visitor, parent, visit="visit", **kws):
    
    value = getattr(node, attr, None)
    if value:
        return getattr(visitor, visit)(value, parent, **kws)

    return None
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)
541880
def process_EnvArgumentNode(node)
      if node.single_quoted?
        debug_visit(node, 'single quoted argument, performing no expansion')
        node.lvalue
      else
        debug_visit(node, 'not singled quoted argument, performing variable expansion')
        variable_expand(node.lvalue)
      end
    end
123619
def visit_dict(self, node, parent):
        """"""
        newnode = nodes.Dict(node.lineno, node.col_offset, parent)
        items = list(self._visit_dict_items(node, parent, newnode))
        newnode.postinit(items)
        return newnode
263528
def _visit_for(self, cls, node, parent):
        """"""
        newnode = cls(node.lineno, node.col_offset, parent)
        type_annotation = self.check_type_comment(node)
        newnode.postinit(
            target=self.visit(node.target, newnode),
            iter=self.visit(node.iter, newnode),
            body=[self.visit(child, newnode) for child in node.body],
            orelse=[self.visit(child, newnode) for child in node.orelse],
            type_annotation=type_annotation,
        )
        return newnode
623042
def visit_assert(self, node, parent):
        """"""
        newnode = nodes.Assert(node.lineno, node.col_offset, parent)
        if node.msg:
            msg = self.visit(node.msg, newnode)
        else:
            msg = None
        newnode.postinit(self.visit(node.test, newnode), msg)
        return newnode
1100095
def visit_call(self, node):
        """"""
        expr_str = self._precedence_parens(node, node.func)
        args = [arg.accept(self) for arg in node.args]
        if node.keywords:
            keywords = [kwarg.accept(self) for kwarg in node.keywords]
        else:
            keywords = []

        args.extend(keywords)
        return "%s(%s)" % (expr_str, ", ".join(args))
257496
function appendMeArgs (e, args /* null/undefined, string, node, or array-like of nodes incl.
			live NodeList */, attrsP) {
  if (args == null) ;
  else if (typeof args == 'string')
    e.appendChild(e.ownerDocument.createTextNode(args));
  else if (args.nodeType) e.appendChild(args);
  else {
    if (args.constructor != Array) args = F.slice(args);	// for live NodeList
    F.iter(function (x) {
      e.appendChild(x);
    }, args);
  }
  return M.setAttrs(e, attrsP);
}
410273
def node_query(self, node):
        

        if isinstance(node, ast.Call):
            assert node.args
            arg = node.args[0]
            if not isinstance(arg, ast.Str):
                return
        else:
            raise TypeError(type(node))

        return arg.s
1313424
def check_arguments(self):
        """"""
        for name, default in self.argdict.items():
            if name not in self.names and default is NODEFAULT:
                raise NameError('Missing argparse specification for %r' % name)
277611
def create_node(t, ref = None, debug = False):
    """"""
    if t.ttype == "operand":
        if t.tsubtype in ["range", "named_range", "pointer"] :
            # print 'Creating Node', t.tvalue, t.tsubtype
            return RangeNode(t, ref, debug = debug)
        else:
            return OperandNode(t)
    elif t.ttype == "function":
        return FunctionNode(t, ref, debug = debug)
    elif t.ttype.startswith("operator"):
        return OperatorNode(t, ref, debug = debug)
    else:
        return ASTNode(t, debug = debug)
740474
def p_arg1(p):
    
    # a hack to support "clear global"
    p[0] = node.string(value=str(p[1]), lineno=p.lineno(1), lexpos=p.lexpos(1))
1213859
def visit_tryexcept(self, node, parent):
        """"""
        newnode = nodes.TryExcept(node.lineno, node.col_offset, parent)
        newnode.postinit(
            [self.visit(child, newnode) for child in node.body],
            [self.visit(child, newnode) for child in node.handlers],
            [self.visit(child, newnode) for child in node.orelse],
        )
        return newnode
772004
def visit_extslice(self, node, parent):
        """"""
        newnode = nodes.ExtSlice(parent=parent)
        newnode.postinit([self.visit(dim, newnode) for dim in node.dims])
        return newnode
1277885
def call_method(self, name, args=None, kwargs=None, dyn_args=None,
                    dyn_kwargs=None, lineno=None):
        
        if args is None:
            args = []
        if kwargs is None:
            kwargs = []
        return nodes.Call(self.attr(name, lineno=lineno), args, kwargs,
                          dyn_args, dyn_kwargs, lineno=lineno)
491493
def visit_Call(self, nodeCall):
        
        super(PatternFinder, self).generic_visit(nodeCall)
        # Capture assignment like 'f = getattr(...)'.
        if hasattr(nodeCall.func, "func"):
            # In this case, the statement should be
            # 'f = getattr(...)()'.
            nodeCall = nodeCall.func
        # Make sure the function's name is 'getattr'.
        if not hasattr(nodeCall.func, "id"):
            return
        if nodeCall.func.id != "getattr":
            return

        # Capture 'f = getattr(foo, "bar_%s" % baz )' or
        # 'f = getattr(foo, "bar_" + baz )'.
        nodeArgument = nodeCall.args[1]
        if not isinstance(nodeArgument, ast.BinOp):
            return
        operation = nodeArgument.op
        if type(operation) not in [ast.Mod, ast.Add]:
            return
        nodePattern = nodeArgument.left
        if not isinstance(nodePattern, ast.Str):
            return
        pattern = nodePattern.s
        if not ((type(operation) == ast.Add and pattern.endswith("_")) or
                (pattern.count("%s") == 1 and pattern.endswith("_%s"))):
            return
        pattern = pattern.replace("%s", "")
        if pattern[:1].isalpha() and not pattern[:1].islower():
            self.patternsClass.add(pattern)
        else:
            self.patternsFunc.add(pattern)