<commit_before>var App = angular.module('App', []);

App.config(function($interpolateProvider, $httpProvider) {
    $interpolateProvider.startSymbol('{$');
    $interpolateProvider.endSymbol('$}');
})

// Still uses the data-content attr for content
App.directive('popover', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            options = {
                trigger: 'hover'
            }
            $(element).popover(options);
        }
    }
});

App.directive('hasError', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            var formGroup = $(element);
            if (formGroup.find('.errorlist').length > 0) {
                formGroup.addClass('has-error');
            }
        }
    }
});<commit_msg>Directives for tooltips, record detection and active tab detection.<commit_after>var App = angular.module('App', []);

App.config(function($interpolateProvider, $httpProvider) {
    $interpolateProvider.startSymbol('{$');
    $interpolateProvider.endSymbol('$}');
})

App.directive('isActive', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            if (attrs.href === window.location.pathname) {
                element.parent().addClass('active')
            }
        }
    }
});

// Still uses the data-content attr for content
App.directive('popover', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            options = {
                trigger: 'hover'
            }
            $(element).popover(options);
        }
    }
});

App.directive('hasError', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            var formGroup = $(element);
            if (formGroup.find('.errorlist').length > 0) {
                formGroup.addClass('has-error');
            }
        }
    }
});

App.directive('tooltip', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            $(element).tooltip();
        }
    }
});

App.directive('hasRecords', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            // Compare it with the python bool 
            if (attrs.records == 'False') {
                element.addClass('no-records');
            }
        }
    }
});


{'fraction_non_alphanumeric': 0.1534369885433715, 'fraction_numerical': 0.0008183306055646482, 'mean_word_length': 1.99265605875153, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '879170', 'n_tokens_mistral': 691, 'n_tokens_neox': 693, 'n_words': 136}