<commit_before>$(document).on("click", "button", postData);
$(document).on("keypress", function(e) {
  if (e.keyCode === 13) {
    postData();
  }
});

function postData(e) {
  var data = {
    peptide_sequence: $("input[name=peptide_sequence]").val(),
    weight: parseFloat($("input[name=weight]").val())
  };

  params = {
    type: 'POST',
    data: data,
    dataType: 'text',
    url: '/possible-matches',
    success: function(data) {
      data = JSON.parse(data)
      seq_objs = data['possible_sequences'];

      $(".peptide-weight").append("<p>Peptide weight is "+data['weight']+"</p>");
      if (typeof seq_objs === "string") {
        $(".result table").append("<tr><td>"+seq_objs+"</td></tr>")
        return
      }

      var sequences = Object.keys(seq_objs);
      for (var i = 0; i < sequences.length; i++) {<commit_msg>clear weight on each request<commit_after>$(document).on("click", "button", postData);
$(document).on("keypress", function(e) {
  if (e.keyCode === 13) {
    postData();
  }
});

function postData(e) {
  var data = {
    peptide_sequence: $("input[name=peptide_sequence]").val(),
    weight: parseFloat($("input[name=weight]").val())
  };

  params = {
    type: 'POST',
    data: data,
    dataType: 'text',
    url: '/possible-matches',
    success: function(data) {
      data = JSON.parse(data)
      seq_objs = data['possible_sequences'];

      $(".peptide-weight").empty().append("<p>Peptide weight is "+data['weight']+"</p>");
      if (typeof seq_objs === "string") {
        $(".result table").append("<tr><td>"+seq_objs+"</td></tr>")
        return
      }

      var sequences = Object.keys(seq_objs);
      for (var i = 0; i < sequences.length; i++) {
{'fraction_non_alphanumeric': 0.21524926686217008, 'fraction_numerical': 0.0035190615835777126, 'mean_word_length': 3.308080808080808, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '6018019', 'n_tokens_mistral': 595, 'n_tokens_neox': 568, 'n_words': 110}