<commit_before>function getInput(){
  $.post(BASE_URL + "streams_core/public_ajax/field/socialist/get_field", {}, function(res) {
    // inject the new component
    $("#parameters").append(res);
  }).then(function() {
    // add the click event to the last item
    $('.socialist_button').last().click(socialistClick);
  });
}

function socialistClick(e) {
  e.stopPropagation();
  e.preventDefault();
  getInput();
  return false;
}

$(document).ready(function(){
  $('.socialist_button').unbind('click').click(socialistClick);
});<commit_msg>add more comments. remove inefficient code.<commit_after>function getInput(){
  // hide the last item
  $('.socialist_button').last().hide();
  $.post(BASE_URL + "streams_core/public_ajax/field/socialist/get_field", {}, function(res) {
    // inject the new component
    $("#parameters").append(res);
  }).then(function() {
    // add the click event to the new last item
    $('.socialist_button').last().show().click(socialistClick);
  });
}

function socialistClick(e) {
  e.stopPropagation();
  e.preventDefault();
  getInput();
  return false;
}

$(document).ready(function(){
  // hide all buttons but the last one
  $('.socialist_button').hide();
  $('.socialist_button').last().show().unbind('click').click(socialistClick);
});
{'fraction_non_alphanumeric': 0.19047619047619047, 'fraction_numerical': 0.0, 'mean_word_length': 4.573913043478261, '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': '3897768', 'n_tokens_mistral': 396, 'n_tokens_neox': 398, 'n_words': 77}