Build a function node.
353711
protected function _functionNode()
    {
        $node = new FunctionDef();
        $token = $this->_stream->current(true);
        $parent = $this->_states['current'];

        $body = $token[1];
        $name = substr($this->_stream->next('('), 0, -1);
        $body .= $name;
        $node->name = trim($name);
        $args = $this->_parseArgs();
        $node->args = $args['args'];
        $body .= $args['body'] . $this->_stream->next([';', '{']);
        if ($parent) {
            $isMethod = $parent->hasMethods;
            if ($parent->type === 'interface') {
                $node->type = 'signature';
            }
        } else {
            $isMethod = false;
        }
        $node->isMethod = $isMethod;
        $node->isClosure = !$node->name;
        if ($isMethod) {
            $node->visibility = $this->_states['visibility'];
            $this->_states['visibility'] = [];
        }
        $node->body = $body;
        $this->_codeNode();
        $this->_states['body'] = $body;
        $this->_contextualize($node);

        // Looking for curly brackets only if not an "abstract function"
        if ($this->_stream->current() === '{') {
            $this->_states['current'] = $node;
        }

        return $node->function = $node;
    }
816184
def visit_Call(self, node):
        
        func_aliases = self.aliases[node.func]
        if len(func_aliases) == 1:
            function_def = next(iter(func_aliases))
            if (isinstance(function_def, ast.FunctionDef) and
                    function_def.name in self.inlinable):
                self.update = True
                to_inline = copy.deepcopy(self.inlinable[function_def.name])
                arg_to_value = dict()
                values = node.args
                values += to_inline.args.defaults[len(node.args) -
                                                  len(to_inline.args.args):]
                for arg_fun, arg_call in zip(to_inline.args.args, values):
                    v_name = "__pythran_inline{}{}{}".format(function_def.name,
                                                             arg_fun.id,
                                                             self.call_count)
                    new_var = ast.Name(id=v_name,
                                       ctx=ast.Store(),
                                       annotation=None)
                    self.defs.append(ast.Assign(targets=[new_var],
                                                value=arg_call))
                    arg_to_value[arg_fun.id] = ast.Name(id=v_name,
                                                        ctx=ast.Load(),
                                                        annotation=None)
                self.call_count += 1
                return Inliner(arg_to_value).visit(to_inline.body[0])
        return node
280938
def build(self) -> str:
        """"""
        self._set_autoreload()
        return ''.join(child.html for child in self.childNodes)
443236
def make_func_call(id_, lineno, params):
    
    return symbols.FUNCCALL.make_node(id_, params, lineno)
991013
def build_cfg(cls, node):
    
    if not isinstance(node, gast.FunctionDef):
      raise TypeError('input must be a function definition')
    cfg = cls()
    cfg.entry = Node(node.args)
    cfg.head = [cfg.entry]
    cfg.visit_statements(node.body)
    cfg.exit = Node(None)
    cfg.set_head(cfg.exit)
    cfg.backlink(cfg.entry)
    return cfg
1348856
def dfs_do_func_on_graph(node, func, *args, **kwargs):
    '''
    
    '''
    for _node in node.tree_iterator():
        func(_node, *args, **kwargs)
530273
def build_transitive_closure(self, rel, tc_dict):
        """"""
        # Make a function with the righ argument structure
        rel_fun = lambda node, graph: rel(node)
        for x in self.graph.all_nodes():
            rel_closure = self.graph.transitiveClosure(rel_fun, x)
            xs = x.toPython()
            for y in rel_closure:
                ys = y.toPython()
                if xs == ys:
                    continue
                try:
                    tc_dict[xs].append(ys)
                except KeyError:
                    tc_dict[xs] = [ys]
                if rel == self.isa_or_partof_objects:
                    self._add_component(xs, ys)
682209
def build(self, tokenlist):
        """"""
        self._tokens = tokenlist
        self._tokens.reverse()
        self._push()
        while self._tokens:
            node = self._handle_token(self._tokens.pop())
            self._write(node)
        return self._pop()
945493
function build(node, buildBody) {
  var self = node.blocks.shift();
  if (!self) return;

  var child = build(node, buildBody);
  if (!child) {
    // last item
    child = buildBody();

    // add a filter as this is our final stop
    if (node.filter) {
      child = t.ifStatement(node.filter, t.blockStatement([child]));
    }
  }

  return t.forOfStatement(t.variableDeclaration("let", [t.variableDeclarator(self.left)]), self.right, t.blockStatement([child]));
}
617210
function buildNode(file, watch) {
  if (watch) {
    return gulp.watch(paths.src + file + '.js')
      .on('change', function(file) {
        $.util.log('Copying to lib...');
        gulp.src(file.path)
          .pipe($.plumber())
          .pipe($.babel())
          .pipe(gulp.dest(paths.dist));
      });
  } else {
    return gulp.src(paths.src + file + '.js')
      .pipe($.plumber())
      .pipe($.babel())
      .pipe(gulp.dest(paths.dist));
  }
}
223450
def visit_lambda(self, node, parent):
        """"""
        newnode = nodes.Lambda(node.lineno, node.col_offset, parent)
        newnode.postinit(self.visit(node.args, newnode), self.visit(node.body, newnode))
        return newnode
576124
def visit_FunctionCall(self, node):
        """"""
        function_name = node.identifier.name
        call = self.table[function_name]
        if call is None:
            raise SementicError(f"Function `{function_name}` not declared.")
        else:
            call = call._node

        if isinstance(call, AST):
            if len(call.parameters) != len(node.parameters):
                raise SementicError(
                    "Mismatch between call and function parameters number."
                )

            current_table = self.table.stack.current
            functions_in_table = {
                key: current_table[key]
                for key in current_table
                if isinstance(current_table[key], FunctionSymbol)
            }

            if self.table.name == function_name:
                # End the visit in case of recursion
                return

            self.table.append_table(function_name, **functions_in_table)
            self.visit(call)
            self.table.pop_table()
718952
def build(self, *args, **kwargs):
        """"""
        # Allocate here if not done yet!
        if not self.allocated: self.allocate()

        self.indir.makedirs()
        self.outdir.makedirs()
        self.tmpdir.makedirs()

        # Check the nodeid file in workdir
        nodeid_path = os.path.join(self.workdir, ".nodeid")

        if os.path.exists(nodeid_path):
            with open(nodeid_path, "rt") as fh:
                node_id = int(fh.read())

            if self.node_id != node_id:
                msg = ("\nFound node_id %s in file:\n\n  %s\n\nwhile the node_id of the present flow is %d.\n"
                       "This means that you are trying to build a new flow in a directory already used by another flow.\n"
                       "Possible solutions:\n"
                       "   1) Change the workdir of the new flow.\n"
                       "   2) remove the old directory either with `rm -r` or by calling the method flow.rmtree()\n"
                        % (node_id, nodeid_path, self.node_id))
                raise RuntimeError(msg)

        else:
            with open(nodeid_path, "wt") as fh:
                fh.write(str(self.node_id))

        if self.pyfile and os.path.isfile(self.pyfile):
            shutil.copy(self.pyfile, self.workdir)

        for work in self:
            work.build(*args, **kwargs)
1106830
def _function_add_node(self, cfg_node, function_addr):
        
        snippet = self._to_snippet(cfg_node=cfg_node)
        self.kb.functions._add_node(function_addr, snippet)
797171
function processFunction(funcNode) {
            const node = isEmbedded(funcNode) ? funcNode.parent : funcNode;

            if (!IIFEs && isIIFE(node)) {
                return;
            }
            let lineCount = 0;

            for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) {
                const line = lines[i];

                if (skipComments) {
                    if (commentLineNumbers.has(i + 1) && isFullLineComment(line, i + 1, commentLineNumbers.get(i + 1))) {
                        continue;
                    }
                }

                if (skipBlankLines) {
                    if (line.match(/^\s*$/u)) {
                        continue;
                    }
                }

                lineCount++;
            }

            if (lineCount > maxLines) {
                const name = astUtils.getFunctionNameWithKind(funcNode);

                context.report({
                    node,
                    messageId: "exceed",
                    data: { name, lineCount, maxLines }
                });
            }
        }
358893
def object_build_function(node, member, localname):
    """"""
    # pylint: disable=deprecated-method; completely removed in 2.0
    args, varargs, varkw, defaults = inspect.getargspec(member)
    if varargs is not None:
        args.append(varargs)
    if varkw is not None:
        args.append(varkw)
    func = build_function(
        getattr(member, "__name__", None) or localname, args, defaults, member.__doc__
    )
    node.add_local_node(func, localname)
189294
def append(self, node):
        ""
        if not isinstance(node, self.__class__):
            raise TypeError('Expected Node instance, got %r' % node)
        self.nodes.append(node)