<commit_before>
<!DOCTYPE html>
<html>
<head>
  <!--<script src="../dist/underscore.js"></script>
  <script src="../dist/shifty.js"></script>
  <script src="../dist/rekapi.js"></script>-->
  <script src="../dist/rekapi.bundle.min.js"></script>
  <!--<script src="../src/rekapi.core.js"></script>-->
  <!--<script src="../src/rekapi.actor.js"></script>
  <script src="../src/rekapi.canvas.js"></script>
  <script src="../src/rekapi.dom.js"></script>-->
</head>
<body>
  <canvas></canvas>
  <script>
  (function (global) {

    function makeBubble () {
      return new Kapi.Actor({
        'draw': function (canvas_context, state) {
          canvas_context.beginPath();
          canvas_context.arc(
            state.x || 0,
            state.y || 0,
            Math.abs(state.radius || 50),
            0,
            Math.PI*2,
            true);
          canvas_context.closePath();

          var rad = Math.abs(state.radius);
          var startX = state.x - (rad * .2);
          var startY = state.y - (rad * .2);
          var startRad = rad * .3;
          var endX = state.x;
          var endY = state.y;
          var endRad = rad * 2;

          var grad = canvas_context.createRadialGradient(startX, startY,
              startRad, endX, endY, endRad);

          var innerColor = Tweenable.util.interpolate({color: state.color},
              {color: 'rgb(0,0,0)'}, 0.3, 'linear').color;

          grad.addColorStop(0, innerColor);
          grad.addColorStop(1, state.color);
          canvas_context.fillStyle = grad;
          canvas_context.fill();

        }
      });
    }

    function getBubbleX () {
      return Math.random() * kapi.canvas_width();
    }

    function getBubbleY () {
      return Math.random() * kapi.canvas_height();
    }

    function getSize () {
      return 5 + (Math.random() * 20);
    }

    function getColor () {
      return'rgb('
        + parseInt(Math.random() * 255, 10) + ','
        + parseInt(Math.random() * 255, 10) + ','
        + parseInt(Math.random() * 255, 10) + ')';
    }

    function getRandomEasing () {
      var keys = ['bouncePast', 'easeInOutBack', 'swingFromTo']

      return keys[parseInt(Math.random() * keys.length, 10)];
    }

    function generateKeyframes (bubbles) {
      var i, j
          ,time = 0;

      function generateRandomFrame (actor) {
        return actor.keyframe(time += 2250, {
          'x': getBubbleX()
          ,'y': getBubbleY()
          ,'radius': getSize()
          ,'color': getColor()
        }, {
          'x': getRandomEasing()
          ,'y': getRandomEasing()
          ,'radius': getRandomEasing()
          ,'color': 'linear'
        }).wait(time += 1000);
      }

      for (i = 0; i < 30; i++) {
        time = 0;
        bubbles[i] = makeBubble();
        kapi.addActor(bubbles[i]);

        bubbles[i].keyframe(time, {
          'x': kapi.canvas_width() / 2
          ,'y': kapi.canvas_height() + 50
          ,'radius': 0
          ,'color': getColor()
        }, {
          'x': getRandomEasing()
          ,'y': getRandomEasing()
          ,'radius': getRandomEasing()
          ,'color': getRandomEasing()
        });

        for (j = 0; j < 3; j++) {
          generateRandomFrame(bubbles[i]);
        }

        bubbles[i]
          .copyProperties(time += 1500, 0)
          .wait(time += 750);
      }
    }

    function mungeKeyframes (bubbles) {
      _.each(bubbles, function (bubble) {
        var trackNames = bubble.getTrackNames();

        _.each(trackNames, function (trackName) {
          var i
              ,keyProp
              ,newMillisecond
              ,randomNumber
              ,trackLength = bubble.getTrackLength(trackName);

          for (i = 1; i < trackLength - 1; i++) {
            keyProp = bubble.getKeyframeProperty(trackName, i);<commit_msg>Makes the demo actually work.<commit_after>
<!DOCTYPE html>
<html>
<head>
  <!--<script src="../dist/underscore.js"></script>
  <script src="../dist/shifty.js"></script>
  <script src="../dist/rekapi.js"></script>-->
  <script src="../dist/rekapi.bundle.min.js"></script>
  <!--<script src="../src/rekapi.core.js"></script>-->
  <!--<script src="../src/rekapi.actor.js"></script>
  <script src="../src/rekapi.canvas.js"></script>
  <script src="../src/rekapi.dom.js"></script>-->
</head>
<body>
  <canvas></canvas>
  <script>
  (function (global) {

    function makeBubble () {
      return new Kapi.Actor({
        'draw': function (canvas_context, state) {
          canvas_context.beginPath();
          canvas_context.arc(
            state.x || 0,
            state.y || 0,
            Math.abs(state.radius || 50),
            0,
            Math.PI*2,
            true);
          canvas_context.closePath();

          var rad = Math.abs(state.radius)
          ,startX = state.x - (rad * .2)
          ,startY = state.y - (rad * .2)
          ,startRad = rad * .3
          ,endX = state.x
          ,endY = state.y
          ,endRad = rad * 2
          ,grad = canvas_context.createRadialGradient(startX, startY,
              startRad, endX, endY, endRad);

          var bgColor = Tweenable.util.interpolate({color: state.color},
              {color: 'rgb(0,0,0)'}, 0.3, 'linear').color;

          grad.addColorStop(0, state.color);
          grad.addColorStop(1, bgColor);
          canvas_context.fillStyle = grad;
          canvas_context.fill();

        }
      });
    }

    function getBubbleX () {
      return Math.random() * kapi.canvas_width();
    }

    function getBubbleY () {
      return Math.random() * kapi.canvas_height();
    }

    function getSize () {
      return 7 + (Math.random() * 18);
    }

    function getColor () {
      return'rgb('
        + parseInt(Math.random() * 255, 10) + ','
        + parseInt(Math.random() * 255, 10) + ','
        + parseInt(Math.random() * 255, 10) + ')';
    }

    function getRandomEasing () {
      var keys = ['bouncePast', 'easeInOutBack', 'swingFromTo']

      return keys[parseInt(Math.random() * keys.length, 10)];
    }

    function generateKeyframes (bubbles) {
      var i, j
          ,time = 0;

      function generateRandomFrame (actor) {
        return actor.keyframe(time += 2250, {
          'x': getBubbleX()
          ,'y': getBubbleY()
          ,'radius': getSize()
        }, {
          'x': getRandomEasing()
          ,'y': getRandomEasing()
          ,'radius': getRandomEasing()
        }).wait(time += 1000);
      }

      for (i = 0; i < 30; i++) {
        time = 0;
        bubbles[i] = makeBubble();
        kapi.addActor(bubbles[i]);

        bubbles[i].keyframe(time, {
          'x': kapi.canvas_width() / 2
          ,'y': kapi.canvas_height() + 50
          ,'radius': 0
          ,'color': getColor()
        }, {
          'x': getRandomEasing()
          ,'y': getRandomEasing()
          ,'radius': getRandomEasing()
          //,'color': 'linear'
        });

        for (j = 0; j < 3; j++) {
          generateRandomFrame(bubbles[i]);
        }

        bubbles[i]
          .copyProperties(time += 1500, 0)
          .wait(time += 750);
      }
    }

    function mungeKeyframes (bubbles) {
      _.each(bubbles, function (bubble) {
        var trackNames = bubble.getTrackNames();

        _.each(trackNames, function (trackName) {
          var i
              ,keyProp
              ,newMillisecond
              ,randomNumber
              ,trackLength = bubble.getTrackLength(trackName);

          for (i = 1; i < trackLength - 1; i++) {
            keyProp = bubble.getKeyframeProperty(trackName, i);
{'fraction_non_alphanumeric': 0.1666225516146109, 'fraction_numerical': 0.017469560614081524, 'mean_word_length': 1.8282185628742516, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 57, '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': '5349496', 'n_tokens_mistral': 2531, 'n_tokens_neox': 2361, 'n_words': 474}