<commit_before>(function ($) {
  var _enableSortable = function() {
    var fieldset = $(this);
    var list = $("<ul></ul>");
    fieldset.find("input.ordering").hide();
    fieldset.children("div").each(function(i, item) {
      var li = $('<li class="sort_item"></li>');
      li.append(item);
      list.append(li);
    })
    fieldset.after(list);
    list.sortable({
      distance: 15,
      opacity: 0.5,
      update: function(event, ui) {
        list.children(".sort_item").each(function(index, li) {
          var input_id = $(li).find("label").attr("for");
          var input = $("#" + input_id)
          input.val(index);
        })
      },
      placeholder: "well sortable-drop-target",
      axis: "y"
    });
  }

  $.fn.extend({
    enableSortable: _enableSortable
  });
})(jQuery);

jQuery(function($) {
  $(".sortable").enableSortable();
})<commit_msg>Allow multiple sortables on the same page.<commit_after>(function ($) {
  var _enableSortable = function() {
    $(this).each(function() {
      var fieldset = $(this);
      var list = $("<ul></ul>");
      fieldset.find("input.ordering").hide();
      fieldset.children("div").each(function(i, item) {
        var li = $('<li class="sort_item"></li>');
        li.append(item);
        list.append(li);
      })
      fieldset.after(list);
      list.sortable({
        distance: 15,
        opacity: 0.5,
        update: function(event, ui) {
          list.children(".sort_item").each(function(index, li) {
            var input_id = $(li).find("label").attr("for");
            var input = $("#" + input_id)
            input.val(index);
          })
        },
        placeholder: "well sortable-drop-target",
        axis: "y"
      });
    })
  }

  $.fn.extend({
    enableSortable: _enableSortable
  });
})(jQuery);

jQuery(function($) {
  $(".sortable").enableSortable();
})
{'fraction_non_alphanumeric': 0.19817400644468314, 'fraction_numerical': 0.004296455424274973, 'mean_word_length': 2.412087912087912, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2636208', 'n_tokens_mistral': 605, 'n_tokens_neox': 592, 'n_words': 103}