<commit_before>(function() {

  function OpusFlux(el, options) {

    // INSTANTIATION
    // Allow developer to omit new when instantiating
    if (!(this instanceof OpusFlux)) {
      if (el.length) {
        Array.prototype.forEach.call(el, function(n) {
          return new OpusFlux(el, options);
        });
      } else {
        return new OpusFlux(el, options);
      }
    }

    if (this === window) {
      return;
    }

    // OPTIONS
    var defaults = {
      nextButton: $(),
      previousButton: $()
    };

    var userOptions = options || {};

    this.options    = {};

    for (var x in defaults) {
      this.options[x] = userOptions[x] || defaults[x];
    }

    // PRIVATE VARIABLES
    // Main element always a jQuery object
    this.el = (el instanceof jQuery) ? el : $(el);

    // RUN
    this.init();

  };

  OpusFlux.prototype.init = function() {

    var el   = this.el;

    var els = {
      pagesLeft: $('.OpusFlux-Page:nth-child(2n)', el),
      pagesRight: $('.OpusFlux-Page:nth-child(2n+1)', el)
    };

    els.previousTrigger = els.pagesLeft.add(this.options.previousButton);
    els.nextTrigger = els.pagesRight.add(this.options.nextButton);

    els.previousTrigger.on('click', function() {
      this.turnPage('back');
    }.bind(this));

    els.nextTrigger.on('click', function() {
      this.turnPage('forwards');
    }.bind(this));

  };

  OpusFlux.prototype.turnPage = function(direction) {

    var el = this.el;
    var els = {};

    if(($('.OpusFlux-Page').last().hasClass('is-active') && direction == 'forwards')
      || ($('.OpusFlux-Page').first().hasClass('is-active') && direction == 'back')) {
      return
    }
<commit_msg>Limit number of pages turns at one time to 2<commit_after>(function() {

  function OpusFlux(el, options) {

    // INSTANTIATION
    // Allow developer to omit new when instantiating
    if (!(this instanceof OpusFlux)) {
      if (el.length) {
        Array.prototype.forEach.call(el, function(n) {
          return new OpusFlux(el, options);
        });
      } else {
        return new OpusFlux(el, options);
      }
    }

    if (this === window) {
      return;
    }

    // OPTIONS
    var defaults = {
      nextButton: $(),
      previousButton: $()
    };

    var userOptions = options || {};

    this.options    = {};

    for (var x in defaults) {
      this.options[x] = userOptions[x] || defaults[x];
    }

    // PRIVATE VARIABLES
    // Main element always a jQuery object
    this.el = (el instanceof jQuery) ? el : $(el);

    // RUN
    this.init();

  };

  OpusFlux.prototype.init = function() {

    var el   = this.el;

    var els = {
      pagesLeft: $('.OpusFlux-Page:nth-child(2n)', el),
      pagesRight: $('.OpusFlux-Page:nth-child(2n+1)', el)
    };

    els.previousTrigger = els.pagesLeft.add(this.options.previousButton);
    els.nextTrigger = els.pagesRight.add(this.options.nextButton);

    els.previousTrigger.on('click', function() {
      this.turnPage('back');
    }.bind(this));

    els.nextTrigger.on('click', function() {
      this.turnPage('forwards');
    }.bind(this));

  };

  OpusFlux.prototype.turnPage = function(direction) {

    var el = this.el;
    var els = {};

    if(($('.OpusFlux-Page').last().hasClass('is-active') && direction == 'forwards')
      || ($('.OpusFlux-Page').first().hasClass('is-active') && direction == 'back')
      || $('.OpusFlux-Page.is-animating').length > 3) {
      return
    }

{'fraction_non_alphanumeric': 0.17090803932909196, 'fraction_numerical': 0.002313475997686524, 'mean_word_length': 2.4011799410029497, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2723472', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1127, 'n_words': 221}