<commit_before>(function () {
    'use strict';

    angular.module('graphe.algorithms')
        .service('dfs', function () {
            var service = {};

            var n = 'Depth first search',
                instructions = [],
                result = [],
                steps = [
                    'procedure DFS(G,v):',
                    'label v as discovered',
                    'for all edges from v to w in G.adjacentEdges(v) do',
                    'if vertex w is not labeled as discovered then',
                    'recursively call DFS(G,w)',
                    'end of algorithm'
                ];

            /*
             *  Method definitions
             * */

            function depthSearch(graph, visited, dfsSteps) {
                dfsSteps.push({instruction: 0, visited: visited});
                visited.marked = true;
                dfsSteps.push({instruction: 1, visited: visited});

                graph.adjacentList[visited.index].forEach(function (node) {
                    dfsSteps.push({instruction: 2, visited: visited});
                    dfsSteps.push({instruction: 3, visited: visited});

                    if (!node.marked) {
                        dfsSteps.push({instruction: 4, visited: visited});
                        service.run(graph, node, dfsSteps);
                    }
                });

                dfsSteps.push({instruction: 5, visited: visited});

                // clean markers
                graph.getNodes().forEach(function (element) {
                    element.marked = false;
                });
            }

            function run(graph, visited) {

                if (typeof visited === "string") {
                    console.log('passed string');
                    visited = graph.getNode(visited);
                }

                service.instructions.push({instruction: 0, visited: visited});
                visited.marked = true;
                service.result.push(visited.label);
                service.instructions.push({instruction: 1, visited: visited});

                graph.adjacentList[visited.index].forEach(function (node) {
                    service.instructions.push({instruction: 2, visited: visited});
                    service.instructions.push({instruction: 3, visited: visited});

                    if (!node.marked) {
                        service.instructions.push({instruction: 4, visited: visited});
                        service.run(graph, node);
                    }
                });
            }

            service = {
                name: n,
                steps: steps,
                instructions: instructions,
                depthSearch: depthSearch,
                run: run,
                result: result
            };

            return service;
        });
})();<commit_msg>Removed unused code.<commit_after>(function () {
    'use strict';

    angular.module('graphe.algorithms')
        .service('dfs', function () {
            var service = {};

            function next(){

            }

            function previous(){

            }

            var n = 'Depth first search',
                instructions = [],
                result = [],
                steps = [
                    'procedure DFS(G,v):',
                    'label v as discovered',
                    'for all edges from v to w in G.adjacentEdges(v) do',
                    'if vertex w is not labeled as discovered then',
                    'recursively call DFS(G,w)',
                    'end of algorithm'
                ],
                stepList = [];



            function run(graph, visited) {

                if (typeof visited === "string") {
                    console.log('passed string');
                    visited = graph.getNode(visited);
                }

                service.instructions.push({instruction: 0, visited: visited});
                visited.marked = true;
                service.result.push(visited.label);
                service.instructions.push({instruction: 1, visited: visited});

                graph.adjacentList[visited.index].forEach(function (node) {
                    service.instructions.push({instruction: 2, visited: visited});
                    service.instructions.push({instruction: 3, visited: visited});

                    if (!node.marked) {
                        service.instructions.push({instruction: 4, visited: visited});
                        service.run(graph, node);
                    }
                });
            }

            service = {
                name: n,
                steps: steps,
                instructions: instructions,
                run: run,
                result: result
            };

            return service;
        });
})();
{'fraction_non_alphanumeric': 0.10887180552669852, 'fraction_numerical': 0.0033243299397465197, 'mean_word_length': 1.1852019972764412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7031978', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1058, 'n_words': 254}