<commit_before>jQuery(document).ready(function($) {
  return function($) {
    function handleSuccess(json, statusText) {
      $('#spinner').hide();
      var base_url;

      if (!(json.error === undefined)) {
        $('#validation_result').html('').hide();
        $('#error').html(json.error).show();
      } else if (json.still_processing === 'yes') {
        if (!(json.base_url === undefined)){
          base_url = json.base_url;
        }
        var keep_checking = function(){
          var url = base_url + '/admin_data/diagnostic/validate_model?still_processing=yes';
          url = url + '&tid=' + $('#tid').text();
          var fn = function(json){
            if (json.still_processing === 'no'){
              clearInterval(refreshID);
              $('#submit').attr('value','Start validation');
              $('#validation_result').html('').hide();
              $('#validation_result').html('Validation result').show();
              $('#validate_model_rhs_data').html(json.data);
            } else {
              var processed_info = json.currently_processing_klass;
              var s = processed_info + ' ... ';
              $('#validation_result').html(s);
              $('#validate_model_rhs_data').html(json.data);
            }
          };


          $.getJSON(url,fn);
        };
        var refreshID = setInterval(keep_checking,4000);
      } else {
        $('#validation_result').html('Validation result').show();
        $('#validate_model_rhs_data').html(json.data);
      }
    }

    function preSubmit(formData, jqForm, options) {
      $('html,body').animate( { scrollTop: 0 }, 0 );
      $('#validate_model_rhs_data').html('');
      $('#validation_result').html('Processing .... This page will refersh itself periodically.').show();
      $('#error').hide();
      $('#spinner').show();
      $('#submit').attr('value','processing ...');
      return true;
    }

    var options = {
      beforeSubmit: preSubmit,
      success: handleSuccess,
      dataType: 'json'
    };

    $('#validate_model_form').ajaxForm(options);

  };
} (jQuery));
<commit_msg>restore submit name after submit validation error<commit_after>jQuery(document).ready(function($) {
  return function($) {
    function handleSuccess(json, statusText) {
      $('#spinner').hide();
      var base_url;

      if (!(json.error === undefined)) {
        $('#submit').attr('value','Start validation');
        $('#validation_result').html('').hide();
        $('#error').html(json.error).show();
      } else if (json.still_processing === 'yes') {
        if (!(json.base_url === undefined)){
          base_url = json.base_url;
        }
        var keep_checking = function(){
          var url = base_url + '/admin_data/diagnostic/validate_model?still_processing=yes';
          url = url + '&tid=' + $('#tid').text();
          var fn = function(json){
            if (json.still_processing === 'no'){
              clearInterval(refreshID);
              $('#submit').attr('value','Start validation');
              $('#validation_result').html('').hide();
              $('#validation_result').html('Validation result').show();
              $('#validate_model_rhs_data').html(json.data);
            } else {
              var processed_info = json.currently_processing_klass;
              var s = processed_info + ' ... ';
              $('#validation_result').html(s);
              $('#validate_model_rhs_data').html(json.data);
            }
          };


          $.getJSON(url,fn);
        };
        var refreshID = setInterval(keep_checking,4000);
      } else {
        $('#validation_result').html('Validation result').show();
        $('#validate_model_rhs_data').html(json.data);
      }
    }

    function preSubmit(formData, jqForm, options) {
      $('html,body').animate( { scrollTop: 0 }, 0 );
      $('#validate_model_rhs_data').html('');
      $('#validation_result').html('Processing .... This page will refersh itself periodically.').show();
      $('#error').hide();
      $('#spinner').show();
      $('#submit').attr('value','processing ...');
      return true;
    }

    var options = {
      beforeSubmit: preSubmit,
      success: handleSuccess,
      dataType: 'json'
    };

    $('#validate_model_form').ajaxForm(options);

  };
} (jQuery));

{'fraction_non_alphanumeric': 0.18699186991869918, 'fraction_numerical': 0.0027874564459930314, 'mean_word_length': 2.4120443740095086, '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': '2255523', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1195, 'n_words': 198}