<commit_before>$(document).ready(function () {
    if (!id_category_0.checked && !id_category_1.checked){
        $("#id_institution").parents('.row').hide();
        $("#id_department").parents('.row').hide();
    }
    $("#id_category_0").click(function () {
        $("#id_institution").parents('.row').show();
        $("#id_department").parents('.row').show();
    });
    $("#id_category_1").click(function () {
        $("#id_institution").parents('.row').hide();
        $("#id_department").parents('.row').hide();
    });
});

function ajax_filter_departments(institution_id)
{
   $("#id_department").html('<option value="">Loading...</option>');
   $.ajax({
       type: "GET",
       url: "/order/show_department",
       dataType: "json",
       data: {'institution':institution_id},
       success: function(retorno) {
           $("#id_department").empty();
           $("#id_department").append('<option value="">--------</option>');
           $.each(retorno, function(i, item){
               $("#id_department").append('<option value="'+item.pk+'">'+item.valor+'</option>');
           });
       },
       error: function(error) {
           alert('Error: No request return.');
       }
   });<commit_msg>Hide fields if "Consumption items" is selected<commit_after>$(document).ready(function () {
    if (!id_category_0.checked && !id_category_1.checked){
        $("#id_institution").parents('.row').hide();
        $("#id_department").parents('.row').hide();
    }
    $("#id_category_0").click(function () {
        $("#id_institution").parents('.row').show();
        $("#id_department").parents('.row').show();
    });
    $("#id_category_1").click(function () {
        $("#id_institution").parents('.row').hide();
        $("#id_department").parents('.row').hide();
    });
    if (id_category_1.checked){
        $("#id_institution").parents('.row').hide();
        $("#id_department").parents('.row').hide();
    }
});

function ajax_filter_departments(institution_id)
{
   $("#id_department").html('<option value="">Loading...</option>');
   $.ajax({
       type: "GET",
       url: "/order/show_department",
       dataType: "json",
       data: {'institution':institution_id},
       success: function(retorno) {
           $("#id_department").empty();
           $("#id_department").append('<option value="">--------</option>');
           $.each(retorno, function(i, item){
               $("#id_department").append('<option value="'+item.pk+'">'+item.valor+'</option>');
           });
       },
       error: function(error) {
           alert('Error: No request return.');
       }
   });
{'fraction_non_alphanumeric': 0.24275914634146342, 'fraction_numerical': 0.003429878048780488, 'mean_word_length': 2.9120715350223545, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '112804', 'n_tokens_mistral': 782, 'n_tokens_neox': 788, 'n_words': 92}