<commit_before>javascript:void(function () {

    if (typeof jQuery=='undefined') { 
        script = document.createElement( 'script' );  
        script.src = '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';   
        document.body.appendChild(script);  
    } 
    
    
    function labelClone(selector, labels) {
        if (labels) {
            var node = $(selector).find("a[id^='labels_dropdown_dropdown']").first();
       
            node.click();
            node.parents(".dropdown").find("li.dropdown_item").each(function(e) { 
                if (jQuery.inArray($(this).text(),labels) >= 0) { 
                    $(this).mouseenter().click();
                } 
            });
            node.click();
        }
    }
    
    function titleClone(selector, storyTitle) {
        $(selector).find("[id^=story_name]").text(storyTitle);
    }  
    
    
    function storyTypeClone(selector, storyType) {
        $(selector).find("a[id^='story_type_dropdown'].search").first().click();
        var storyTypes = $(".dropdown.story_type ul").first().find("li");
        storyTypes.each( function( index ) { 
            if ($(this).attr("data-value") == storyType) {
                $(selector).find("a[id^='story_type_dropdown']").first().click();
                $(selector).find("a.item_"+storyType).mouseenter().click();
            }
        });
    }
    
    
    function clonePivotalTicket() {  
        if(!$("input,textarea").is(":focus")) {
            alert("Please place focus on the input/textarea of the desired ticket before proceeding");
        } 
        else {
            var selector = "*:focus";
            
            var collapser_selector = $(selector).attr("id").replace(/story_.+_(.+)/,"story_collapser_$1");
            var obj = {
                storyTitle :   $(selector).text(),
                owner       :   $("a[id^=story_owned_by_id_dropdown]").text(),
                storyType  :   $(selector).parents("form").find("input[name='story[story_type]']").val(),
                labels      :   []
            };
    
            $(selector).parents("section.edit").find("ul.selected.labels li").each (function (i) { 
                var label = $(this).find("a.label.name").text();
                if (label) {
                    obj['labels'].push(label);<commit_msg>Update based on source.js update.<commit_after>javascript:void(function () {

    if (typeof jQuery=='undefined') { 
        script = document.createElement( 'script' );  
        script.src = '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';   
        document.body.appendChild(script);  
    } 
    
    
    function labelClone(selector, labels) {
        if (labels) {
            var node = $(selector).find("a[id^='labels_dropdown_dropdown']").first();
       
            node.click();
            node.parents(".dropdown").find("li.dropdown_item").each(function(e) { 
                if (jQuery.inArray($(this).text(),labels) >= 0) { 
                    $(this).mouseenter().click();
                } 
            });
            node.click();
        }
    }
    
    function titleClone(selector, storyTitle) {
        $(selector).find("[id^=story_name]").text(storyTitle);
    }  
    
    
    function storyTypeClone(selector, storyType) {
        $(selector).find("a[id^='story_type_dropdown'].search").first().click();
        var storyTypes = $(".dropdown.story_type ul").first().find("li");
        storyTypes.each( function( index ) { 
            if ($(this).attr("data-value") == storyType) {
                $(selector).find("a[id^='story_type_dropdown']").first().click();
                $(selector).find("a.item_"+storyType).mouseenter().click();
            }
        });
    }
    
    
    function getter(selector, key) {
        var returnValue;
        switch(key) {
            case 'storyTitle':
                returnValue = $(selector).text();
                break;  
            case 'storyType':
                returnValue = $(selector).parents("form").find("input[name='story[story_type]']").val();
                break;
            case 'owner':
                returnValue = $("a[id^=story_owned_by_id_dropdown]").text();
                break;  
            default:
                returnValue = [];
        }
        return returnValue;
    }
    
    
    
    function clonePivotalTicket() {  
        if(!$("input,textarea").is(":focus")) {
            alert("Please place focus on the input/textarea of the desired ticket before proceeding");
        } 
        else {
            var selector = "*:focus";
            
            var collapser_selector = $(selector).attr("id").replace(/story_.+_(.+)/,"story_collapser_$1");
            var obj = {
                storyTitle  :   getter(selector,'storyTitle'),
                owner       :   getter(selector,'owner'),
                storyType   :   getter(selector, 'storyType'),
                labels      :   getter(selector, '')
            };
    
            $(selector).parents("section.edit").find("ul.selected.labels li").each (function (i) { 
                var label = $(this).find("a.label.name").text();
                if (label) {
                    obj['labels'].push(label);
{'fraction_non_alphanumeric': 0.16717557251908396, 'fraction_numerical': 0.0011450381679389313, 'mean_word_length': 1.8147153598281418, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '5165766', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1419, 'n_words': 202}