<commit_before>'use strict';

(function () {

  function setupRequestAnimationFrame () {
    var lastTime = 0;
    var vendors = ['webkit', 'moz', 'ms', 'o'];

    for (var i = 0; !window.requestAnimationFrame && i < vendors.length; i += 1) {
      var vendor = vendors[i];
      window.requestAnimationFrame = window[vendor + 'RequestAnimationFrame'];
      window.cancelAnimationFrame = window[vendor + 'CancelAnimationFrame'] ||
        window[vendor + 'CancelRequestAnimationFrame'];
    }

    if (!window.requestAnimationFrame) {
      window.requestAnimationFrame = function (callback) {
        var now = new Date().getTime();
        var nextTime = Math.max(0, 16 - (now - lastTime));

        var id = window.setTimeout(function () {
          callback(now + nextTime);
        }, nextTime);

        lastTime = now + nextTime;
        return id;
      };
    }

    if (!window.cancelAnimationFrame) {
      window.cancelAnimationFrame = function (id) {
        clearTimeout(id);
      };
    }
  }

  setupRequestAnimationFrame();

  function setupPerformanceNow () {
    if (!('performance' in window)) {
      window.performance = {};
    }

    if (!('now' in window.performance)) {
      var dateNow = Date.now || function () {
        return new Date().getTime();
      };

      var nowOffset = dateNow();

      if (performance.timing && performance.timing.navigationStart) {
        nowOffset = performance.timing.navigationStart;
      }

      window.performance.now = function now () {
        return dateNow() - nowOffset;
      };
    }
  }

  setupPerformanceNow();

  function getSlik (Immutable) {

    function multiply (fromValue, toValue, multiplier) {
      // NOTE: Below line removed to allow spring / bounce easing
      // multiplier = Math.min(Math.max(multiplier, 0), 1);
      return fromValue * multiplier + toValue * (1 - multiplier);
    }

    function Linear (fromValue, toValue, progress) {
      var multiplier = progress;
      return multiply(fromValue, toValue, multiplier);
    }

    function Ease (fromValue, toValue, progress) {
      var multiplier = (1 - Math.cos(progress * Math.PI)) / 2;
      return multiply(fromValue, toValue, multiplier);
    }

    function EaseIn (fromValue, toValue, progress) {
      var multiplier = (1 - Math.cos(progress * Math.PI / 2));
      return multiply(fromValue, toValue, multiplier);
    }

    function EaseOut (fromValue, toValue, progress) {
      var multiplier = Math.cos((1 - progress) * Math.PI / 2);
      return multiply(fromValue, toValue, multiplier);
    }

    function Animation (initial) {
      var self = this;

      var raf, startTime, pausedAfter;
      var fromValues = Immutable.fromJS(initial);
      var currentValues = fromValues;
      var toValues = Immutable.Map();
      var durationMillis = 500;
      var frameRate = 1000 / 30;
      var easing = Linear;
      var shouldLoop = false;

      var events = {
        all: [],
        start: [],
        stop: [],
        pause: [],
        end: [],
        update: [],
        loop: []
      };

      function easeValues () {
        cancelAnimationFrame(raf);

        var now = performance.now();
        var progress = (now - startTime) / durationMillis;

        function mapValues (value, key) {
          if (Immutable.Iterable.isIterable(value)) {
            return value.map(mapValues);
          }

          return easing(value, toValues.get(key), progress);
        }

        currentValues = currentValues.map(mapValues);

        raf = requestAnimationFrame(easeValues);
      }

      // Set the frameRate
      function fps (input) {
        frameRate = 1000 / input;
        return self;
      }

      // Set from values
      function from (input) {
        fromValues = Immutable.fromJS(input);
        return self;
      }

      // Set to values
      function to (input) {
        toValues = Immutable.fromJS(input);
        return self;
      }

      // Set animation duration
      function duration (input) {
        durationMillis = input;
        return self;
      }

      // Set easing
      function ease (input) {
        if (typeof input !== 'function') {
          throw new Error('Ease must be a function, instead got: ' + (typeof input));
        }

        easing = input;
        return self;
      }

      // Set whether the animation should loop
      function loop (input) {
        shouldLoop = input;
        return self;
      }

      // Invert animation values
      function invert () {
        return self;
      }

      // Play animation in reverse
      function reverse () {
        var temp = fromValues;
        fromValues = toValues;
        toValues = temp;
        return self;
      }

      // Start or resume animation
      function start () {
        cancelAnimationFrame(raf);

        if (typeof pausedAfter !== 'undefined') {
          startTime = performance.now() - pausedAfter;
        } else {
          startTime = performance.now();
        }

        pausedAfter = undefined;

        raf = requestAnimationFrame(easeValues);

        return self;
      }

      // Stop animation and resume from beginning
      function stop () {
        cancelAnimationFrame(raf);
        pausedAfter = undefined;
        startTime = undefined;
        return self;<commit_msg>Limit frame rate<commit_after>'use strict';

(function () {

  function setupRequestAnimationFrame () {
    var lastTime = 0;
    var vendors = ['webkit', 'moz', 'ms', 'o'];

    for (var i = 0; !window.requestAnimationFrame && i < vendors.length; i += 1) {
      var vendor = vendors[i];
      window.requestAnimationFrame = window[vendor + 'RequestAnimationFrame'];
      window.cancelAnimationFrame = window[vendor + 'CancelAnimationFrame'] ||
        window[vendor + 'CancelRequestAnimationFrame'];
    }

    if (!window.requestAnimationFrame) {
      window.requestAnimationFrame = function (callback) {
        var now = new Date().getTime();
        var nextTime = Math.max(0, 16 - (now - lastTime));

        var id = window.setTimeout(function () {
          callback(now + nextTime);
        }, nextTime);

        lastTime = now + nextTime;
        return id;
      };
    }

    if (!window.cancelAnimationFrame) {
      window.cancelAnimationFrame = function (id) {
        clearTimeout(id);
      };
    }
  }

  setupRequestAnimationFrame();

  function setupPerformanceNow () {
    if (!('performance' in window)) {
      window.performance = {};
    }

    if (!('now' in window.performance)) {
      var dateNow = Date.now || function () {
        return new Date().getTime();
      };

      var nowOffset = dateNow();

      if (performance.timing && performance.timing.navigationStart) {
        nowOffset = performance.timing.navigationStart;
      }

      window.performance.now = function now () {
        return dateNow() - nowOffset;
      };
    }
  }

  setupPerformanceNow();

  function getSlik (Immutable) {

    function multiply (fromValue, toValue, multiplier) {
      // NOTE: Below line removed to allow spring / bounce easing
      // multiplier = Math.min(Math.max(multiplier, 0), 1);
      return fromValue * multiplier + toValue * (1 - multiplier);
    }

    function Linear (fromValue, toValue, progress) {
      var multiplier = progress;
      return multiply(fromValue, toValue, multiplier);
    }

    function Ease (fromValue, toValue, progress) {
      var multiplier = (1 - Math.cos(progress * Math.PI)) / 2;
      return multiply(fromValue, toValue, multiplier);
    }

    function EaseIn (fromValue, toValue, progress) {
      var multiplier = (1 - Math.cos(progress * Math.PI / 2));
      return multiply(fromValue, toValue, multiplier);
    }

    function EaseOut (fromValue, toValue, progress) {
      var multiplier = Math.cos((1 - progress) * Math.PI / 2);
      return multiply(fromValue, toValue, multiplier);
    }

    function Animation (initial) {
      var self = this;

      var raf, startTime, lastTime, pausedAfter;
      var fromValues = Immutable.fromJS(initial);
      var currentValues = fromValues;
      var toValues = Immutable.Map();
      var durationMillis = 500;
      var frameRate = 1000 / 60;
      var easing = Linear;
      var shouldLoop = false;

      var events = {
        all: [],
        start: [],
        stop: [],
        pause: [],
        end: [],
        update: [],
        loop: []
      };

      function easeValues () {
        cancelAnimationFrame(raf);

        var now = performance.now();
        var progress = (now - startTime) / durationMillis;

        if (lastTime - now >= frameRate) {
          function mapValues (value, key) {
            if (Immutable.Iterable.isIterable(value)) {
              return value.map(mapValues);
            }

            return easing(value, toValues.get(key), progress);
          }

          currentValues = currentValues.map(mapValues);
        }

        lastTime = now;

        raf = requestAnimationFrame(easeValues);
      }

      // Set the frameRate
      function fps (input) {
        frameRate = 1000 / input;
        return self;
      }

      // Set from values
      function from (input) {
        fromValues = Immutable.fromJS(input);
        return self;
      }

      // Set to values
      function to (input) {
        toValues = Immutable.fromJS(input);
        return self;
      }

      // Set animation duration
      function duration (input) {
        durationMillis = input;
        return self;
      }

      // Set easing
      function ease (input) {
        if (typeof input !== 'function') {
          throw new Error('Ease must be a function, instead got: ' + (typeof input));
        }

        easing = input;
        return self;
      }

      // Set whether the animation should loop
      function loop (input) {
        shouldLoop = input;
        return self;
      }

      // Invert animation values
      function invert () {
        return self;
      }

      // Play animation in reverse
      function reverse () {
        var temp = fromValues;
        fromValues = toValues;
        toValues = temp;
        return self;
      }

      // Start or resume animation
      function start () {
        cancelAnimationFrame(raf);

        if (typeof pausedAfter !== 'undefined') {
          startTime = performance.now() - pausedAfter;
        } else {
          startTime = performance.now();
        }

        lastTime = startTime;
        pausedAfter = undefined;

        raf = requestAnimationFrame(easeValues);

        return self;
      }

      // Stop animation and resume from beginning
      function stop () {
        cancelAnimationFrame(raf);
        pausedAfter = undefined;
        startTime = undefined;
        return self;
{'fraction_non_alphanumeric': 0.11060507482108002, 'fraction_numerical': 0.00520494469746259, 'mean_word_length': 2.032694475760992, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1620205', 'n_tokens_mistral': 3034, 'n_tokens_neox': 2847, 'n_words': 790}