<commit_before>/*!
 * JSON 3, version 3.0
 * http://bestiejs.github.com/json3
 *
 * Copyright 2012, <NAME>.
 *
 * Released under the MIT License.
*/

;(function (root, Module) {
  if (typeof define == "function" && define.amd) {
    // Export JSON 3 for asynchronous module loaders.
    define("json", ["exports"], Module);
  } else {
    // Export for CommonJS environments, web browsers, and JavaScript engines.
    Module(typeof exports == "object" && exports || this.JSON || (this.JSON = {}));
  }
})(this, function (exports) {
  // Convenience aliases.
  var getClass = {}.toString, hasOwnProperty = {}.hasOwnProperty, forEach, stringifySupported, parseSupported;

  // Feature tests to determine whether the native `JSON.stringify` and `parse`
  // implementations are spec-compliant. Based on work by <NAME>.
  stringifySupported = typeof exports.stringify == "function";
  parseSupported = typeof exports.parse == "function";
  (function () {
    var serialized = '{"result":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}', toJSON, original, value;
    // Test `JSON.stringify`.
    if (stringifySupported) {
      // An object with a custom `toJSON` method.
      toJSON = function toJSON() {
        return 1;
      };
      toJSON.toJSON = toJSON;
      try {
        switch (false) {
          // Firefox 3.1b1 and 2 serialize string, number, and boolean
          // primitives as object literals.
          case exports.stringify(0) === "0":
          // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object
          // literals.
          case exports.stringify(new (0).constructor()) === "0":
          case exports.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 exports.stringify(getClass) === void 0:
          // IE 8 serializes `undefined` as `"undefined"`.
          case exports.stringify(void 0) === void 0:
          // Safari 5.1.2 will throw an error if the `value` argument is
          // omitted, but correctly returns `undefined` for the above test.
          case exports.stringify() === void 0:
          // 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 exports.stringify(toJSON) === "1":
          case exports.stringify([toJSON]) == "[1]":
          // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of
          // `"[null]"`.
          case exports.stringify([void 0]) == "[null]":
          // YUI 3.0.0b1 fails to serialize `null` literals.
          case exports.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 exports.stringify([void 0, getClass, null]) == "[null,null,null]":
          // Simple serialization test. FF 3.1b1 uses Unicode escape sequences
          // where character escape codes are required (e.g., `\b` => `\u0008`).
          case exports.stringify({ "result": [toJSON, 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 exports.stringify(null, toJSON) === "1":
          case exports.stringify([1, 2], null, 1) == "[\n 1,\n 2\n]":
          // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly
          // serialize extended years. Safari < 2.0.2 restricts date time values
          // to the range `[(-2 ** 31), (2 ** 31) - 1]`, so the serialization
          // tests will fail in case JSON 3 is loaded twice.
          case (toJSON = new Date(-8.64e15)).getUTCFullYear() != -271821 || exports.stringify(toJSON) == '"-271821-04-20T00:00:00.000Z"':
          // The milliseconds are optional in ES 5, but required in 5.1.
          case (toJSON = new Date(8.64e15)).getUTCFullYear() != 275760 || exports.stringify(toJSON) == '"+275760-09-13T00:00:00.000Z"':
            stringifySupported = false;
        }
      } catch (exception) {
        stringifySupported = false;
      }
    }
    // Test `JSON.parse`.
    if (parseSupported) {
      try {
        // FF 3.1b1, 2 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 (exports.parse("0") === 0 && !exports.parse(false)) {
          // Simple parsing test.
          value = exports.parse(serialized);
          if (value.result.length != 5 || value.result[0] != 1) {
            parseSupported = false;
          } else {
            try {
              // Firefox 4.0 and 4.0.1 allow leading `+` signs, leading decimal
              // points, trailing decimal points, and certain octal literals.
              parseSupported = exports.parse("+1") != 1 && exports.parse("01") != 1;
            } catch (exception) {
              try {
                // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.
                parseSupported = !exports.parse('"\t"');
              } catch (exception) {}
            }
          }
        }
      } catch (exception) {
        parseSupported = false;
      }
    }
  })();

  // **hasOwnProperty** determines if a property is a direct property of the given
  // object. Delegates to the native *hasOwnProperty* method, if available.
  if (typeof hasOwnProperty != "function") {
    hasOwnProperty = (function () {
      // Capture a reference to the top-level `Object` constructor.
      var hasOwnProperty, members = {}, constructor = members.constructor;
      if ((members.__proto__ = null, members.__proto__ = {
        // The internal *proto* property cannot be set multiple times in recent
        // versions of Mozilla Firefox and SeaMonkey.
        "toString": 1
      }, members).toString != getClass) {
        // Safari <= 2.0.3 doesn't implement *hasOwnProperty*, but supports the
        // mutable *proto* property.
        hasOwnProperty = function hasOwnProperty(property) {
          // Capture and break the object's prototype chain. The parenthesized
          // expression prevents an unsafe transformation by the Closure
          // Compiler.
          var original = this.__proto__, result = property in (this.__proto__ = null, this);<commit_msg>Separate the Firefox 4.x and Safari <= 5.1.2 `JSON.parse` feature tests.<commit_after>/*!
 * JSON 3, version 3.0
 * http://bestiejs.github.com/json3
 *
 * Copyright 2012, <NAME>.
 *
 * Released under the MIT License.
*/

;(function (root, Module) {
  if (typeof define == "function" && define.amd) {
    // Export JSON 3 for asynchronous module loaders.
    define("json", ["exports"], Module);
  } else {
    // Export for CommonJS environments, web browsers, and JavaScript engines.
    Module(typeof exports == "object" && exports || this.JSON || (this.JSON = {}));
  }
})(this, function (exports) {
  // Convenience aliases.
  var getClass = {}.toString, hasOwnProperty = {}.hasOwnProperty, forEach, stringifySupported, parseSupported;

  // Feature tests to determine whether the native `JSON.stringify` and `parse`
  // implementations are spec-compliant. Based on work by <NAME>.
  stringifySupported = typeof exports.stringify == "function";
  parseSupported = typeof exports.parse == "function";
  (function () {
    var serialized = '{"result":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}', toJSON, original, value;
    // Test `JSON.stringify`.
    if (stringifySupported) {
      // An object with a custom `toJSON` method.
      toJSON = function toJSON() {
        return 1;
      };
      toJSON.toJSON = toJSON;
      try {
        switch (false) {
          // Firefox 3.1b1 and 2 serialize string, number, and boolean
          // primitives as object literals.
          case exports.stringify(0) === "0":
          // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object
          // literals.
          case exports.stringify(new (0).constructor()) === "0":
          case exports.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 exports.stringify(getClass) === void 0:
          // IE 8 serializes `undefined` as `"undefined"`.
          case exports.stringify(void 0) === void 0:
          // Safari 5.1.2 will throw an error if the `value` argument is
          // omitted, but correctly returns `undefined` for the above test.
          case exports.stringify() === void 0:
          // 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 exports.stringify(toJSON) === "1":
          case exports.stringify([toJSON]) == "[1]":
          // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of
          // `"[null]"`.
          case exports.stringify([void 0]) == "[null]":
          // YUI 3.0.0b1 fails to serialize `null` literals.
          case exports.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 exports.stringify([void 0, getClass, null]) == "[null,null,null]":
          // Simple serialization test. FF 3.1b1 uses Unicode escape sequences
          // where character escape codes are required (e.g., `\b` => `\u0008`).
          case exports.stringify({ "result": [toJSON, 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 exports.stringify(null, toJSON) === "1":
          case exports.stringify([1, 2], null, 1) == "[\n 1,\n 2\n]":
          // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly
          // serialize extended years. Safari < 2.0.2 restricts date time values
          // to the range `[(-2 ** 31), (2 ** 31) - 1]`, so the serialization
          // tests will fail in case JSON 3 is loaded twice.
          case (toJSON = new Date(-8.64e15)).getUTCFullYear() != -271821 || exports.stringify(toJSON) == '"-271821-04-20T00:00:00.000Z"':
          // The milliseconds are optional in ES 5, but required in 5.1.
          case (toJSON = new Date(8.64e15)).getUTCFullYear() != 275760 || exports.stringify(toJSON) == '"+275760-09-13T00:00:00.000Z"':
            stringifySupported = false;
        }
      } catch (exception) {
        stringifySupported = false;
      }
    }
    // Test `JSON.parse`.
    if (parseSupported) {
      try {
        // FF 3.1b1, 2 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 (exports.parse("0") === 0 && !exports.parse(false)) {
          // Simple parsing test.
          value = exports.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 = !exports.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 = exports.parse("+1") != 1 && exports.parse("01") != 1;
              } catch (exception) {}
            }
          }
        }
      } catch (exception) {
        parseSupported = false;
      }
    }
  })();

  // **hasOwnProperty** determines if a property is a direct property of the given
  // object. Delegates to the native *hasOwnProperty* method, if available.
  if (typeof hasOwnProperty != "function") {
    hasOwnProperty = (function () {
      // Capture a reference to the top-level `Object` constructor.
      var hasOwnProperty, members = {}, constructor = members.constructor;
      if ((members.__proto__ = null, members.__proto__ = {
        // The internal *proto* property cannot be set multiple times in recent
        // versions of Mozilla Firefox and SeaMonkey.
        "toString": 1
      }, members).toString != getClass) {
        // Safari <= 2.0.3 doesn't implement *hasOwnProperty*, but supports the
        // mutable *proto* property.
        hasOwnProperty = function hasOwnProperty(property) {
          // Capture and break the object's prototype chain. The parenthesized
          // expression prevents an unsafe transformation by the Closure
          // Compiler.
          var original = this.__proto__, result = property in (this.__proto__ = null, this);
{'fraction_non_alphanumeric': 0.1318937846512985, 'fraction_numerical': 0.028304639626495477, 'mean_word_length': 2.2233717375969904, 'pattern_counts': {'":': 24, '<': 20, '<?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': '2913853', 'n_tokens_mistral': 4053, 'n_tokens_neox': 3766, 'n_words': 1316}