this helper function is necessary as in case of large json objects, the library standard function causes stack overflow
348785
function uint8ArrayToString(uintArray) {
        var resultString = '',
            i;
        for (i = 0; i < uintArray.byteLength; i++) {
            resultString += String.fromCharCode(uintArray[i]);
        }
        return decodeURIComponent(escape(resultString));
    }
879549
function stack(e) {
  return {
    toString: function() {
      // first line is err.message, which we already show, so start from
      // second line
      return e.stack.substr(e.stack.indexOf('\n'));
    },
    toJSON: function() {
      return stacktrace.parse(e);
    }
  };
}
1239164
function ( json ) {
    pageNotFoundJson = sqsUtil.copy( json );
    pageNotFoundJson.collection = {};
    pageNotFoundJson.error = true;
}
296399
function JsonParserES5(input) {
    // invoke super constructor
    Parser.call(this, input, allTokens, {
            // by default the error recovery / fault tolerance capabilities are disabled
            // use this flag to enable them
            recoveryEnabled: false
        }
    );

    // not mandatory, using <$> (or any other sign) to reduce verbosity (this. this. this. this. .......)
    var $ = this;

    this.RULE("object", function() {
        var object, key

        $.CONSUME(LCurly);

        object = {}

        $.MANY_SEP({
          SEP: Comma, DEF: function () {
            key = $.SUBRULE($.string)
            $.CONSUME(Colon)
            object[key] = $.SUBRULE($.value)
          }
        });

        $.CONSUME(RCurly);

        return object
    });

    this.RULE("array", function() {
        var array

        $.CONSUME(LSquare);

        array = []

        $.MANY_SEP({
          SEP: Comma, DEF: function () {
            array[array.length] = $.SUBRULE($.value);
          }
        });

        $.CONSUME(RSquare);

        return array
    });

    this.RULE("number", function(){
      var result = $.CONSUME(NumberLiteral)
      return Number(result.image)
    })

    this.RULE("string", function(){
      var result = $.CONSUME(StringLiteral)
      return result.image.slice(1, -1)
    })


    this.RULE("value", function() {
        return $.OR([
            {ALT: function() { return $.SUBRULE($.object) }},
            {ALT: function() { return $.SUBRULE($.array) }},
            {ALT: function() { return $.SUBRULE($.string) }},
            {ALT: function() { return $.SUBRULE($.number) }},
            {ALT: function() { $.CONSUME(True) ; return true }},
            {ALT: function() { $.CONSUME(False) ; return false }},
            {ALT: function() { $.CONSUME(Null) ; return null }}
        ]);
    });

    // very important to call this after all the rules have been defined.
    // otherwise the parser may not work correctly as it will lack information
    // derived during the self analysis phase.
    Parser.performSelfAnalysis(this);
}
537369
function(class_json, opts) {
	var options = util.extend({
		javascript: false, // true, false
		scope: '', // directory to look for initial file
		variables: {
			// contains a key->value object with variables to @extends
		}
	}, opts);

	// Stores JSON objects of files that have to be merged together:
	// ["a", "b"]
	var file_list = util.isArray(class_json[indicators.EXTENDS]) ?
		class_json[indicators.EXTENDS] :
		class_json[indicators.EXTENDS] != null ?
			[ class_json[indicators.EXTENDS] ] :
			[];

	// Delete @extends from base_json to avoid infinitive recursion
	delete class_json[indicators.EXTENDS];

	// Push class_json to the path list:
	file_list.push(class_json);

	/*****************************************************************************
	*  Merge file by file
	*****************************************************************************/

	// default config for each file required:
	// set asText = false so we get an object returned
	// set scope = file's directory so there can be relative references
	var json_config = util.defaults({
		asText: false,
		scope: options._as ? path.dirname(file_path) : options.scope,

		// _as is a hack so that we know its we are calling the function recursive
		_as: ANTI_SANITIZER
	}, options);

	// super_json is our output, start by containing first file in array
	var super_json = fromFile(file_list.shift(), json_config);

	// TODO: Figure out when to sanitize super_json hopefully we don't have to
	//   santize all returns. I'm not sure about this, and I'm not sure if we
	//   can even sanitize super_json when we return it.
	//   Is super_json used by anyone recursively?

	while (file_list.length) {
		var json = fromFile(file_list.shift(), json_config);

		merge(super_json, json);
	}

	// If this file is called from the outside eg json_merger.from...
	//   File('file_which_doesnt_extends_another_file.json')
	//   we need to sanitize the file and remove all indicators
	if (options._as != ANTI_SANITIZER) {
		super_json = util.sanitizeValue(super_json);
	}

	/*****************************************************************************
	*  Return super_json
	*****************************************************************************/

	return super_json;
}
895805
function(json) {

    var resArray = [];

    var emitArrayOfObjects = function(json, res) {

        var printValue = function(v) {
            var result = null;
            if (typeof(v) === "function") {
                result = "<![CDATA[";
                result = result + v.toString();
                result = result + "]]>";
            } else {
                result = v;
                if (typeof(v) !== "string") {
                    if (v !== null && typeof(v) !== 'undefined') {
                        result = v.toString();
                    } else {
                        result = "";
                    }
                }
                result = result.replace(/[&]/g, "&amp;");
                result = result.replace(/[<]/g, "&lt;");
                result = result.replace(/[>]/g, "&gt;");
            }
            return result;
        };

        var emitSimple = function(elemName, value, res) {
            res.push(`<${elemName}>`);
            res.push(printValue(value));
            res.push(`</${elemName}>`);
        };

        var emitElement = function(elemName, subElemList, res) {
            if (Array.isArray(subElemList)) {
                subElemList.forEach(function(subElem) {
                    emitElement(elemName, subElem, res);
                });
            } else if (typeof subElemList === 'object' && subElemList !== null) {
                var attrs = [];
                var textValue = "";
                if (subElemList._attrs) {
                    for (var attrName in subElemList._attrs) {
                        if (subElemList._attrs.hasOwnProperty(attrName)) {
                            attrs.push(`${attrName}='${subElemList._attrs[attrName]}'`);
                        }
                    }
                }
                if (subElemList._text) {
                    textValue = subElemList._text;
                } else if (subElemList._cdata) {
                    textValue = `<![CDATA[${subElemList._cdata}]]>`;
                } else if (subElemList.text) {
                    textValue = subElemList.text;
                }
                var attrString = attrs.length > 0 ? attrs.join(" ") : "";
                res.push(attrs.length > 0 ? `<${elemName} ${attrString}>` : `<${elemName}>`);
                emitArrayOfObjects(subElemList, res);
                res.push(textValue);
                res.push(`</${elemName}>`);

            } else {
                emitSimple(elemName, subElemList, res);
            }
        };

        for (var key in json) {
            if (json.hasOwnProperty(key) && key !== '_attrs' && key !== '_cdata' && key !== '_text' && key !== 'text') {
                emitElement(key, json[key], res);
            }
        }
    };

    emitArrayOfObjects(json, resArray);
    return resArray.join("");
}
976267
function maybeJsdomError(error)
{
        if (jsdomErr)
        {
                error.message += '\nJsdom might fail to load because of this error: ' +
                                 jsdomErr.message +
                                 '\n' +
                                 jsdomErr.stack;
        }

        error.jsdomCause = jsdomErr;

        return error;
}
283756
function JSONMinifier() {
  const self = this;
  self.process = ({ output }) => JSON.stringify(JSON.parse(output));
}
185439
function add(item) {
			var newEnd = (end + 1) % BUF_SIZE;

			if(end >= 0 && newEnd === begin) {
				throw Error('Buffer overflow: Buffer exceeded max size: ' + BUF_SIZE);
			}
			
			buffer[newEnd] = item;
			end = newEnd;
		}
19267
function createSymbolSummaryForLib(lib) {
		let file = path.join(unpackedTestresourcesRoot, lib.replace(/\./g, "/"), "designtime/api.json");

		return readJSONFile(file).then(function (apijson) {
			if (!apijson.hasOwnProperty("symbols") || !Array.isArray(apijson.symbols)) {
				// Ignore libraries with invalid api.json content like empty object or non-array "symbols" property.
				return [];
			}
			return apijson.symbols.map(symbol => {
				let oReturn = {
					name: symbol.name,
					kind: symbol.kind,
					visibility: symbol.visibility,
					extends: symbol.extends,
					implements: symbol.implements,
					lib: lib
				};
				// We add deprecated member only when the control is deprecated to keep file size at check
				if (symbol.deprecated) {
					oReturn.deprecated = true;
				}
				collectLists(symbol);
				return oReturn;
			});
		})
	}
272885
def overloaded(self, client_address):
        
        body = {
            'status': False,
            'indexing': False,
            'lastblock': -1,
            'error': 'overloaded',
            'http_status': 429
        }
        body_str = json.dumps(body)

        resp = 'HTTP/1.0 200 OK\r\nServer: BaseHTTP/0.3 Python/2.7.14+\r\nContent-type: text/xml\r\nContent-length: {}\r\n\r\n'.format(len(body_str))
        resp += '<methodResponse><params><param><value><string>{}</string></value></param></params></methodResponse>'.format(body_str)
        return resp
454316
protected function raiseJsonError()
    {
        $code = json_last_error();
        switch ($code) {
            case JSON_ERROR_NONE:
                $message = 'No error';
                break;
            case JSON_ERROR_DEPTH:
                $message = 'Maximum stack depth exceeded';
                break;
            case JSON_ERROR_STATE_MISMATCH:
                $message = 'Underflow or the modes mismatch';
                break;
            case JSON_ERROR_CTRL_CHAR:
                $message = 'Unexpected control character found';
                break;
            case JSON_ERROR_SYNTAX:
                $message = 'Syntax error, malformed JSON';
                break;
            case JSON_ERROR_UTF8:
                $message = 'Malformed UTF-8 characters, possibly incorrectly encoded';
                break;
            default:
                $code = 705;
                $message = 'Unknown error';
                break;
        }
        $env = $this->config->getEnvironment();
        $message = sprintf('json (%s): %d - %s', $env['jsonVersion'], $code, $message);
        throw new RuntimeException($message, $code);
    }
824615
function myParser (size) {
	if (typeof size !== 'number')
		throw new Error('Invalid block size: ' + size)

	function isEnd () {
		return atok.ending ? atok.length - atok.offset : -1
	}

	atok
		.trim()
		.addRule(size, function (data) {
			self.emit('data', data)
		})
		.addRule('', isEnd, function (data) {
			var len = data.length

			if (typeof data === 'string') {
				var lastBlock = data + new Array(size - len + 1).join('0')
			} else {
				var lastBlock = new Buffer(size)
				lastBlock.fill(0, len)
				data.copy(lastBlock, 0)
			}
			self.emit('data', lastBlock)
		})
		.on('end', function () {
			self.emit('end')
		})
}
621492
function Bdecode () {
  // markers
  var DICTIONARY_START = {}
  var LIST_START       = {}

  var Context  = function () {
    var self  = this
    var stack = []

    this.cb = function (o) {
      stack.push(o)
    }
    this.cb_list = function () {
      self.cb(LIST_START)
    }
    this.cb_dict = function () {
      self.cb(DICTIONARY_START)
    }

    this.cb_end = function () {

      // unwind the stack until either a DICTIONARY_START or LIST_START is
      // found, create arr or hash, stick unwound stack on, push arr or hash
      // back onto stack

      var obj       = null
      var tmp_stack = []

      while ((obj = stack.pop()) !== undefined) {
        if (LIST_START === obj) {
          var obj2 = null
          var list = []
          while((obj2 = tmp_stack.pop()) !== undefined) {
            list.push(obj2)
          }
          self.cb(list)
          break
        } else if (DICTIONARY_START === obj) {
          var key = null
          var val = null
          var dic = {}
          while ((key = tmp_stack.pop()) !== undefined && (val = tmp_stack.pop()) !== undefined) {
            dic[key.toString()] = val
          }

          if (key !== undefined && dic[key] === undefined) {
            throw new Error('uneven number of keys and values A')
          }
          self.cb(dic)
          break
        } else {
          tmp_stack.push(obj)
        }
      }
      if (tmp_stack.length > 0) {
        // could this case even occur?
        throw new Error('uneven number of keys and values B')
      }
    }
    this.result = function () {
      return stack
    }
  }

  var self     = this
  var ctx      = new Context()
  var smachine = new BdecodeSMachine(ctx.cb, ctx.cb_list, ctx.cb_dict, ctx.cb_end)

  this.result = function () {
    if (!smachine.consistent()) {
      throw new Error('not in consistent state. More bytes coming?')
    }
    return ctx.result()
  }

  this.decode = function (buf, encoding) {
    smachine.parse(buf, encoding)
  }
}
1343001
function(iStartIndex, iLength) {
			var iSizeLimit;
			if (this._oAggregation) {
				var oInnerListBinding = this._oOriginMO.getBinding(this._sMember);

				//check if the binding is a list binding
				if (oInnerListBinding) {
					var oModel = oInnerListBinding.getModel();
					iSizeLimit = oModel.iSizeLimit;
				}

				var oBindingInfo = this._oOriginMO.getBindingInfo(this._sMember);

				//sanity check for paging exceeds model size limit
				if (oBindingInfo && iStartIndex >= 0 && iLength &&
					iSizeLimit && iLength > iSizeLimit) {
					var bUpdate = false;

					if (iStartIndex != oBindingInfo.startIndex) {
						oBindingInfo.startIndex = iStartIndex;
						bUpdate = true;
					}

					if (iLength != oBindingInfo.length) {
						oBindingInfo.length = iLength;
						bUpdate = true;
					}

					if (bUpdate) {
						this._oAggregation.update(this._oOriginMO, "change");
					}
				}
			}

			return JSONListBinding.prototype._getContexts.apply(this, arguments);
		}
545858
function(functions, payload, error) {
		var payloadLength = payload.readUInt32LE(0);
		var identifierEndPosition = 8 + payload.readUInt32LE(4);
		var identifier = payload.slice(8, identifierEndPosition).toString(module.exports.encoding);
		
		var position = identifierEndPosition;
		
		var response = [ new Buffer(1) /* Status code response */ ];
		if(identifier in functions) {
			var args = [];
			for(; position < payloadLength;) {
				var dataType = payload.readUInt8(position++);
				var dataSize = payload.readUInt32LE(position);
				position += 4;
				var value = undefined;
				switch(dataType) {
					case module.exports.EnumDataType.byte:
						value = payload.readInt8(position);
						position++;
						break;
					case module.exports.EnumDataType.ubyte:
						value = payload.readUInt8(position);
						position++;
						break;
					case module.exports.EnumDataType.short:
						value = payload.readInt16LE(position);
						position += 2;
						break;
					case module.exports.EnumDataType.ushort:
						value = payload.readUInt16LE(position);
						position += 2;
						break;
					case module.exports.EnumDataType.int:
						value = payload.readInt32LE(position);
						position += 4;
						break;
					case module.exports.EnumDataType.uint:
						value = payload.readUInt32LE(position);
						position += 4;
						break;
					case module.exports.EnumDataType.float:
						value = payload.readFloatLE(position);
						position += 4;
						break;
					case module.exports.EnumDataType.double:
						value = payload.readDoubleLE(position);
						position += 8;
						break;
					case module.exports.EnumDataType.string:
						var next = position + dataSize;
						value = payload.slice(position, next).toString(module.exports.encoding);
						position = next;
						break;
					case module.exports.EnumDataType.boolean:
						value = payload.readUInt8(position) > 0;
						position++;
						break;
					case module.exports.EnumDataType.undefined:
						value = undefined;
						break;
					case module.exports.EnumDataType.null:
						value = null;
						break;
					default:
						error(new Error('Unsupported data type argument received from client'));
						response[0].writeUInt8(module.exports.EnumNodeResponse.NodeError, 0);
						return response[0]; // Early exit
				}
				
				args.push(value);
			}
	
			var result = functions[identifier].callback.apply(this, args);
			if(result === undefined) {
				// TODO: Will be removed in future versions. This response type is now handled
				// in the "Okay" response as the "undefined" datatype.
				response[0].writeUInt8(module.exports.EnumNodeResponse.NoResult, 0);
			}
			else {
				response[0].writeUInt8(module.exports.EnumNodeResponse.Okay, 0);
				
				var argtype = functions[identifier].responseType;
				
				if(!argtype) {
					if(result === null) {
						argtype = 'null';
					}
					else {
						switch(typeof result) {
							case 'number':
								if(result === (result|0)) {
									argtype = 'int'; // Default to int for normal numbers
								}
								else {
									argtype = 'float'; // float for anything else
								}
								break;
							case 'string':
								argtype = 'string';
								break;
							case 'boolean':
								argtype = 'boolean';
								break;
							case 'undefined':
								argtype = 'undefiend';
								break;
						}
					}
					functions[identifier].responseType = argtype;
				}
				
				var tempBuf = undefined;
				var dataType = module.exports.EnumDataType[argtype];
				if(dataType !== undefined) {
					switch(dataType) {
						case module.exports.EnumDataType.byte:
							tempBuf = new Buffer(1);
							tempBuf.writeInt8(result, 0);
							break;
						case module.exports.EnumDataType.ubyte:
							tempBuf = new Buffer(1);
							tempBuf.writeUInt8(result, 0);
							break;
						case module.exports.EnumDataType.short:
							tempBuf = new Buffer(2);
							tempBuf.writeInt16LE(result, 0);
							break;
						case module.exports.EnumDataType.ushort:
							tempBuf = new Buffer(2);
							tempBuf.writeUInt16LE(result, 0);
							break;
						case module.exports.EnumDataType.int:
							tempBuf = new Buffer(4);
							tempBuf.writeInt32LE(result, 0);
							break;
						case module.exports.EnumDataType.uint:
							tempBuf = new Buffer(4);
							tempBuf.writeUInt32LE(result, 0);
							break;
						case module.exports.EnumDataType.float:
							tempBuf = new Buffer(4);
							tempBuf.writeFloatLE(result, 0);
							break;
						case module.exports.EnumDataType.double:
							tempBuf = new Buffer(8);
							tempBuf.writeDoubleLE(result, 0);
							break;
						case module.exports.EnumDataType.string:
							tempBuf = new Buffer(result);
							break;
						case module.exports.EnumDataType.boolean:
							tempBuf = new Buffer(1);
							tempBuf.writeUInt8(result ? 0x1 : 0x0, 0);
							break;
						case module.exports.EnumDataType.undefined:
						case module.exports.EnumDataType.null:
							tempBuf = new Buffer(0);
							break;
						default:
							error(new Error('Data type' + dataType + ' has gone unhandled by this node implementation'));
							response[0].writeUInt8(module.exports.EnumNodeResponse.NodeError, 0);
							break;
					}
					
					if(dataType < module.exports.EnumDataType._max) {
						var argHeader = new Buffer(5);
						argHeader.writeUInt8(dataType, 0);
						argHeader.writeUInt32LE(tempBuf.length, 1);
						response.push(argHeader);
						response.push(tempBuf);
					}
				}
				else {
					error(new Error('Unsupported data type returned from nodesocket function'));
					response[0].writeUInt8(module.exports.EnumNodeResponse.NodeError, 0);
				}
			}
		}
		else {
			response[0].writeUInt8(module.exports.EnumNodeResponse.InvalidFunction, 0);
		}
	
		return makeBufferPosResponse(Buffer.concat(response), position);
	}
416250
function () {
				this.getRouter().getRoute("apiId").attachPatternMatched(this._onTopicMatched, this);

				// BPC: 1780339157 - There are cases where we have more than 100 method entries so we need to increase
				// the default model size limit.
				this._oModel = new JSONModel();
				this._oModel.setSizeLimit(10000);

				this._oContainerPage = this.getView().byId("apiDetailPageContainer");
			}