<commit_before>;(function(undefined) {
  'use strict';

  /**
   * artoo attributes jQuery plugin
   * ===============================
   *
   * Simplistic jQuery plugin designed to retrieve list of attributes for the
   * given elements.
   */

  function _classes($) {
    $.fn.classes = function() {
      var index = {},
          cls;

      $(this).each(function() {
        cls = $(this).attr('class');
        if (cls)
          cls.trim().split(' ').forEach(function(c) {
            index[c] = true;
          });
      });

      return Object.keys(index);
    };
  }

  // Exporting
  artoo.jquery.plugins.push(_classes);
}).call(this);
<commit_msg>Adding a $.attributes<commit_after>;(function(undefined) {
  'use strict';

  /**
   * artoo attributes jQuery plugin
   * ===============================
   *
   * Simplistic jQuery plugin designed to retrieve list of attributes for the
   * given elements.
   */

  function _classes($) {
    $.fn.classes = function() {
      var index = {},
          cls;

      $(this).each(function() {
        cls = $(this).attr('class');
        if (cls)
          cls.trim().split(' ').forEach(function(c) {
            index[c] = true;
          });
      });

      return Object.keys(index);
    };
  }

  function _attributes($) {
    $.fn.attributes = function(classes) {
      classes = classes === undefined ? true : false;

      var $e = $(this).first(),
          attrs = {},
          i,
          l,
          a,
          n,
          v;

      if (!$e[0])
        throw Error('jquery.attributes: trying to access attributes ' +
                    'of no element.');

      for (i = 0, l = $e[0].attributes.length; i < l; i++) {
        a = $e[0].attributes[i];
        n = a.name || a.nodeName;
        v = $e.attr(n);

        if (!classes && n === 'class')
          continue;

        if (v !== undefined && v !== false)
          attrs[n] = v;
      }

      return attrs;
    };
  }

  // Exporting
  artoo.jquery.plugins.push(_classes);
  artoo.jquery.plugins.push(_attributes);
}).call(this);

{'fraction_non_alphanumeric': 0.18994683421942968, 'fraction_numerical': 0.0019333011116481392, 'mean_word_length': 1.8630705394190872, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, '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': '1189355', 'n_tokens_mistral': 636, 'n_tokens_neox': 614, 'n_words': 143}