<commit_before>$(document).ready(function() {     
    $("#accordion_menu").accordion({
        autoHeight: false, 
        collapsible: true,
        active: false,
        change: function(event, ui) {   
            if(ui.newContent.length==0)  //collapse
                ui.oldHeader.find("#arrow_icon").removeClass("open").addClass("close");            
            else  //expand
                ui.newHeader.find("#arrow_icon").removeClass("close").addClass("open");   
        }
    });
    $("#accordion_menu").show();
    
    $("#midmenu_container").selectable({
        selecting: function(event, ui) {	 	                               
            if(ui.selecting.id.indexOf("midmenuItem") != -1) {                     
                var $t = $("#"+ui.selecting.id);
                $t.find("#content").addClass("selected");                  
                
                var id =$t.data("id");                
                selectedItemIds[id] = null; 
                               
                var toRightPanelFn = $t.data("toRightPanelFn");
                toRightPanelFn($t);	          
            }                                             
        },
        unselecting: function(event, ui) {
            if(ui.unselecting.id.indexOf("midmenuItem") != -1) {                     
                $("#"+ui.unselecting.id).find("#content").removeClass("selected");    
                var itemId =$("#"+ui.unselecting.id).data("id");                
                delete selectedItemIds[itemId];
            }             
        }
    });

    var $rightPanel = $("#right_panel"); 
    var $addLink = $("#add_link");
    var $actionLink = $("#action_link");
    var $actionMenu = $("#action_menu");
    var $actionList = $actionMenu.find("#action_list");
    var $midmenuContainer = $("#midmenu_container");
    var $midmenuItemVm = $("#midmenu_item_vm");    
    var $actionListItem = $("#action_list_item");
    
    var selectedItemIds = {};
    
    $("#leftmenu_instance_group_header").bind("click", function(event) {   
        var $arrowIcon = $(this).find("#arrow_icon");        
        clickInstanceGroupHeader($arrowIcon, selectedItemIds);
        return false;
    });
    
    var $midmenuItem = $("#midmenu_item");
    function listMidMenuItems(leftmenuId, apiName, jsonResponse1, jsonResponse2, descriptionProperty) { 
        $("#"+leftmenuId).bind("click", function(event) {
            $.ajax({
	            cache: false,<commit_msg>Only items not in action are allowed to be selected<commit_after>$(document).ready(function() {     
    $("#accordion_menu").accordion({
        autoHeight: false, 
        collapsible: true,
        active: false,
        change: function(event, ui) {   
            if(ui.newContent.length==0)  //collapse
                ui.oldHeader.find("#arrow_icon").removeClass("open").addClass("close");            
            else  //expand
                ui.newHeader.find("#arrow_icon").removeClass("close").addClass("open");   
        }
    });
    $("#accordion_menu").show();
    
    $("#midmenu_container").selectable({
        selecting: function(event, ui) {	 	                               
            if(ui.selecting.id.indexOf("midmenuItem") != -1) {                     
                var $t = $("#"+ui.selecting.id);
                if($t.find("#content").hasClass("adding") == false) { //only items not in action are allowed to be selected
                    var id =$t.data("id");                
                    selectedItemIds[id] = null; 
                    $t.find("#content").addClass("selected");   
                }                               
                var toRightPanelFn = $t.data("toRightPanelFn");
                toRightPanelFn($t);	          
            }                                             
        },
        unselecting: function(event, ui) {
            if(ui.unselecting.id.indexOf("midmenuItem") != -1) {                     
                var $t = $("#"+ui.unselecting.id);
                var id = $t.data("id");
                if(id in selectedItemIds) {                    
                    delete selectedItemIds[id];
                    $t.find("#content").removeClass("selected"); 
                }
            }             
        }
    });

    var $rightPanel = $("#right_panel"); 
    var $addLink = $("#add_link");
    var $actionLink = $("#action_link");
    var $actionMenu = $("#action_menu");
    var $actionList = $actionMenu.find("#action_list");
    var $midmenuContainer = $("#midmenu_container");
    var $midmenuItemVm = $("#midmenu_item_vm");    
    var $actionListItem = $("#action_list_item");
    
    var selectedItemIds = {};
    
    $("#leftmenu_instance_group_header").bind("click", function(event) {   
        var $arrowIcon = $(this).find("#arrow_icon");        
        clickInstanceGroupHeader($arrowIcon, selectedItemIds);
        return false;
    });
    
    var $midmenuItem = $("#midmenu_item");
    function listMidMenuItems(leftmenuId, apiName, jsonResponse1, jsonResponse2, descriptionProperty) { 
        $("#"+leftmenuId).bind("click", function(event) {
            $.ajax({
	            cache: false,
{'fraction_non_alphanumeric': 0.15047984644913628, 'fraction_numerical': 0.0019193857965451055, 'mean_word_length': 1.6358118361153262, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5375620', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1358, 'n_words': 220}