<commit_before>// These methods are just jQuery extensions to ease the
// DOM manipulation and make the code a bit more DRY.

/**
 * Function that iterates over each field of a form element
 * and that returns a hash based on the fields' value.
 * For instance:
 *
 *    form.extractFields();
 *    // => {title: 'Oshan - French Vanilla'}
 *
 * @return {Object}
 */
$.fn.extractFields = function() {
  var hash = {};

  this.find('input').each(function() {
    var self = $(this);

    if (self.attr('type') == 'submit' ||
       (self.attr('type') == 'radio'  && !self.is(':checked')))
      return;

    hash[self.attr('name')] = self.val();
  });

  return hash;
};

/**
 * Function that changes the different DOM attributes to
 * reflect a modification of an element's artist.
 *
 * @param  {String}  value - The artist's name.
 * @param  {Boolean} link  - Whether to create a link or not.
 * @return {jQuery}
 */
$.fn.artist = function(value, link) {
  var artist = this.find('.artist');

  if (link)
    artist.html(Html.tag('a', {
      href: `local/artist`,
      'data-id': value
    }, value));
  else
    artist.html(value);

  artist.attr('title', value);
  artist.data('id', value);

  return this;
}

/**
 * Function that changes the different DOM attributes to
 * reflect a modification of an element's title.
 *
 * @param  {String} value - The new title.
 * @return {jQuery}
 */
$.fn.title = function(value) {
  var title = this.find('.title');

  title.html(value);
  title.attr('title', value);

  return this;
}

/**
 * Function that slides out a notification and remove it from
 * the DOM.
 *
 * @return {null}
 */
$.fn.slideOut = function() {
  var self = this;

  self.find('.box').animate({
    right: '-300px',
    opacity: 0
  }, 500, function() {
    self.remove();
  });
}

/**
 * Function that animates an element's height
 * randomly picking a value from the frequency
 * data extracted.
 *
 * @return {null}
 */
$.fn.animateHeight = function() {
  var sample = Math.max(Player.sample(), 0.1);

  this.animate({
    height: sample * 100 + "%"
  }, 250, () => {
    this.animateHeight();
  });
}<commit_msg>Remove some dead code<commit_after>// These methods are just jQuery extensions to ease the
// DOM manipulation and make the code a bit more DRY.

/**
 * Function that iterates over each field of a form element
 * and that returns a hash based on the fields' value.
 * For instance:
 *
 *    form.extractFields();
 *    // => {title: 'Oshan - French Vanilla'}
 *
 * @return {Object}
 */
$.fn.extractFields = function() {
  var hash = {};

  this.find('input').each(function() {
    var self = $(this);

    if (self.attr('type') == 'submit' ||
       (self.attr('type') == 'radio'  && !self.is(':checked')))
      return;

    hash[self.attr('name')] = self.val();
  });

  return hash;
};

/**
 * Function that changes the different DOM attributes to
 * reflect a modification of an element's artist.
 *
 * @param  {String}  value - The artist's name.
 * @param  {Boolean} link  - Whether to create a link or not.
 * @return {jQuery}
 */
$.fn.artist = function(value, link) {
  var artist = this.find('.artist');

  if (link)
    artist.html(Html.tag('a', {
      href: `local/artist`,
      'data-id': value
    }, value));
  else
    artist.html(value);

  artist.attr('title', value);
  artist.data('id', value);

  return this;
}

/**
 * Function that changes the different DOM attributes to
 * reflect a modification of an element's title.
 *
 * @param  {String} value - The new title.
 * @return {jQuery}
 */
$.fn.title = function(value) {
  var title = this.find('.title');

  title.html(value);
  title.attr('title', value);

  return this;
}

/**
 * Function that slides out a notification and remove it from
 * the DOM.
 *
 * @return {null}
 */
$.fn.slideOut = function() {
  var self = this;

  self.find('.box').animate({
    right: '-300px',
    opacity: 0
  }, 500, function() {
    self.remove();
  });
}
{'fraction_non_alphanumeric': 0.16868993424380374, 'fraction_numerical': 0.00556398583712696, 'mean_word_length': 2.9314115308151094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '6671887', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1257, 'n_words': 398}