Return a list with names of decorators attached to this node.

    @param node: current node of pylint
161820
def _getDecoratorsName(node):
    
    # For setter properties pylint fails so we use a custom code.
    decorators = []
    if not node.decorators:
        return decorators

    for decorator in node.decorators.nodes:
        decorators.append(decorator.as_string())
    return decorators
473722
def get_used_in_func(node):
    '''
    '''
    if isinstance(node, ast.FunctionDef):
        return {node.name: get_accessed(node.body)}
    names = {}
    for node in ast.iter_child_nodes(node):
        names.update(get_used_in_func(node))
    return names
850225
def get_class_methods(cls):
    
    return [
        node
        for node in cls.body
        if isinstance(node, ast.FunctionDef)
    ]
307118
function getChildNames(node) {
  if (!node) {
    return [];
  }

  const childNames = [];

  for (const key of Object.keys(node)) {
    if (key[0] !== '$') {
      childNames.push(key);
    }
  }

  return childNames;
}
58508
function getCallbackInfo(node) {
    const retv = { isCallback: false, isLexicalThis: false };
    let currentNode = node;
    let parent = node.parent;

    while (currentNode) {
        switch (parent.type) {

            // Checks parents recursively.

            case "LogicalExpression":
            case "ConditionalExpression":
                break;

            // Checks whether the parent node is `.bind(this)` call.
            case "MemberExpression":
                if (parent.object === currentNode &&
                    !parent.property.computed &&
                    parent.property.type === "Identifier" &&
                    parent.property.name === "bind" &&
                    parent.parent.type === "CallExpression" &&
                    parent.parent.callee === parent
                ) {
                    retv.isLexicalThis = (
                        parent.parent.arguments.length === 1 &&
                        parent.parent.arguments[0].type === "ThisExpression"
                    );
                    parent = parent.parent;
                } else {
                    return retv;
                }
                break;

            // Checks whether the node is a callback.
            case "CallExpression":
            case "NewExpression":
                if (parent.callee !== currentNode) {
                    retv.isCallback = true;
                }
                return retv;

            default:
                return retv;
        }

        currentNode = parent;
        parent = parent.parent;
    }

    /* istanbul ignore next */
    throw new Error("unreachable");
}
423103
@NotNull
    public final List<Function<Service<HttpRequest, HttpResponse>,
            ? extends Service<HttpRequest, HttpResponse>>> getDecorators() {
        return decorators;
    }
934155
def is_decorated_with_property(node):
    
    if not node.decorators:
        return False

    for decorator in node.decorators.nodes:
        if not isinstance(decorator, astroid.Name):
            continue

        try:
            if _is_property_decorator(decorator):
                return True
        except astroid.InferenceError:
            pass

    return False
671353
def CLASSDEF(self, node):
        
        for deco in node.decorator_list:
            self.handleNode(deco, node)
        for baseNode in node.bases:
            self.handleNode(baseNode, node)
        if not PY2:
            for keywordNode in node.keywords:
                self.handleNode(keywordNode, node)
        self.push_scope(ClassScope)
        if self.settings.get('run_doctests', False):
            self.defer_function(lambda: self.handle_doctests(node))
        for stmt in node.body:
            self.handleNode(stmt, node)
        self.pop_scope()
        self.add_binding(node, ClassDefinition(node.name, node))
948944
def get_call_name(self, node):
        
        if isinstance(node.func, ast.Attribute):
            return node.func.attr
        elif isinstance(node.func, ast.Name):
            return node.func.id
1219880
def decorators(self):
        
        res = collections.defaultdict(list)
        mmap = {}

        def get_val(na, default=None):
            ret = None
            if isinstance(na, ast.Num):
                repr_n = repr(na.n)
                val = na.n
                vtype = float if '.' in repr_n else int
                ret = vtype(val)

            elif isinstance(na, ast.Str):
                ret = str(na.s)

            elif isinstance(na, ast.Name):
                # http://stackoverflow.com/questions/12700893/
                ret = getattr(builtins, na.id, None)
                if not ret:
                    ret = na.id
                    if ret == 'True':
                        ret = True
                    elif ret == 'False':
                        ret = False

            elif isinstance(na, ast.Dict):
                if na.keys:
                    ret = {get_val(na_[0]): get_val(na_[1]) for na_ in zip(na.keys, na.values)}
                else:
                    ret = {}

            elif isinstance(na, (ast.List, ast.Tuple)):
                if na.elts:
                    ret = [get_val(na_) for na_ in na.elts]
                else:
                    ret = []

                if isinstance(na, ast.Tuple):
                    ret = tuple(ret)

            else:
                ret = default

            return ret

        def is_super(childnode, parentnode):
            """returns true if child node has a super() call to parent node"""
            ret = False
            for n in childnode.body:
                if not isinstance(n, ast.Expr): continue

                try:
                    func = n.value.func
                    func_name = func.attr
                    if func_name == parentnode.name:
                        ret = isinstance(func.value, ast.Call)
                        break

                except AttributeError as e:
                    ret = False

            return ret

        def visit_FunctionDef(node):
            """ https://docs.python.org/2/library/ast.html#ast.NodeVisitor.visit """

            add_decs = True
            if node.name in res:
                add_decs = is_super(mmap[node.name], node)

            mmap[node.name] = node

            if add_decs:
                for n in node.decorator_list:
                    d = {}
                    name = ''
                    args = []
                    kwargs = {}
                    if isinstance(n, ast.Call):
                        name = n.func.attr if isinstance(n.func, ast.Attribute) else n.func.id
                        for an in n.args:
                            args.append(get_val(an))

                        for an in n.keywords:
                            kwargs[an.arg] = get_val(an.value)

                    else:
                        name = n.attr if isinstance(n, ast.Attribute) else n.id

                    d = {
                        "name": name,
                        "args": args,
                        "kwargs": kwargs
                    }
                    m = self.module
                    decor = getattr(m, name, None)
                    if decor:
                        d["decorator"] = decor

                    #res[node.name].append((name, args, kwargs))
                    res[node.name].append(self.decorator_class(**d))

        node_iter = ast.NodeVisitor()
        node_iter.visit_FunctionDef = visit_FunctionDef
        for target_cls in inspect.getmro(self.controller_class):
            if target_cls == Controller: break
            node_iter.visit(ast.parse(inspect.getsource(target_cls)))

        return res
941787
def get_tree_members(self):
        

        members = []
        queue = deque()
        queue.appendleft(self)
        visited = set()

        while len(queue):
            node = queue.popleft()

            if node not in visited:
                members.extend(node.get_member_info())
                queue.extendleft(node.get_children())
                visited.add(node)

        return [{attribute: member.get(attribute) for attribute in self.attr_list} for member in members if member]
427129
function decorateClasses(node) {
    // check for class nodes
    var clsNode = getCommentedClassNode(node);
    if (!clsNode || !clsNode.jsdoc || clsNode.jsdoc.props.length === 0) {
        return;
    }

    var clsSrc = clsNode.node.source();
    if (clsSrc[0] !== "{") {
        // something isn't right, bail.
        return;
    }

    // work out line endings (find first \n and see if it has \r before it)
    var nl = "\n";
    var newlineIndex = clsSrc.indexOf("\n");
    if (clsSrc[newlineIndex-1] === "\r") {
        nl = "\r\n";
    }

    // use the same indent as the next non-blank line
    var indent = "";
    var lines = clsSrc.split(nl);
    for (var i = 1; i < lines.length; i++) { //i=1 to skip the starting {
        if (lines[i].length > 0) {
            var whitespaceMatch = /^[ \t]+/.exec(lines[i]); // match spaces or tabs
            if (whitespaceMatch) {
                indent = whitespaceMatch[0];
                break;
            }
        }
    }

    // work out what to inject into the class definition
    var fieldTypeDecls = clsNode.jsdoc.props.map(function(p) {
        return indent + p.name + ": " + p.type + ";";
    }).join(nl);

    clsNode.node.update("{" + nl + fieldTypeDecls + clsSrc.substr(1));
}
905162
private ImmutableList<Node> getCallParams(Node n) {
    Preconditions.checkArgument(n.isCall(), "Expected a call node, found %s", n);
    ImmutableList.Builder<Node> builder = new ImmutableList.Builder<>();
    for (int i = 0; i < getCallParamCount(n); i++) {
      builder.add(getCallArgument(n, i));
    }
    return builder.build();
  }
74914
def visit_list(self, node, *args, **kwargs):
        
        rv = self.visit(node, *args, **kwargs)
        if not isinstance(rv, list):
            rv = [rv]
        return rv
1020018
def listItem(node):
    
    o = nodes.list_item()
    for n in MarkDown(node):
        o += n
    return o
713198
public static int decoratorNames(int ecflags, byte[][] decorators) {
        switch (ecflags & NEWLINE_DECORATOR_MASK) {
        case UNIVERSAL_NEWLINE_DECORATOR:
        case CRLF_NEWLINE_DECORATOR:
        case CR_NEWLINE_DECORATOR:
        case 0:
            break;
        default:
            return -1;
        }

        if (((ecflags & XML_TEXT_DECORATOR) != 0) && ((ecflags & XML_ATTR_CONTENT_DECORATOR) != 0)) return -1;

        int numDecorators = 0;

        if ((ecflags & XML_TEXT_DECORATOR) != 0) decorators[numDecorators++] = "xml_text_escape".getBytes();
        if ((ecflags & XML_ATTR_CONTENT_DECORATOR) != 0) decorators[numDecorators++] = "xml_attr_content_escape".getBytes();
        if ((ecflags & XML_ATTR_QUOTE_DECORATOR) != 0) decorators[numDecorators++] = "xml_attr_quote".getBytes();

        if ((ecflags & CRLF_NEWLINE_DECORATOR) != 0) decorators[numDecorators++] = "crlf_newline".getBytes();
        if ((ecflags & CR_NEWLINE_DECORATOR) != 0) decorators[numDecorators++] = "cr_newline".getBytes();
        if ((ecflags & UNIVERSAL_NEWLINE_DECORATOR) != 0) decorators[numDecorators++] = "universal_newline".getBytes();

        return numDecorators;
    }
32319
def transform_six_add_metaclass(node):
    
    if not node.decorators:
        return

    for decorator in node.decorators.nodes:
        if not isinstance(decorator, nodes.Call):
            continue

        try:
            func = next(decorator.func.infer())
        except InferenceError:
            continue
        if func.qname() == SIX_ADD_METACLASS and decorator.args:
            metaclass = decorator.args[0]
            node._metaclass = metaclass
            return node