<commit_before> /*!
  * jQuery Custom Radio Checkbox Plugin
  * Copyright (c) 2012 <NAME> (@tdecs)
  * Released under MIT license (https://raw.github.com/dciccale/Custom-radio-checkbox/master/LICENSE.txt)
  */
(function ($) {
  $.fn.customRadioCheckbox = function (options) {
    // don't act on absent elements, can't chain anyway
    if (!this[0]) {
      return;
    }

      // checked suffix
    var checkedSuffix = '-checked',

      // css class used to hide inputs
      hiddenInputClass = 'rc-hidden',

      // function to force the input change when clicking
      // on a fake input that is not wrapped by a label tag
      forceChange = function () {
        var $this = $(this);
        // only trigger if the input is not inside a label
        if (!$this.closest('label')[0]) {
          $this.prev().trigger('change.crc', [true]);
        }
      },

      // function that inserts the fake input
      insertFakeInput = function (inputs) {
        var type = inputs.type,
          l = inputs.length,
          fakeInputElem, input;

        while (l--) {
          input = inputs[l];

          // fake input
          fakeInputElem = $('<i>', { 'class': type }).bind('click.crc', forceChange);

          // if is already checked add checked class
          if (input.checked) {
            fakeInputElem.addClass(type + checkedSuffix);
          }

          // insert the fake input after the input
          input.parentNode.insertBefore(fakeInputElem[0], input.nextSibling);
        }
      };

    return this.each(function () {

      var $context = $(this),
        // find & hide radios
        rds = $context.find('input[type=radio]:not(.' + hiddenInputClass + ')').addClass(hiddenInputClass),
        // find & hide checkboxes
        chs = $context.find('input[type=checkbox]:not(.' + hiddenInputClass + ')').addClass(hiddenInputClass),
        // store each radio group to access later
        rdsCache = {};

      // only apply if there are radios
      if (rds.length) {
        rds.type = 'radio';

        // insert each fake radio
        insertFakeInput(rds);
        
        //initialize rdsCache for prechecked inputs
        rds.each(function(i,e){
         if(e.checked){
          rdsCache[e.name] = {};
          rdsCache[e.name].checked = $(e.nextSibling).addClass(rds.type + checkedSuffix);
         }
        });
        
        // bind radio change event
        rds.bind('change.crc', function (e, force) {
          // uncheck previous and remove checked class
          if (!force || !this.checked) {<commit_msg>almost jslnit free except for the --, treat the fakeInput in one line<commit_after>/*!
 * jQuery Custom Radio Checkbox Plugin
 * Copyright (c) 2012 <NAME> (@tdecs)
 * Released under MIT license (https://raw.github.com/dciccale/Custom-radio-checkbox/master/LICENSE.txt)
 */
(function ($) {
  $.fn.customRadioCheckbox = function (options) {
    // don't act on absent elements, can't chain anyway
    if (!this[0]) {
      return;
    }

    // checked suffix
    var checkedSuffix = '-checked',

      // css class used to hide inputs
      hiddenInputClass = 'rc-hidden',

      // function to force the input change when clicking
      // on a fake input that is not wrapped by a label tag
      forceChange = function () {
        var $this = $(this);
        // only trigger if the input is not inside a label
        if (!$this.closest('label')[0]) {
          $this.prev().trigger('change.crc', [true]);
        }
      },

      // function that inserts the fake input
      insertFakeInput = function (inputs) {
        var type = inputs.type,
          l = inputs.length,
          fakeInputElem,
          input;

        while (l--) {
          input = inputs[l];

          // fake input
          fakeInputElem = $('<i>').addClass(type + (input.checked ? ' ' + type + checkedSuffix : '')).bind('click.crc', forceChange);

          // insert the fake input after the input
          input.parentNode.insertBefore(fakeInputElem[0], input.nextSibling);
        }
      };

    return this.each(function () {

      var $context = $(this),
        // find & hide radios
        rds = $context.find('input[type=radio]:not(.' + hiddenInputClass + ')').addClass(hiddenInputClass),
        // find & hide checkboxes
        chs = $context.find('input[type=checkbox]:not(.' + hiddenInputClass + ')').addClass(hiddenInputClass),
        // storage for each radio group to use later
        rdsCache = {};

      // only apply if there are radios
      if (rds.length) {
        rds.type = 'radio';

        // insert each fake radio
        insertFakeInput(rds);

        // initialize rdsCache for prechecked inputs
        rds.each(function () {
          if (this.checked) {
            rdsCache[this.name] = {};
            rdsCache[this.name].checked = $(this.nextSibling).addClass(rds.type + checkedSuffix);
          }
        });

        // bind radio change event
        rds.bind('change.crc', function (e, force) {
          // uncheck previous and remove checked class
          if (!force || !this.checked) {
{'fraction_non_alphanumeric': 0.13022981732469063, 'fraction_numerical': 0.0027499508937340405, 'mean_word_length': 2.050928699820252, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '2251012', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1409, 'n_words': 405}