Method to decompress anything but array
@private
@param jsonCopy
@returns {*}
553136
function _decompressOther(jsonCopy) {
    var oKeys, str, sKey;

    oKeys = JSON.parse(JSON.stringify(jsonCopy._));
    delete jsonCopy._;
    str = JSON.stringify(jsonCopy);
    for (sKey in oKeys) {
      if (oKeys.hasOwnProperty(sKey)) {
        str = str.replace(new RegExp('"' + sKey + '"', 'g'), '"' + oKeys[sKey] + '"');
      }
    }
    return str;
  }
460662
function decompressSessionData(objData) {
    let amorphicOptions = AmorphicContext.amorphicOptions;
    if (amorphicOptions.compressSession && objData.data) {
        let buffer = new Buffer(objData.data);

        return zlib.inflateSync(buffer);
    }

    return objData;
}
1253549
@Override
    public final byte[] decompress(byte[] compressed) {
        Assert.notNull(compressed, "compressed bytes cannot be null.");

        try {
            return doDecompress(compressed);
        } catch (IOException e) {
            throw new CompressionException("Unable to decompress bytes.", e);
        }
    }
590682
def compress(obj):
    """"""
    return json.dumps(obj, sort_keys=True, separators=(',', ':'),
                      cls=CustomEncoder)
1318361
function shallowCopy(src, dst) {
  if (isArray(src)) {
    dst = dst || [];

    for (var i = 0, ii = src.length; i < ii; i++) {
      dst[i] = src[i];
    }
  } else if (isObject(src)) {
    dst = dst || {};

    for (var key in src) {
      if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
        dst[key] = src[key];
      }
    }
  }

  return dst || src;
}
1194031
@Override
  public JsonArray deepCopy() {
    if (!elements.isEmpty()) {
      JsonArray result = new JsonArray(elements.size());
      for (JsonElement element : elements) {
        result.add(element.deepCopy());
      }
      return result;
    }
    return new JsonArray();
  }
218495
def _convert_dict_to_json(array):
    
    return json.dumps(
        array,
        skipkeys=False,
        allow_nan=False,
        indent=None,
        separators=(",", ":"),
        sort_keys=True,
        default=lambda o: o.__dict__,
    )
1096370
function LZ4_uncompress (input, options) {
	var output = []
	var decoder = new Decoder(options)

	decoder.on('data', function (chunk) {
		output.push(chunk)
	})

	decoder.end(input)

	return Buffer.concat(output)
}
1009941
function (src, dest, content, fileObject) {
						var files = {};

						_.each(content, function (v, k) {
							var file = fileObject.orig.dest + '/' + k + '.json';

							files[file] = JSON.stringify(v);
						});

						return files;
					}
400675
function decompressResponse (res) {
  var encoding = lowercase(res.headers['content-encoding']);
  var isCompressed = ['gzip', 'compress', 'deflate'].indexOf(encoding) >= 0;

  if (isCompressed) {
    // The response is compressed, so add decompression middleware to the stream
    res.pipe(zlib.createUnzip());

    // Remove the content-encoding header, to prevent double-decoding
    delete res.headers['content-encoding'];
  }
}
1139670
@SuppressWarnings("unchecked")
  private Map<String, Object> convertToMap(Object jsonDocument) {
    Map<String, Object> jsonMap = new LinkedHashMap<>();

    // Document is a text block
    if (!(jsonDocument instanceof JSONObject)) {
      jsonMap.put("content", jsonDocument);
      return jsonMap;
    }

    JSONObject obj = (JSONObject) jsonDocument;
    for (String key : obj.keySet()) {
      Object value = obj.get(key);

      if (value instanceof JSONObject) {
        value = convertToMap(value);
      } else if (value instanceof JSONArray) {
        ArrayList<Map<String, Object>> collection = new ArrayList<>();

        for (Object element : ((JSONArray) value)) {
          collection.add(convertToMap(element));
        }

        value = collection;
      }

      jsonMap.put(key, value);
    }
    return jsonMap;

  }
932431
public static String compress(String input, JSONStyle style) {
		try {
			StringBuilder sb = new StringBuilder();
			new JSONParser(DEFAULT_PERMISSIVE_MODE).parse(input, new CompessorMapper(defaultReader, sb, style));
			return sb.toString();
		} catch (Exception e) {
			return input;
		}
	}
300149
static public Object[] remove(Object[] array, Object key, boolean reallocate)
    {
        if (array != null)
        {
            int length = array.length;

            for (int i = 0; i < length; i += 2)
            {
                Object curKey = array[i];

                if (((curKey != null) && curKey.equals(key)) || (curKey == key))
                {
                    Object[] newArray = array;

                    if (reallocate)
                    {
                        newArray = new Object[length - 2];
                        System.arraycopy(array, 0, newArray, 0, i);
                    }

                    System.arraycopy(array, i + 2, newArray, i, length - i - 2);

                    if (!reallocate)
                    {
                        array[length - 1] = null;
                        array[length - 2] = null;
                    }

                    return newArray;
                }
            }
        }

        return array;
    }
63887
private static String jsonEncode(Object object) throws IOException {
      
      ObjectMapper mapper = new ObjectMapper();
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      try {
         mapper.writeValue(outputStream, object);
         return new String(outputStream.toByteArray());
      } catch (JsonGenerationException e) {
         logger.severe("unable encode");
         throw new IOException(e);
      } catch (JsonMappingException e) {
         logger.severe("unable encode");
         throw new IOException(e.getMessage());
      }
      
   }
307323
def jsonify(result, format=False):
    '''  '''

    result2 = result.copy()
    if format:
        return json.dumps(result2, sort_keys=True, indent=4)
    else:
        return json.dumps(result2, sort_keys=True)
67153
private <X> void copy(X[] elementsCopy) {
		if (!isEmpty()) {
			if (firstIndex < lastIndex) {
				System.arraycopy(elements, firstIndex, elementsCopy, 0, lastIndex - firstIndex);
			} else {
				int firstSize = elements.length - firstIndex;
				System.arraycopy(elements, firstIndex, elementsCopy, 0, firstSize);
				System.arraycopy(elements, 0, elementsCopy, firstSize, lastIndex);
			}
		}
	}
549863
private Object readJSON() throws JSONException {
        switch (read(3)) {
        case zipObject:
            return readObject();
        case zipArrayString:
            return readArray(true);
        case zipArrayValue:
            return readArray(false);
        case zipEmptyObject:
            return new JSONObject();
        case zipEmptyArray:
            return new JSONArray();
        case zipTrue:
            return Boolean.TRUE;
        case zipFalse:
            return Boolean.FALSE;
        default:
            return JSONObject.NULL;
        }
    }