<commit_before>/*! JSON v3.2.1 | http://bestiejs.github.com/json3 | Copyright 2012, <NAME> | http://kit.mit-license.org */
;(function () {
  // Convenience aliases.
  var getClass = {}.toString, isProperty, forEach, undef,

  // Detect the `define` function exposed by asynchronous module loaders and set
  // up the internal `JSON3` namespace. The strict equality check for `define`
  // is necessary for compatibility with the RequireJS optimizer (`r.js`).
  isLoader = typeof define === "function" && define.amd, JSON3 = typeof exports == "object" && exports,

  // A JSON source string used to test the native `stringify` and `parse`
  // implementations.
  serialized = '{"result":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}',

  // Feature tests to determine whether the native `JSON.stringify` and `parse`
  // implementations are spec-compliant. `stringifySupported` is defined after
  // the date test, as it depends upon it. Based on work by <NAME>.
  stringifySupported, Escapes, toPaddedString, quote, serialize,
  parseSupported = typeof JSON3.parse == "function", fromCharCode, Unescapes, Parser, walk, lex, get,

  // Test the `Date#getUTC*` methods. Based on work by @Yaffle.
  value = new Date(-3509827334573292), floor, Months, getDay;

  try {
    // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical
    // results for certain dates in Opera >= 10.53.
    value = value.getUTCFullYear() == -109252 && value.getUTCMonth() === 0 && value.getUTCDate() == 1 &&
      // Safari < 2.0.2 stores the internal millisecond time value correctly,
      // but clips the values returned by the date methods to the range of
      // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).
      value.getUTCHours() == 10 && value.getUTCMinutes() == 37 && value.getUTCSeconds() == 6 && value.getUTCMilliseconds() == 708;
  } catch (exception) {}

  // Define additional utility methods if the `Date` methods are buggy.
  if (!value) {
    floor = Math.floor;
    // A mapping between the months of the year and the number of days between
    // January 1st and the first of the respective month.
    Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
    // Internal: Calculates the number of days between the Unix epoch and the
    // first day of the given month.
    getDay = function (year, month) {
      return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);
    };
  }

  // Export JSON 3 for asynchronous module loaders, CommonJS environments, web
  // browsers, and JavaScript engines. Credits: <NAME>.
  if (isLoader || JSON3) {
    if (isLoader) {
      // Export for asynchronous module loaders. The `JSON3` namespace is
      // redefined because module loaders do not provide the `exports` object.
      define("json", (JSON3 = {}));
    }
    if (typeof JSON == "object" && JSON) {
      // Delegate to the native `stringify` and `parse` implementations in
      // asynchronous module loaders and CommonJS environments.
      JSON3.stringify = JSON.stringify;
      JSON3.parse = JSON.parse;
    }
  } else {
    // Export for browsers and JavaScript engines.
    JSON3 = this.JSON || (this.JSON = {});
  }

  // Test `JSON.stringify`.
  if ((stringifySupported = typeof JSON3.stringify == "function" && !getDay)) {
    // A test function object with a custom `toJSON` method.
    value = function () {
      return 1;
    };
    value.toJSON = value;
    try {
      switch (false) {
        // Firefox 3.1b1 and b2 serialize string, number, and boolean
        // primitives as object literals.
        case JSON3.stringify(0) === "0":
        // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object
        // literals.
        case JSON3.stringify(new 0..constructor()) === "0":
        case JSON3.stringify(new "".constructor()) == '""':
        // FF 3.1b1, 2 will throw an error if the value is `null`,
        // `undefined`, or does not define a canonical JSON representation
        // (this applies to objects with `toJSON` properties as well, *unless*
        // they are nested within an object or array).
        case JSON3.stringify(getClass) === undef:
        // IE 8 serializes `undefined` as `"undefined"`.
        case JSON3.stringify(undef) === undef:
        // Safari 5.1.2 will throw an error if the `value` argument is
        // omitted, but correctly returns `undefined` for the above test.
        case JSON3.stringify() === undef:
        // FF 3.1b1, 2 will throw an error if the value does not define a
        // canonical JSON representation. This applies to objects with
        // `toJSON` properties, unless they are nested inside object or array
        // literals. YUI 3.0.0b1 ignores custom `toJSON` methods.
        case JSON3.stringify(value) === "1":
        case JSON3.stringify([value]) == "[1]":
        // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of
        // `"[null]"`.
        case JSON3.stringify([undef]) == "[null]":
        // YUI 3.0.0b1 fails to serialize `null` literals.
        case JSON3.stringify(null) == "null":
        // FF 3.1b1, 2 will halt serialization if an array contains a function.
        // `[1, true, getClass, 1]` serializes as "[1,true,],". These versions
        // of Firefox also allow trailing commas in JSON objects and arrays.
        case JSON3.stringify([undef, getClass, null]) == "[null,null,null]":
        // Simple serialization test. FF 3.1b1 uses Unicode escape sequences
        // where character escape codes are expected (e.g., `\b` => `\u0008`).
        case JSON3.stringify({ "result": [value, true, false, null, "\0\b\n\f\r\t"] }) == serialized:
        // FF 3.1b1, b2, and Prototype <= 1.7 ignore the `filter` and `width`
        // arguments.
        case JSON3.stringify(null, value) === "1":
        case JSON3.stringify([1, 2], null, 1) == "[\n 1,\n 2\n]":
        // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly
        // serialize extended years.
        case JSON3.stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"':
        // The milliseconds are optional in ES 5, but required in 5.1.
        case JSON3.stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"':
        // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative
        // four-digit years instead of six-digit years. Credits: @Yaffle.
        case JSON3.stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"':
        // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond
        // values less than 1000. Credits: @Yaffle.
        case JSON3.stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"':
          stringifySupported = false;
      }
    } catch (exception) {
      stringifySupported = false;
    }
  }

  // Test `JSON.parse`.
  if (parseSupported) {
    try {
      // FF 3.1b1, b2 will throw an exception if a bare literal is provided.
      // Conforming implementations should also coerce the initial argument to
      // a string prior to parsing.
      if (JSON3.parse("0") === 0 && !JSON3.parse(false)) {
        // Simple parsing test.
        value = JSON3.parse(serialized);
        if ((parseSupported = value.result.length == 5 && value.result[0] == 1)) {
          try {
            // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.
            parseSupported = !JSON3.parse('"\t"');
          } catch (exception) {}
          if (parseSupported) {
            try {
              // Firefox 4.0 and 4.0.1 allow leading `+` signs, leading decimal
              // points, trailing decimal points, and certain octal literals.
              parseSupported = JSON3.parse("+1") != 1 && JSON3.parse("01") != 1;
            } catch (exception) {}
          }
        }<commit_msg>Ensure that the `JSON.parse` feature test correctly detects native implementations. Closes #9.<commit_after>/*! JSON v3.2.1 | http://bestiejs.github.com/json3 | Copyright 2012, Kit Cambridge | http://kit.mit-license.org */
;(function () {
  // Convenience aliases.
  var getClass = {}.toString, isProperty, forEach, undef,

  // Detect the `define` function exposed by asynchronous module loaders and set
  // up the internal `JSON3` namespace. The strict equality check for `define`
  // is necessary for compatibility with the RequireJS optimizer (`r.js`).
  isLoader = typeof define === "function" && define.amd, JSON3 = typeof exports == "object" && exports,

  // A JSON source string used to test the native `stringify` and `parse`
  // implementations.
  serialized = '{"result":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}',

  // Feature tests to determine whether the native `JSON.stringify` and `parse`
  // implementations are spec-compliant. `stringifySupported` is defined after
  // the date test, as it depends upon it. Based on work by <NAME>.
  stringifySupported, Escapes, toPaddedString, quote, serialize,
  parseSupported, fromCharCode, Unescapes, Parser, walk, lex, get,

  // Test the `Date#getUTC*` methods. Based on work by @Yaffle.
  value = new Date(-3509827334573292), floor, Months, getDay;

  try {
    // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical
    // results for certain dates in Opera >= 10.53.
    value = value.getUTCFullYear() == -109252 && value.getUTCMonth() === 0 && value.getUTCDate() == 1 &&
      // Safari < 2.0.2 stores the internal millisecond time value correctly,
      // but clips the values returned by the date methods to the range of
      // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).
      value.getUTCHours() == 10 && value.getUTCMinutes() == 37 && value.getUTCSeconds() == 6 && value.getUTCMilliseconds() == 708;
  } catch (exception) {}

  // Define additional utility methods if the `Date` methods are buggy.
  if (!value) {
    floor = Math.floor;
    // A mapping between the months of the year and the number of days between
    // January 1st and the first of the respective month.
    Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
    // Internal: Calculates the number of days between the Unix epoch and the
    // first day of the given month.
    getDay = function (year, month) {
      return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);
    };
  }

  // Export JSON 3 for asynchronous module loaders, CommonJS environments, web
  // browsers, and JavaScript engines. Credits: <NAME>.
  if (isLoader || JSON3) {
    if (isLoader) {
      // Export for asynchronous module loaders. The `JSON3` namespace is
      // redefined because module loaders do not provide the `exports` object.
      define("json", (JSON3 = {}));
    }
    if (typeof JSON == "object" && JSON) {
      // Delegate to the native `stringify` and `parse` implementations in
      // asynchronous module loaders and CommonJS environments.
      JSON3.stringify = JSON.stringify;
      JSON3.parse = JSON.parse;
    }
  } else {
    // Export for browsers and JavaScript engines.
    JSON3 = this.JSON || (this.JSON = {});
  }

  // Test `JSON.stringify`.
  if ((stringifySupported = typeof JSON3.stringify == "function" && !getDay)) {
    // A test function object with a custom `toJSON` method.
    value = function () {
      return 1;
    };
    value.toJSON = value;
    try {
      switch (false) {
        // Firefox 3.1b1 and b2 serialize string, number, and boolean
        // primitives as object literals.
        case JSON3.stringify(0) === "0":
        // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object
        // literals.
        case JSON3.stringify(new 0..constructor()) === "0":
        case JSON3.stringify(new "".constructor()) == '""':
        // FF 3.1b1, 2 will throw an error if the value is `null`,
        // `undefined`, or does not define a canonical JSON representation
        // (this applies to objects with `toJSON` properties as well, *unless*
        // they are nested within an object or array).
        case JSON3.stringify(getClass) === undef:
        // IE 8 serializes `undefined` as `"undefined"`.
        case JSON3.stringify(undef) === undef:
        // Safari 5.1.2 will throw an error if the `value` argument is
        // omitted, but correctly returns `undefined` for the above test.
        case JSON3.stringify() === undef:
        // FF 3.1b1, 2 will throw an error if the value does not define a
        // canonical JSON representation. This applies to objects with
        // `toJSON` properties, unless they are nested inside object or array
        // literals. YUI 3.0.0b1 ignores custom `toJSON` methods.
        case JSON3.stringify(value) === "1":
        case JSON3.stringify([value]) == "[1]":
        // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of
        // `"[null]"`.
        case JSON3.stringify([undef]) == "[null]":
        // YUI 3.0.0b1 fails to serialize `null` literals.
        case JSON3.stringify(null) == "null":
        // FF 3.1b1, 2 will halt serialization if an array contains a function.
        // `[1, true, getClass, 1]` serializes as "[1,true,],". These versions
        // of Firefox also allow trailing commas in JSON objects and arrays.
        case JSON3.stringify([undef, getClass, null]) == "[null,null,null]":
        // Simple serialization test. FF 3.1b1 uses Unicode escape sequences
        // where character escape codes are expected (e.g., `\b` => `\u0008`).
        case JSON3.stringify({ "result": [value, true, false, null, "\0\b\n\f\r\t"] }) == serialized:
        // FF 3.1b1, b2, and Prototype <= 1.7 ignore the `filter` and `width`
        // arguments.
        case JSON3.stringify(null, value) === "1":
        case JSON3.stringify([1, 2], null, 1) == "[\n 1,\n 2\n]":
        // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly
        // serialize extended years.
        case JSON3.stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"':
        // The milliseconds are optional in ES 5, but required in 5.1.
        case JSON3.stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"':
        // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative
        // four-digit years instead of six-digit years. Credits: @Yaffle.
        case JSON3.stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"':
        // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond
        // values less than 1000. Credits: @Yaffle.
        case JSON3.stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"':
          stringifySupported = false;
      }
    } catch (exception) {
      stringifySupported = false;
    }
  }

  // Test `JSON.parse`.
  if ((parseSupported = typeof JSON3.parse == "function")) {
    try {
      // FF 3.1b1, b2 will throw an exception if a bare literal is provided.
      // Conforming implementations should also coerce the initial argument to
      // a string prior to parsing.
      if (JSON3.parse("0") === 0 && !JSON3.parse(false)) {
        // Simple parsing test.
        value = JSON3.parse(serialized);
        if ((parseSupported = value.result.length == 5 && value.result[0] == 1)) {
          try {
            // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.
            parseSupported = !JSON3.parse('"\t"');
          } catch (exception) {}
          if (parseSupported) {
            try {
              // Firefox 4.0 and 4.0.1 allow leading `+` signs, leading decimal
              // points, trailing decimal points, and certain octal literals.
              parseSupported = JSON3.parse("+1") != 1 && JSON3.parse("01") != 1;
            } catch (exception) {}
          }
        }
{'fraction_non_alphanumeric': 0.13706929193487316, 'fraction_numerical': 0.045752871387100845, 'mean_word_length': 2.5059734513274337, 'pattern_counts': {'":': 22, '<': 22, '<?xml version=': 0, '>': 16, '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': '5951098', 'n_tokens_mistral': 5201, 'n_tokens_neox': 4648, 'n_words': 1648}