<commit_before>var Draw = (function () {
  var setup = function() {
    //Set up some globals
    var pixSize = 4, lastPoint = null, currentColor = "000", mouseDown = 0;

    //Create a reference to the pixel data for our drawing.
    var pixelDataRef = new Firebase('https://intense-fire-3380.firebaseio.com/draw'+ FirebaseModule.roomKey);

    // Set up our canvas
    var myCanvas = document.getElementById('drawing-canvas');
    var myContext = myCanvas.getContext ? myCanvas.getContext('2d') : null;
    if (myContext == null) {
      alert("You must use a browser that supports HTML5 Canvas to run this demo.");
      return;
    }

    //Setup each color palette & add it to the screen
    var colors = ["000","f00","0f0","00f","f05","f80","0f8","cf0","08f","408", "fff",];
    for (c in colors) {
      if (colors[c] === "fff") {
      var item = $('<div/>').css("background-color", '#' + colors[c]).addClass("colorbox").addClass("eraser");
      }
      else {
      var item = $('<div/>').css("background-color", '#' + colors[c]).addClass("colorbox");
      }
      item.click((function () {
        var col = colors[c];
        return function () {
        if (col === "fff") {
          pixSize = 50;
        }
        else {
          pixSize = 4;
        }
          currentColor = col;
        };
      })());
      item.appendTo('#colorholder');
    }

  $.fn.drawTouch = function() {
      var start = function(e) {
            e = e.originalEvent;
        ctx.beginPath();
        x = e.changedTouches[0].pageX;
        y = e.changedTouches[0].pageY-44;
        ctx.moveTo(x,y);
      };
      var move = function(e) {
        e.preventDefault();
            e = e.originalEvent;
        x = e.changedTouches[0].pageX;
        y = e.changedTouches[0].pageY-44;
        ctx.lineTo(x,y);
        ctx.stroke();
      };
      $(this).on("touchstart", start);
      $(this).on("touchmove", drawLineOnMouseMove);
    };
    //Keep track of if the mouse is up or down
    myCanvas.onmousedown = function () {mouseDown = 1;};
    myCanvas.onmouseout = myCanvas.onmouseup = function () {
      mouseDown = 0; lastPoint = null;
    };

    myCanvas.touchstart = function(){mouseDown = 1;};<commit_msg>PROGRESS<commit_after>var Draw = (function () {
  var setup = function() {
    //Set up some globals
    var pixSize = 4, lastPoint = null, currentColor = "000", mouseDown = 0;

    //Create a reference to the pixel data for our drawing.
    var pixelDataRef = new Firebase('https://intense-fire-3380.firebaseio.com/draw'+ FirebaseModule.roomKey);

    // Set up our canvas
    var myCanvas = document.getElementById('drawing-canvas');
    var myContext = myCanvas.getContext ? myCanvas.getContext('2d') : null;
    if (myContext == null) {
      alert("You must use a browser that supports HTML5 Canvas to run this demo.");
      return;
    }

    //Setup each color palette & add it to the screen
    var colors = ["000","f00","0f0","00f","f05","f80","0f8","cf0","08f","408", "fff",];
    for (c in colors) {
      if (colors[c] === "fff") {
      var item = $('<div/>').css("background-color", '#' + colors[c]).addClass("colorbox").addClass("eraser");
      }
      else {
      var item = $('<div/>').css("background-color", '#' + colors[c]).addClass("colorbox");
      }
      item.click((function () {
        var col = colors[c];
        return function () {
        if (col === "fff") {
          pixSize = 50;
        }
        else {
          pixSize = 4;
        }
          currentColor = col;
        };
      })());
      item.appendTo('#colorholder');
    }

  $.fn.drawTouch = function() {
      var start = function(e) {
            e = e.originalEvent;
        ctx.beginPath();
        x = e.changedTouches[0].pageX;
        y = e.changedTouches[0].pageY-44;
        ctx.moveTo(x,y);
      };
      var move = function(e) {
        e.preventDefault();
            e = e.originalEvent;
        x = e.changedTouches[0].pageX;
        y = e.changedTouches[0].pageY-44;
        ctx.lineTo(x,y);
        ctx.stroke();
      };
      $(this).on("touchstart", drawLineOnMouseMove);
      $(this).on("touchmove", drawLineOnMouseMove);
    };
    //Keep track of if the mouse is up or down
    myCanvas.onmousedown = function () {mouseDown = 1;};
    myCanvas.onmouseout = myCanvas.onmouseup = function () {
      mouseDown = 0; lastPoint = null;
    };

    myCanvas.touchstart = function(){mouseDown = 1;};
{'fraction_non_alphanumeric': 0.16572589749379094, 'fraction_numerical': 0.02077218333709641, 'mean_word_length': 2.298585256887565, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '5870065', 'n_tokens_mistral': 1461, 'n_tokens_neox': 1400, 'n_words': 323}