<commit_before>var type_mapping = [
  '',
  'double_value',
  'float_value',
  'int32_value',
  'int64_value',
  'uint32_value',
  'uint64_value',
  'sint32_value',
  'sint64_value',
  'fixed32_value',
  'fixed64_value',
  'sfixed32_value',
  'sfixed64_value',
  'bool_value',
  'string_value',
  'bytes_value'
];

module.exports = getResponseArray;

function copy(src)  {
  var dst = new ArrayBuffer((src.byteLength || src.length));
  new Uint8Array(dst).set(new Uint8Array(src));
  return dst;
}

function mapValues(obj, value, ret, fn) {
  ret = ret || [];

  if (value.type < 16) {
      ret.push(value[type_mapping[value.type]]);
  } else {
    switch (value.type) {
      case 16: // OPERATION
      break;

      case 17: // ERROR
        var error = new Error(value.string_value);
        console.error(value.string_value);
        error.responseObject = obj;
        fn(error);
        return null;
      break;

      case 18: // SHAPE_HANDLE
        ret.push({ id: value.uint32_value });
      break;

      case 19: // FLOAT_BUFFER
        ret.push(new Float32Array(copy(value.bytes_value)));
      break;

      case 20: // DOUBLE_BUFFER
        ret.push(new Float64Array(copy(value.bytes_value)));<commit_msg>remove debug<commit_after>var type_mapping = [
  '',
  'double_value',
  'float_value',
  'int32_value',
  'int64_value',
  'uint32_value',
  'uint64_value',
  'sint32_value',
  'sint64_value',
  'fixed32_value',
  'fixed64_value',
  'sfixed32_value',
  'sfixed64_value',
  'bool_value',
  'string_value',
  'bytes_value'
];

module.exports = getResponseArray;

function copy(src)  {
  var dst = new ArrayBuffer((src.byteLength || src.length));
  new Uint8Array(dst).set(new Uint8Array(src));
  return dst;
}

function mapValues(obj, value, ret, fn) {
  ret = ret || [];

  if (value.type < 16) {
      ret.push(value[type_mapping[value.type]]);
  } else {
    switch (value.type) {
      case 16: // OPERATION
      break;

      case 17: // ERROR
        var error = new Error(value.string_value);
        error.responseObject = obj;
        fn(error);
        return null;
      break;

      case 18: // SHAPE_HANDLE
        ret.push({ id: value.uint32_value });
      break;

      case 19: // FLOAT_BUFFER
        ret.push(new Float32Array(copy(value.bytes_value)));
      break;

      case 20: // DOUBLE_BUFFER
        ret.push(new Float64Array(copy(value.bytes_value)));
{'fraction_non_alphanumeric': 0.14279766860949208, 'fraction_numerical': 0.03330557868442964, 'mean_word_length': 2.869565217391304, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6736019', 'n_tokens_mistral': 906, 'n_tokens_neox': 841, 'n_words': 161}