<commit_before>(function($) {


  // Public members
  var plugin = {


    // Plugin namespace
    namespace: 'numberSpinner',


    /**
     * Initialise
     * @param options - initialisation options
     */
    initialise: function(options) {

      // Initialise options
      options = $.extend(true, {}, _defaults, options);

      // Initialise elements
      return this.each(function() {
        var $this = $(this);

        // Check for plugin data, cancel if initialised
        if ($this.data(plugin.namespace)) return true;

        // Initialise data
        var instanceOptions = $.extend(true, {}, options),
        data = {
          options: instanceOptions,
          elements: {}
        };
        $this.data(plugin.namespace, data);

        // Get properties
        var min_digits = $this.data('min-digits');
        if (min_digits !== undefined) data.options.min_digits = min_digits;

        // Initialise elements
        _private.initialiseElements.call($this);

      });

    },


    /**
     * Destroy
     */
    destroy: function() {
      return this.each(function() {
        var $this = $(this),
        data = $this.data(plugin.namespace);

        // Check for plugin data, cancel if uninitialised
        if (!data) return true;

        // Remove elements and data
        _private.removeElements.call($this),
        $this.removeData(plugin.namespace);

      });
    },


    /**
     * Set number
     * @param number - number to set spinner to
     * @param animate - animate spinner, default: true
     */
    set: function(number, animate) {
      return this.each(function() {
        var $this = $(this),
        data = $this.data(plugin.namespace);

        // Render number
        _private.renderNumber.call($this, number, (animate !== false));

      });
    }


  },


  // Private members
  _private = {


    /**
     * Initialise elements
     */
    initialiseElements: function() {
      return this.each(function() {
        var $this = $(this),
        data = $this.data(plugin.namespace);

        // Get initial value
        var val = parseInt($this.text());

        // Create and add tile wrapper
        data.elements.tile_wrapper = $('<span />', {'class': data.options.tile_wrapper_class}),
        $this.empty().append(data.elements.tile_wrapper);

        // Set initial value
        if (!isNaN(val)) plugin.set.call($this, val, false);

      });
    },


    /**
     * Remove elements
     */
    removeElements: function() {
      return this.each(function() {
        var $this = $(this),
        data = $this.data(plugin.namespace);

        // Remove tile wrapper
        data.elements.tile_wrapper.remove();

      });
    },


    /**<commit_msg>store / retrieve spinner value & options<commit_after>(function($) {


  // Public members
  var plugin = {


    // Plugin namespace
    namespace: 'numberSpinner',


    /**
     * Initialise
     * @param options - initialisation options
     */
    initialise: function(options) {

      // Initialise options
      options = $.extend(true, {}, _defaults, options);

      // Initialise elements
      return this.each(function() {
        var $this = $(this);

        // Check for plugin data, cancel if initialised
        if ($this.data(plugin.namespace)) return true;

        // Initialise data
        var instanceOptions = $.extend(true, {}, options),
        data = {
          options: instanceOptions,
          elements: {}
        };
        $this.data(plugin.namespace, data);

        // Get properties
        var min_digits = $this.data('min-digits');
        if (min_digits !== undefined) data.options.min_digits = min_digits;

        // Initialise elements
        _private.initialiseElements.call($this);

      });

    },


    /**
     * Destroy
     */
    destroy: function() {
      return this.each(function() {
        var $this = $(this),
        data = $this.data(plugin.namespace);

        // Check for plugin data, cancel if uninitialised
        if (!data) return true;

        // Remove elements and data
        _private.removeElements.call($this),
        $this.removeData(plugin.namespace);

      });
    },


    /**
     * Set number
     * @param number - number to set spinner to
     * @param animate - animate spinner, default: true
     */
    set: function(number, animate) {
      return this.each(function() {
        var $this = $(this),
        data = $this.data(plugin.namespace);

        // Render number
        _private.renderNumber.call($this, number, (animate !== false));

        $this.data('val', number);
      });
    },

    get: function() {
      return this.data('val');
    },

    options: function() {
      return this.data(plugin.namespace).options;
    }


  },


  // Private members
  _private = {


    /**
     * Initialise elements
     */
    initialiseElements: function() {
      return this.each(function() {
        var $this = $(this),
        data = $this.data(plugin.namespace);

        // Get initial value
        var val = 0;
        try {
          val = parseInt($this.text());
        } catch (e) {}

        $this.data('val', val);

        // Create and add tile wrapper
        data.elements.tile_wrapper = $('<span />', {'class': data.options.tile_wrapper_class}),
        $this.empty().append(data.elements.tile_wrapper);

        // Set initial value
        if (!isNaN(val)) plugin.set.call($this, val, false);

      });
    },


    /**
     * Remove elements
     */
    removeElements: function() {
      return this.each(function() {
        var $this = $(this),
        data = $this.data(plugin.namespace);

        // Remove tile wrapper
        data.elements.tile_wrapper.remove();

      });
    },


    /**
{'fraction_non_alphanumeric': 0.14052173913043478, 'fraction_numerical': 0.00017391304347826088, 'mean_word_length': 1.901614530776993, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1882201', 'n_tokens_mistral': 1652, 'n_tokens_neox': 1563, 'n_words': 373}