<commit_before>var map, router = new Router();

function findRoutes() {
    var buses = router.findRoutes(document.getElementById('source').value, document.getElementById('destination').value);


    document.getElementById('output').innerHTML = buses.map(function(b) {
        return renderOption(b);
    }).join('\n');
}

function renderOption(route) {
    var output;
    if(route.changes.length == 0) {
        output = renderRoute(route.from, route.to, route.distance, route.routes[0].routes);
    }
    else if(route.changes.length == 1) {
        output = '<div class="col-xs-6">' + 
            renderRoute(route.from, route.changes[0], route.routes[0].distance, route.routes[0].routes) + 
        '</div><div class="col-xs-6">' +
            renderRoute(route.changes[0], route.to, route.routes[1].distance, route.routes[1].routes) + 
        '</div>';
    }
    else if(route.changes.length == 2) {
        output = '<div class="col-xs-4">' + 
            renderRoute(route.from, route.changes[0], route.routes[0].distance, route.routes[0].routes) + 
        '</div><div class="col-xs-4">' +
            renderRoute(route.changes[0], route.changes[1], route.routes[1].distance, route.routes[1].routes) +
        '</div><div class="col-xs-4">' +
            renderRoute(route.changes[1], route.to, route.routes[2].distance, route.routes[2].routes) + 
        '</div>';
    }

    return '<div class="panel panel-default"><div class="panel-body row">' + 
        output + '</div><div class="panel-footer text-center">' + 
        'Total Distance: <strong>' + (route.distance / 1000.0).toFixed(2) + 'km </strong></div></div>';<commit_msg>highlighted shortest route<commit_after>var map, router = new Router();

function findRoutes() {
    var buses = router.findRoutes(document.getElementById('source').value, document.getElementById('destination').value);


    document.getElementById('output').innerHTML = buses.map(function(b, index) {
        return renderOption(b, index);
    }).join('\n');
}

function renderOption(route, index) {
    var output;
    if(route.changes.length == 0) {
        output = renderRoute(route.from, route.to, route.distance, route.routes[0].routes);
    }
    else if(route.changes.length == 1) {
        output = '<div class="col-xs-6">' + 
            renderRoute(route.from, route.changes[0], route.routes[0].distance, route.routes[0].routes) + 
        '</div><div class="col-xs-6">' +
            renderRoute(route.changes[0], route.to, route.routes[1].distance, route.routes[1].routes) + 
        '</div>';
    }
    else if(route.changes.length == 2) {
        output = '<div class="col-xs-4">' + 
            renderRoute(route.from, route.changes[0], route.routes[0].distance, route.routes[0].routes) + 
        '</div><div class="col-xs-4">' +
            renderRoute(route.changes[0], route.changes[1], route.routes[1].distance, route.routes[1].routes) +
        '</div><div class="col-xs-4">' +
            renderRoute(route.changes[1], route.to, route.routes[2].distance, route.routes[2].routes) + 
        '</div>';
    }

    return (index == 0 ? ('<div class="panel panel-warning"><div class="panel-heading"><h3 class="panel-title">' + 
        'Shortest Route</h3></div>') : '<div class="panel panel-default">') + '<div class="panel-body row">' + 
        output + '</div><div class="panel-footer text-center">Total Distance: <strong>' + 
        (route.distance / 1000.0).toFixed(2) + 'km </strong></div></div>';
{'fraction_non_alphanumeric': 0.1942923032574229, 'fraction_numerical': 0.018737388296339003, 'mean_word_length': 3.155688622754491, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 44, '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': '697746', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1113, 'n_words': 181}