<commit_before>$(document).ready(function(){
    $( document ).on( "click focused", "button.check_url_valid", function() {
        var btn = this;
        var url = $(this).parent().parent().find('input:first').val();
        var type = '';
        var attr = $(this).attr('url-type');
        var thisID = $(this).attr('id');
        var providerName = $(this).attr('providerName');
        var apiName = $(this).attr('apiName');
        var apiVersion = $(this).attr('apiVersion');
        if (attr) {
            type = $(btn).attr('url-type');
        } else {
            if (thisID == "prototype_test") {
                type = "http";
            }
            else {
            	if ($("#endpoint_config").val() && $("#endpoint_config").val() != "") {
            		type = $.parseJSON($("#endpoint_config").val())['endpoint_type'];
            	}                
            }
        }
        if (!providerName && !apiName && !apiVersion) {
            providerName = "";
            apiName = "";
            apiVersion = "";
        }

        $(btn).parent().parent().parent().find('.url_validate_label').remove();
        $(btn).addClass("loadingButton-small");
        $(btn).val(i18n.t('Validating..'));

        if (url == '') {
        	$(btn).parent().parent().after(' <span class="label label-danger url_validate_label"><i class="fw fw-warning icon-white" title="missing Url"></i> '+ i18n.t('Please provide a URL to test.')+'</span>');
            var toFade = $(btn).parent().parent().parent().find('.url_validate_label');
            $(btn).removeClass("loadingButton-small");
            $(btn).val(i18n.t('Test URI'));
            var foo = setTimeout(function(){$(toFade).hide()},3000);
            return;
        }
        if (!type) {
            type = "";
        }
        jagg.post("/site/blocks/item-add/ajax/add.jag", { action:"isURLValid", type:type, url:url, providerName:providerName, apiName:apiName, apiVersion:apiVersion },
                  function (result) {
                      if (!result.error) {
                          if (result.response.response == "success") {<commit_msg>Removing dynamic text content from API endpoint URL validation response<commit_after>$(document).ready(function(){
    $( document ).on( "click focused", "button.check_url_valid", function() {
        var btn = this;
        var url = $(this).parent().parent().find('input:first').val();
        var type = '';
        var attr = $(this).attr('url-type');
        var thisID = $(this).attr('id');
        var providerName = $(this).attr('providerName');
        var apiName = $(this).attr('apiName');
        var apiVersion = $(this).attr('apiVersion');
        if (attr) {
            type = $(btn).attr('url-type');
        } else {
            if (thisID == "prototype_test") {
                type = "http";
            }
            else {
            	if ($("#endpoint_config").val() && $("#endpoint_config").val() != "") {
            		type = $.parseJSON($("#endpoint_config").val())['endpoint_type'];
            	}                
            }
        }
        if (!providerName && !apiName && !apiVersion) {
            providerName = "";
            apiName = "";
            apiVersion = "";
        }

        $(btn).parent().parent().parent().find('.url_validate_label').remove();
        $(btn).addClass("loadingButton-small");
        $(btn).val(i18n.t('Validating..'));

        if (url == '') {
            $(btn).parent().parent().after(' <span class="label label-danger url_validate_label">' +
                '<i class="fw fw-cancel icon-white" title="invalid url"></i> ' +
                ' <span class ="url_validate_message"></span></span>');
            jQuery( '.url_validate_message' ).text( i18n.t('Invalid') + '. ' +  result.response.response);
            var toFade = $(btn).parent().parent().parent().find('.url_validate_label');
            $(btn).removeClass("loadingButton-small");
            $(btn).val(i18n.t('Test URI'));
            var foo = setTimeout(function(){$(toFade).hide()},3000);
            return;
        }
        if (!type) {
            type = "";
        }
        jagg.post("/site/blocks/item-add/ajax/add.jag", { action:"isURLValid", type:type, url:url, providerName:providerName, apiName:apiName, apiVersion:apiVersion },
                  function (result) {
                      if (!result.error) {
                          if (result.response.response == "success") {
{'fraction_non_alphanumeric': 0.19247143177235043, 'fraction_numerical': 0.004481290611696168, 'mean_word_length': 2.006060606060606, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '6547554', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1228, 'n_words': 214}