<commit_before>///<reference path='references.ts' />

module ts {
    export function getNavigationBarItemsHelper(sourceFile: SourceFile): ts.NavigationBarItem[]  {
        var hasGlobalNode = false;

        return getItemsWorker(getTopLevelNodes(sourceFile), createTopLevelItem);

        function getIndent(node: Node): number {
            var indent = hasGlobalNode ? 1 : 0;

            var current = node.parent;
            while (current) {
                if (current.kind === SyntaxKind.ModuleDeclaration || current.kind === SyntaxKind.FunctionDeclaration) {
                    indent++;
                }

                current = current.parent;
            }

            return indent;
        }

        function getChildNodes(nodes: Node[]): Node[] {
            var childNodes: Node[] = [];    

            for (var i = 0, n = nodes.length; i < n; i++) {
                var node = nodes[i];

                if (node.kind === SyntaxKind.FunctionDeclaration) {
                    childNodes.push(node);
                }
                else if (node.kind === SyntaxKind.VariableStatement) {
                    forEach((<VariableStatement>node).declarations, declaration => {
                        childNodes.push(declaration);
                    });
                }
            }

            return childNodes;
        }

        function getTopLevelNodes(node: SourceFile): Node[] {
            var topLevelNodes: Node[] = [];
            topLevelNodes.push(node);

            addTopLevelNodes(node.statements, topLevelNodes);

            return topLevelNodes;
        }

        function addTopLevelNodes(nodes: Node[], topLevelNodes: Node[]): void {
            for (var i = 0, n = nodes.length; i < n; i++) {
                var node = nodes[i];<commit_msg>Use push.apply to push multiple elements.<commit_after>///<reference path='references.ts' />

module ts {
    export function getNavigationBarItemsHelper(sourceFile: SourceFile): ts.NavigationBarItem[]  {
        var hasGlobalNode = false;

        return getItemsWorker(getTopLevelNodes(sourceFile), createTopLevelItem);

        function getIndent(node: Node): number {
            var indent = hasGlobalNode ? 1 : 0;

            var current = node.parent;
            while (current) {
                if (current.kind === SyntaxKind.ModuleDeclaration || current.kind === SyntaxKind.FunctionDeclaration) {
                    indent++;
                }

                current = current.parent;
            }

            return indent;
        }

        function getChildNodes(nodes: Node[]): Node[] {
            var childNodes: Node[] = [];    

            for (var i = 0, n = nodes.length; i < n; i++) {
                var node = nodes[i];

                if (node.kind === SyntaxKind.FunctionDeclaration) {
                    childNodes.push(node);
                }
                else if (node.kind === SyntaxKind.VariableStatement) {
                    childNodes.push.apply(childNodes, (<VariableStatement>node).declarations);
                }
            }

            return childNodes;
        }

        function getTopLevelNodes(node: SourceFile): Node[] {
            var topLevelNodes: Node[] = [];
            topLevelNodes.push(node);

            addTopLevelNodes(node.statements, topLevelNodes);

            return topLevelNodes;
        }

        function addTopLevelNodes(nodes: Node[], topLevelNodes: Node[]): void {
            for (var i = 0, n = nodes.length; i < n; i++) {
                var node = nodes[i];
{'fraction_non_alphanumeric': 0.10941906373378454, 'fraction_numerical': 0.0022560631697687537, 'mean_word_length': 1.6810279667422525, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1554494', 'n_tokens_mistral': 930, 'n_tokens_neox': 867, 'n_words': 205}