<commit_before>function pointStack(maxPnts) {

  var _this = this;
  var points = [];
  var bAver = true;

  //var averDiff = new aveCont();
  var sampsX = new aveCont(10);
  var sampsY = new aveCont(10);

  points.changeAveraging = function(num) {
    if (num < 2) bAver = false;
    else {
      sampsX.changeNumSamps(num);
      sampsY.changeNumSamps(num);
    }
  };

  points.addPoint = function(pnt) {

    // TODO: Give this point an accuracy score
    // based on how close to the current pattern it is.
    var accuracy = 0;
    var aColor = this.getAccuracyColor(accuracy);

    if (points.length) {

      if (this.hasMoved(pnt) === true) {

        if (bAver) {

          sampsX.addSample(pnt.x);
          sampsY.addSample(pnt.y);
          points.push({x:sampsX.ave, y:sampsY.ave, color:aColor});

        } else {

          points.push({x:pnt.x, y:pnt.y, color:aColor});

        }

        if (points.length >= maxPnts) {

          // Remove oldest point
          points.splice(0, 1);

        }

        return true;
      }

    } else {

      points.push({x:pnt.x, y:pnt.y, color:aColor});
      return false;

    }

  };

  points.hasMoved = function(pnt) {

    return (Math.abs(pnt.x - points.last().x) > .001 || Math.abs(pnt.y - points.last().y) > .001);

  };

  points.getAccuracyColor = function(val) {

    var mVal = Math.round(map(val, 0, 1, 0, 255));

    var rr = 255 - mVal;
    var gg = 0 + mVal;
    var bb = 0;

    return 'rgb(' + rr + ',' + gg + ',' + bb + ')';

  };

  return points;
}
<commit_msg>change the new point threshold<commit_after>function pointStack(maxPnts) {

  var _this = this;
  var points = [];
  var bAver = true;

  //var averDiff = new aveCont();
  var sampsX = new aveCont(10);
  var sampsY = new aveCont(10);

  points.changeAveraging = function(num) {
    if (num < 2) bAver = false;
    else {
      sampsX.changeNumSamps(num);
      sampsY.changeNumSamps(num);
    }
  };

  points.addPoint = function(pnt) {

    // TODO: Give this point an accuracy score
    // based on how close to the current pattern it is.
    var accuracy = 0;
    var aColor = this.getAccuracyColor(accuracy);

    if (points.length) {

      if (this.hasMoved(pnt) === true) {

        if (bAver) {

          sampsX.addSample(pnt.x);
          sampsY.addSample(pnt.y);
          points.push({x:sampsX.ave, y:sampsY.ave, color:aColor});

        } else {

          points.push({x:pnt.x, y:pnt.y, color:aColor});

        }

        if (points.length >= maxPnts) {

          // Remove oldest point
          points.splice(0, 1);

        }

        return true;
      }

    } else {

      points.push({x:pnt.x, y:pnt.y, color:aColor});
      return false;

    }

  };

  points.hasMoved = function(pnt) {

    return (Math.abs(pnt.x - points.last().x) > .003 || Math.abs(pnt.y - points.last().y) > .003);

  };

  points.getAccuracyColor = function(val) {

    var mVal = Math.round(map(val, 0, 1, 0, 255));

    var rr = 255 - mVal;
    var gg = 0 + mVal;
    var bb = 0;

    return 'rgb(' + rr + ',' + gg + ',' + bb + ')';

  };

  return points;
}

{'fraction_non_alphanumeric': 0.15404447309055752, 'fraction_numerical': 0.016113438607798906, 'mean_word_length': 2.070227497527201, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6566749', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1116, 'n_words': 254}