<commit_before>lib.Vec3 = {};

lib.Vec3.create = function () {
  return new Float32Array(3);
};

lib.Vec3.set = function (b0, i, x, y, z) {
  var ix = i * 3, iy = ix + 1, iz = ix + 2;

  if (y == null) {
    z = x[2];
    y = x[1];
    x = x[0];
  }

  b0[ix] = x;
  b0[iy] = y;
  b0[iz] = z;
};

lib.Vec3.get = function (b0, i, out) {
  var ix = i * 3, iy = ix + 1, iz = ix + 2;

  out[0] = b0[ix];
  out[1] = b0[iy];
  out[2] = b0[iz];

  return out;
};

lib.Vec3.distance = function (b0, a, b) {
  var ax = a * 3, ay = ax + 1, az = ax + 2;
  var bx = b * 3, by = bx + 1, bz = bx + 2;

  var dx = b0[ax] - b0[bx];
  var dy = b0[ay] - b0[by];
  var dz = b0[az] - b0[bz];

  return Math.sqrt(dx * dx + dy * dy + dz * dz);
};
<commit_msg>Cleanup Vec3<commit_after>var Vec3 = lib.Vec3 = {};

Vec3.create = function () {
  return new Float32Array(3);
};

Vec3.set = function (b0, i, x, y, z) {
  var ix = i * 3, iy = ix + 1, iz = ix + 2;

  if (y == null) {
    z = x[2];
    y = x[1];
    x = x[0];
  }

  b0[ix] = x;
  b0[iy] = y;
  b0[iz] = z;
};

Vec3.get = function (b0, i, out) {
  var ix = i * 3, iy = ix + 1, iz = ix + 2;

  out[0] = b0[ix];
  out[1] = b0[iy];
  out[2] = b0[iz];

  return out;
};

Vec3.distance = function (b0, a, b) {
  var ax = a * 3, ay = ax + 1, az = ax + 2;
  var bx = b * 3, by = bx + 1, bz = bx + 2;

  var dx = b0[ax] - b0[bx];
  var dy = b0[ay] - b0[by];
  var dz = b0[az] - b0[bz];

  return Math.sqrt(dx * dx + dy * dy + dz * dz);
};

{'fraction_non_alphanumeric': 0.22411444141689374, 'fraction_numerical': 0.05722070844686648, 'mean_word_length': 2.079664570230608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2175757', 'n_tokens_mistral': 794, 'n_tokens_neox': 739, 'n_words': 213}