<commit_before>function append_project_tag(e, project_tag_id, project_tags)
{
    // dropdown
    var parent_elem = e.parentElement;
    while (parent_elem.className != "project_tag_board")
    {
        parent_elem = parent_elem.parentElement;
    }

    parent_elem.appendChild(get_project_tag_p_elem(project_tag_id, project_tags));
}


function get_project_tag_p_elem(project_tag_id, project_tags)
{
        // p1にproject_tag_boardのElementを追加する
    var p_elem = document.createElement('p');

    var select_elem = document.createElement('select')
    select_elem.name = "project_tag_id" + String(project_tag_id);

    project_tags.forEach(function(project_tag){
        var option_elem = document.createElement('option');
        option_elem.value = project_tag['project_tag_id'];
        option_elem.text = project_tag['project_tag_name'];
        select_elem.appendChild(option_elem);
    });
    p_elem.appendChild(select_elem);

    // image
    a_elem = document.createElement('a');
    a_elem.setAttribute('href', '#');
    a_elem.onclick = new Function('append_project_tag(this, ' + String(project_tag_id + 1) + ',' + JSON.stringify(project_tags) + ')');

    img_elem = document.createElement('img');
    img_elem.setAttribute('src', '/images/plus.png');
    a_elem.appendChild(img_elem);
    p_elem.appendChild(a_elem);
    
    return p_elem;
}<commit_msg>fix syntax of common.js<commit_after>function append_project_tag(e, project_tag_id, project_tags)
{
    // dropdown
    var parent_elem = e.parentElement;
    while (parent_elem.className != "project_tag_board")
    {
        parent_elem = parent_elem.parentElement;
    }

    parent_elem.appendChild(get_project_tag_p_elem(project_tag_id, project_tags));
}


function get_project_tag_p_elem(project_tag_id, project_tags)
{
        // p1にproject_tag_boardのElementを追加する
    var p_elem = document.createElement('p');

    var select_elem = document.createElement('select')
    select_elem.name = "project_tag_id" + String(project_tag_id);

    project_tags.forEach(
        function (project_tag) {
            var option_elem = document.createElement('option');
            option_elem.value = project_tag['project_tag_id'];
            option_elem.text = project_tag['project_tag_name'];
            select_elem.appendChild(option_elem);
        }
    );
    p_elem.appendChild(select_elem);

    // image
    a_elem = document.createElement('a');
    a_elem.setAttribute('href', '#');
    a_elem.onclick = new Function('append_project_tag(this, ' + String(project_tag_id + 1) + ',' + JSON.stringify(project_tags) + ')');

    img_elem = document.createElement('img');
    img_elem.setAttribute('src', '/images/plus.png');
    a_elem.appendChild(img_elem);
    p_elem.appendChild(a_elem);
    
    return p_elem;
}
{'fraction_non_alphanumeric': 0.12248563218390805, 'fraction_numerical': 0.0014367816091954023, 'mean_word_length': 3.946714031971581, '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': '3185399', 'n_tokens_mistral': 894, 'n_tokens_neox': 880, 'n_words': 117}