<commit_before>(function ($) {

  var container = '<div class="btn-group selectable-button"/>';

  var template = '<a class="btn dropdown-toggle" data-toggle="dropdown" href="javascript:void(0);">' +
                 '  <span class="title"></span>' +
                 '  <span class="caret"></span>' +
                 '</a>' +
                 '<ul class="dropdown-menu">' +
                 '</ul>';

  var itemTemplate = function (title, value) {
    return '<li>' +
           '  <a href="javascript:void(0)" data-value="'+value+'">'+title+'</a>' +
           '</li>';
  };

  function onSelectChange (btnEl, selectEl, btnEvt, selectEvt) {
    return function () {
      if ($(this).data('ignorechange')) return;
      if (!btnEvt && !selectEvt) return;
      var selectedOption = $('option:selected', this);
      $('.title', btnEl).html(selectedOption.html());
      $('.title', btnEl).data('value', selectedOption.val());
      populateButtonMenu(btnEl, selectEl);
      var val = $('option:selected', this).val();
      var anchor = $('.dropdown-menu a', btnEl).filter(function () {
        return $(this).data('value') === val;
      });
      onButtonChange(btnEl, selectEl, false, selectEvt).apply(anchor);
    };
  }        

  function onButtonChange (btnEl, selectEl, btnEvt, selectEvt) {
    return function () {
      if (!btnEvt && !selectEvt) return;
      selectEl.val($(this).data('value'));<commit_msg>allow for preset value on selectable button<commit_after>(function ($) {

  var container = '<div class="btn-group selectable-button"/>';

  var template = '<a class="btn dropdown-toggle" data-toggle="dropdown" href="javascript:void(0);">' +
                 '  <span class="title"></span>' +
                 '  <span class="caret"></span>' +
                 '</a>' +
                 '<ul class="dropdown-menu">' +
                 '</ul>';

  var itemTemplate = function (title, value) {
    return '<li>' +
           '  <a href="javascript:void(0)" data-value="'+value+'">'+title+'</a>' +
           '</li>';
  };

  function onSelectChange (btnEl, selectEl, btnEvt, selectEvt) {
    return function () {
      if ($(this).data('ignorechange')) return;
      if (!btnEvt && !selectEvt) return;
      var selectedOption = $('option:selected', this);
      $('.title', btnEl).html(selectedOption.html());
      $('.title', btnEl).data('value', selectedOption.val());
      populateButtonMenu(btnEl, selectEl);
      var val = $('option:selected', this).val();
      var anchor = $('.dropdown-menu a', btnEl).filter(function () {
        return $(this).data('value') === val;
      });
      onButtonChange(btnEl, selectEl, false, selectEvt).apply(anchor);
    };
  }        

  function onButtonChange (btnEl, selectEl, btnEvt, selectEvt) {
    return function () {
      if (!btnEvt && !selectEvt) return;
      if ($(this).data("value")) selectEl.val($(this).data('value'));
{'fraction_non_alphanumeric': 0.19634860489149156, 'fraction_numerical': 0.0013778849466069584, 'mean_word_length': 2.761658031088083, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '5246369', 'n_tokens_mistral': 876, 'n_tokens_neox': 864, 'n_words': 181}