<commit_before>/*!
    Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
    Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
    Created By: <EMAIL>
    Maintained By: <EMAIL>
*/


// Initialize delegated event handlers
jQuery(function($) {

  window.natural_comparator = function(a, b) {
    a = a.slug.toString();
    b = b.slug.toString();
    if(a===b) return 0;

    a = a.replace(/(?=\D\d)(.)|(?=\d\D)(.)/g, "$1$2|").split("|");
    b = b.replace(/(?=\D\d)(.)|(?=\d\D)(.)/g, "$1$2|").split("|");

    for(var i = 0; i < Math.max(a.length, b.length); i++) {
      if(+a[i] === +a[i] && +b[i] === +b[i]) {
        if(+a[i] < +b[i]) return -1;
        if(+b[i] < +a[i]) return 1;
      } else {
        if(a[i] < b[i]) return -1;
        if(b[i] < a[i]) return 1;
      }
    }
    return 0;
  };

  // On-demand creation of datepicker() objects
  $('body').on('focus', '[data-toggle="datepicker"]', function(e) {
    var $this = $(this);

    if (!$this.data('datepicker'))
      $(this).datepicker({changeMonth: true, changeYear: true, dateFormat: 'mm/dd/yy'});
  });

  // On-demand creation of datepicker() objects, initial date today or later
  $('body').on('focus', '[data-toggle="datepicker_today_or_later"]', function(e) {
    var $this = $(this),
        today = new Date(),
        start_date = (today.getMonth()+1) + '/' + today.getDate() + '/' + today.getFullYear();

    if (!$this.data('datepicker')) {
      $(this).datepicker({changeMonth: true, changeYear: true, dateFormat: 'mm/dd/yy'}).datepicker('option', 'minDate', start_date);;
    }
  });

  // Turn the arrow when tree node content is shown
  $('body').on('click', '[data-toggle="collapse"]', function(e) {
    var $this = $(this)
      , $expander_container = $this.closest(':has(.expander, .enddot)')
      , $expander = $expander_container.find('.expander').eq(0)
      , $target = $($this.data('target'))
      ;

    setTimeout(function() {
      if ($target.hasClass('in'))
        $expander.addClass('in');
      else
        $expander.removeClass('in');
    }, 100);<commit_msg>Corrected code formatting, CORE-1426<commit_after>/*!
    Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
    Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
    Created By: <EMAIL>
    Maintained By: <EMAIL>
*/


// Initialize delegated event handlers
jQuery(function($) {

  window.natural_comparator = function(a, b) {
    a = a.slug.toString();
    b = b.slug.toString();
    if(a===b) return 0;

    a = a.replace(/(?=\D\d)(.)|(?=\d\D)(.)/g, "$1$2|").split("|");
    b = b.replace(/(?=\D\d)(.)|(?=\d\D)(.)/g, "$1$2|").split("|");

    for(var i = 0; i < Math.max(a.length, b.length); i++) {
      if(+a[i] === +a[i] && +b[i] === +b[i]) {
        if(+a[i] < +b[i]) return -1;
        if(+b[i] < +a[i]) return 1;
      } else {
        if(a[i] < b[i]) return -1;
        if(b[i] < a[i]) return 1;
      }
    }
    return 0;
  };

  // On-demand creation of datepicker() objects
  $('body').on('focus', '[data-toggle="datepicker"]', function(e) {
    var $this = $(this);

    if (!$this.data('datepicker'))
      $(this).datepicker({changeMonth: true, changeYear: true, dateFormat: 'mm/dd/yy'});
  });

  // On-demand creation of datepicker() objects, initial date today or later
  $('body').on('focus', '[data-toggle="datepicker_today_or_later"]', function(e) {
    var $this = $(this),
        today = new Date(),
        start_date = (today.getMonth()+1) + '/' + today.getDate() + '/' + today.getFullYear();

    if (!$this.data('datepicker')) {
      $(this)
        .datepicker({changeMonth: true,
                    changeYear: true,
                    dateFormat: 'mm/dd/yy'
        }).datepicker('option', 'minDate', start_date);
    }
  });

  // Turn the arrow when tree node content is shown
  $('body').on('click', '[data-toggle="collapse"]', function(e) {
    var $this = $(this)
      , $expander_container = $this.closest(':has(.expander, .enddot)')
      , $expander = $expander_container.find('.expander').eq(0)
      , $target = $($this.data('target'))
      ;

    setTimeout(function() {
      if ($target.hasClass('in'))
        $expander.addClass('in');
      else
        $expander.removeClass('in');
    }, 100);
{'fraction_non_alphanumeric': 0.22662037037037036, 'fraction_numerical': 0.011111111111111112, 'mean_word_length': 2.834072759538598, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1775224', 'n_tokens_mistral': 1598, 'n_tokens_neox': 1525, 'n_words': 316}