<commit_before>$(document).ready(function(){
    var locations = {
        1: "region",
        2: "state",
        4: "mesoregion",
        5: "microregion",
        7: "municipality"
    };

    var course = location.pathname.split('/')[3];
    var courseFilter;

    if (course.length == 2)
    	courseFilter = 'hedu_course_field=' + course;
    else if (course.length == 6)
    	courseFilter = 'hedu_course=' + course;

    var idIbge = $('#id_ibge').val();
    var locationFilter = ''
    if (idIbge != 'None')
    	locationFilter = idIbge ? locations[idIbge.length] + '=' + idIbge : '';

    filter = [courseFilter, locationFilter].join('&');

    BlueBox.add({
        url: 'http://api.staging.dataviva.info/hedu/year/university?order=enrolleds&year=2015&direction=desc&limit=1&' + filter,
        title: dictionary['main_university'],
        subtitle: dictionary['number_enrolled_students'],
        label: {
            metadata: true,
            value: 'university'
        },
        value: 'enrolleds',
        tab: 'enrollments'
    });

    BlueBox.add({
        url: 'http://api.staging.dataviva.info/hedu/year/municipality?order=enrolleds&year=2015&direction=desc&limit=1&' + filter,
        title: dictionary['main_municipality'],
        subtitle: dictionary['number_enrolled_students'],
        label: {
            metadata: true,
            value: 'municipality'
        },

        value: 'enrolleds',
        tab: 'enrollments'
    });

    BlueBox.add({
        url: 'http://api.staging.dataviva.info/hedu/year/university?order=entrants&year=2015&direction=desc&limit=1&' + filter,
        title: dictionary['main_university'],
        subtitle: dictionary['number_entrant_students'],
        label: {
            metadata: true,
            value: 'university'
        },
        value: 'entrants',
        tab: 'enrollments'
    });

    BlueBox.add({
        url: 'http://api.staging.dataviva.info/hedu/year/municipality?order=entrants&year=2015&direction=desc&limit=1&' + filter,
        title: dictionary['main_municipality'],
        subtitle: dictionary['number_entrant_students'],
        label: {
            metadata: true,
            value: 'municipality'
        },
        value: 'entrants',
        tab: 'enrollments'
    });

    BlueBox.add({
        url: 'http://api.staging.dataviva.info/hedu/year/university?order=graduates&year=2015&direction=desc&limit=1&' + filter,
        title: dictionary['main_university'],
        subtitle: dictionary['number_graduates_students'],
        label: {
            metadata: true,
            value: 'university'
        },
        value: 'graduates',
        tab: 'enrollments'
    });

    BlueBox.add({
        url: 'http://api.staging.dataviva.info/hedu/year/municipality?order=graduates&year=2015&direction=desc&limit=1&' + filter,
        title: dictionary['main_municipality'],
        subtitle: dictionary['number_graduates_students'],
        label: {
            metadata: true,
            value: 'municipality'
        },
        value: 'graduates',
        tab: 'enrollments'
    });
});<commit_msg>Fixes major blueboxes to dont show when municipality is selected<commit_after>$(document).ready(function(){
    var locations = {
        1: "region",
        2: "state",
        4: "mesoregion",
        5: "microregion",
        7: "municipality"
    };

    var course = location.pathname.split('/')[3];
    var courseFilter;

    if (course.length == 2)
    	courseFilter = 'hedu_course_field=' + course;
    else if (course.length == 6)
    	courseFilter = 'hedu_course=' + course;

    var idIbge = $('#id_ibge').val();
    var locationFilter = ''
    if (idIbge != 'None')
    	locationFilter = idIbge ? locations[idIbge.length] + '=' + idIbge : '';

    filter = [courseFilter, locationFilter].join('&');
    var isMunicipality = idIbge.length == 7;

    if(!isMunicipality) {
	    BlueBox.add({
	        url: 'http://api.staging.dataviva.info/hedu/year/municipality?order=enrolleds&year=2015&direction=desc&limit=1&' + filter,
	        title: dictionary['main_municipality'],
	        subtitle: dictionary['number_enrolled_students'],
	        label: {
	            metadata: true,
	            value: 'municipality'
	        },

	        value: 'enrolleds',
	        tab: 'enrollments'
	    });

	    BlueBox.add({
	        url: 'http://api.staging.dataviva.info/hedu/year/municipality?order=entrants&year=2015&direction=desc&limit=1&' + filter,
	        title: dictionary['main_municipality'],
	        subtitle: dictionary['number_entrant_students'],
	        label: {
	            metadata: true,
	            value: 'municipality'
	        },
	        value: 'entrants',
	        tab: 'enrollments'
	    });

	    BlueBox.add({
	        url: 'http://api.staging.dataviva.info/hedu/year/municipality?order=graduates&year=2015&direction=desc&limit=1&' + filter,
	        title: dictionary['main_municipality'],
	        subtitle: dictionary['number_graduates_students'],
	        label: {
	            metadata: true,
	            value: 'municipality'
	        },
	        value: 'graduates',
	        tab: 'enrollments'
	    });
	}

    BlueBox.add({
        url: 'http://api.staging.dataviva.info/hedu/year/university?order=enrolleds&year=2015&direction=desc&limit=1&' + filter,
        title: dictionary['main_university'],
        subtitle: dictionary['number_enrolled_students'],
        label: {
            metadata: true,
            value: 'university'
        },
        value: 'enrolleds',
        tab: 'enrollments'
    });

    BlueBox.add({
        url: 'http://api.staging.dataviva.info/hedu/year/university?order=entrants&year=2015&direction=desc&limit=1&' + filter,
        title: dictionary['main_university'],
        subtitle: dictionary['number_entrant_students'],
        label: {
            metadata: true,
            value: 'university'
        },
        value: 'entrants',
        tab: 'enrollments'
    });


    BlueBox.add({
        url: 'http://api.staging.dataviva.info/hedu/year/university?order=graduates&year=2015&direction=desc&limit=1&' + filter,
        title: dictionary['main_university'],
        subtitle: dictionary['number_graduates_students'],
        label: {
            metadata: true,
            value: 'university'
        },
        value: 'graduates',
        tab: 'enrollments'
    });

});
{'fraction_non_alphanumeric': 0.14573497009757633, 'fraction_numerical': 0.012118350645262826, 'mean_word_length': 2.442578548212351, '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': '505431', 'n_tokens_mistral': 2089, 'n_tokens_neox': 1976, 'n_words': 310}