<commit_before>
function buildList(parent, branch)
{
    var listBranch = [];

    var elementsMenu = jQuery(parent).children('li');
    var label = '';
    var newBranch = Object();
    var listTemp = [];
    elementsMenu.each(function() {
        label = jQuery(jQuery(jQuery(this).children('a')).children('span')).html();

        if (jQuery(this).hasClass('parent')) {
            var childElementsMenu = jQuery(this).children('ul');
            newBranch.list = branch.list.slice(0);
            newBranch.value = branch.value;
            newBranch.label = branch.label;

            newBranch.list.push(this);
            newBranch.value = newBranch.value + '>' + label;
            newBranch.label = newBranch.label + '>' + label;
            var tempList = buildList(childElementsMenu, newBranch);
            listBranch = listBranch.concat(tempList);
        } else {
            listTemp = branch.list.slice(0);
            listTemp.push(this);

            listBranch.push({
                list: listTemp,
                value: branch.value + '>' + label,
                label: branch.value + '>' + label
            });
        }
    });
    return listBranch;
}

jQuery( document ).ready(function( $ ) {
    var nav = $('#nav');

    var list = buildList(nav, {
        list: [],
        value: '',
        label: ''
    });

    $(".help-search-menu").autocomplete({
        minLength: 0,
        source: list,
        select: function( event, ui ) {

            var list = ui.item.list;
            var item = list[list.length - 1];
            var a = $(item).children('a');
            document.location.href = $(a).attr('href');
            return false;
        },
        focus: function(event, ui) {
            var list = ui.item.list;
            $($("#nav").find('li')).removeClass('over');<commit_msg>fix add input in menu<commit_after>
function buildList(parent, branch)
{
    var listBranch = [];

    var elementsMenu = jQuery(parent).children('li');
    var label = '';
    var newBranch = Object();
    var listTemp = [];
    elementsMenu.each(function() {
        label = jQuery(jQuery(jQuery(this).children('a')).children('span')).html();

        if (jQuery(this).hasClass('parent')) {
            var childElementsMenu = jQuery(this).children('ul');
            newBranch.list = branch.list.slice(0);
            newBranch.value = branch.value;
            newBranch.label = branch.label;

            newBranch.list.push(this);
            newBranch.value = newBranch.value + '>' + label;
            newBranch.label = newBranch.label + '>' + label;
            var tempList = buildList(childElementsMenu, newBranch);
            listBranch = listBranch.concat(tempList);
        } else {
            listTemp = branch.list.slice(0);
            listTemp.push(this);

            listBranch.push({
                list: listTemp,
                value: branch.value + '>' + label,
                label: branch.value + '>' + label
            });
        }
    });
    return listBranch;
}

jQuery( document ).ready(function( $ ) {
    $("#page-help-link").before('<input class="help-search-menu" style="width: 350px" placeholder="Search menu"/>');

    var nav = $('#nav');

    var list = buildList(nav, {
        list: [],
        value: '',
        label: ''
    });

    $(".help-search-menu").autocomplete({
        minLength: 0,
        source: list,
        select: function( event, ui ) {

            var list = ui.item.list;
            var item = list[list.length - 1];
            var a = $(item).children('a');
            document.location.href = $(a).attr('href');
            return false;
        },
        focus: function(event, ui) {
            var list = ui.item.list;
            $($("#nav").find('li')).removeClass('over');
{'fraction_non_alphanumeric': 0.15760295670538543, 'fraction_numerical': 0.002903907074973601, 'mean_word_length': 1.9012251148545176, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 12, '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': '2876051', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1074, 'n_words': 209}