Deserialises the given compact JSON into an element.

        >>> deserialiser = CompactJSONDeserialiser()
        >>> deserialiser.deserialise('["string", null, null, "Hi"]')
        String(content='Hi')
504089
def deserialise(self, content) -> Element:
        

        content = json.loads(content)
        if not isinstance(content, list):
            raise ValueError('Given content was not compact JSON refract')

        return self.deserialise_element(content)
615498
@Override
    public Element[] deserialize(final JsonElement json, final Type typeOfT,
                                 final JsonDeserializationContext context) {

        final Element[] elements;

        if (json.isJsonObject()) {
            elements = new Element[json.getAsJsonObject().entrySet().size()];
            int i = 0;
            for (final Entry<String, JsonElement> elem : json.getAsJsonObject().entrySet()) {
                elements[i] = new Element();
                elements[i].setKey(elem.getKey());
                elements[i].setValue(elem.getValue().getAsString());
                i++;
            }
        } else {
            throw new JsonParseException("Unexpected data: " + json.toString());
        }
        return elements;
    }
803928
function deserialize(json) {
        var data, deserialized;

        var includedMap = {};
        each(json.included, function(value) {
            var key = value.type + '-' + value.id;
            includedMap[key] = value;
        });

        if (isArray(json.data)) {
            data = map(
                json.data,
                function(record) {
                    populateRelatedFields(record, includedMap);
                    return flatten(record);
                }
            );
        }
        else if (isObject(json.data)) {
            populateRelatedFields(json.data, includedMap);
            data = flatten(json.data);
        }

        deserialized = {
            data: data,
            jsonapi: json.jsonapi || {}
        };

        if (json.meta) {
            deserialized.meta = json.meta;
        }

        if (json.errors) {
            deserialized.errors = json.errors;
        }

        if (json.links) {
            deserialized.links = json.links;
        }

        return deserialized;
    }
838217
public static Concept deserialiseConcept(String s) {
        if(unmarshaller == null) init();
        try {
            Object res = unmarshaller.unmarshal(new ByteArrayInputStream(s.getBytes()));
            return (Concept) res;
        } catch(JAXBException e) {
            log.error("There was a problem deserialising a concept. JAXB threw an exception.", e);
            throw new RuntimeException(e);
        }
    }
1041210
def from_json(json, mapper = nil)
      mapper = self.class.mapper if mapper.nil?
      deserialize(mapper, json)
    end
820857
function fromJSON(json, into) {
  var form;

  // ensure the items are wrapped as atoms (with parents) all the way down
  if(Array.isArray(json)) {
    form = into || list();
    json.forEach(function(elem) {
      form.push(fromJSON(elem));
    });
  }
  else if(isPrimitive(json) || (isToken(json) && !isAtom(json))) {
    form = atom(json);
  }
  else if(isList(json) || isAtom(json)) {
    // nothing to do:
    form = json;
  }
  else {
      throw new Error('Unsupported element type in fromJSON: ' + json +
                  ' (type is \'' + typeof json + '\')');
  }

  return form;
}
1066640
def deserialize_json(cls, serialized_json):
        '''
        '''
        serialized = json.loads(serialized_json)
        return Macaroon.from_dict(serialized)
1200117
public static Object deserialize(String json, TypeReference<?> typeReference) throws SerializationException {
		try {
			logger.debug("Json string to deserialize {} ", json);
			return mapper.readValue(json, typeReference);
		} catch (IOException e) {
			logger.error("SerializationException {}", e.getMessage());
			SerializationException serializationException = new SerializationException(e);
			throw serializationException;
		}
	}
733582
def deserialize(cls, value, *args, **kwargs):
        

        if isinstance(value, cls.TYPE):
            return value
        elif is_null(value):
            return None
        else:
            return value
1095646
function __deserializeType(buffer, start, options) {
	let length = 2;
	let end = start + length;
	let type = null;

	
	if ( (buffer.byteLength - start) >= length ) {
		let typeData = new Uint8Array(buffer, start, length);
		Object.entries(TYPE_HEADER).forEach(([headerKey, headerVal]) => {
			let headerData = new Uint8Array(headerVal);
			if ((typeData[0] === headerData[0]) && (typeData[1] === headerData[1])) {
				type = headerKey.toLowerCase();
			}
		});
	}
	return { anchor: end, value: type };
}
1330136
function deserialiseRequest (serialised) {
  var options
  var url

  if (typeof serialised === 'string') {
    options = JSON.parse(serialised)
    url = options.url
  } else if (typeof serialised === 'object') {
    options = serialised
    url = options.url
  } else {
    throw new Error('Expecting serialised request to be a string or object')
  }

  const request = new Request(url, options)

  const properties = {
    context: {
      enumerable: true,
      value: options.context
    }
  }

  const methods = Object.keys(BodyTypes).reduce(function (obj, key) {
    const methodName = BodyMethods[key]
    obj[methodName] = {
      enumerable: true,
      value: function () {
        if (request.bodyUsed) {
          return Promise.reject(new TypeError('Already used'))
        }
        request.bodyUsed = true
        return Promise.resolve(remakeBody(options.__body, key))
      }
    }
    return obj
  }, properties)

  Object.defineProperties(request, methods)

  return request
}
226242
public Object deserialise(final File file)
	{
		if (file == null)
			throw new IllegalArgumentException("Null argument passed to deserialise!");
		if (!file.exists())
			throw new IllegalArgumentException("File does not exist: " + file);

		final Unmarshaller unmarshaller = getUnmarshaller();

		try
		{
			final Object obj = unmarshaller.unmarshal(file);

			if (obj == null)
				throw new RuntimeException("Malformed XML from " + file);
			else
				return obj;
		}
		catch (JAXBException e)
		{
			throw new JAXBRuntimeException("deserialisation", e);
		}
	}
1351217
def deserialize(type_, value=None, **kwargs):
    ''''''
    if not isinstance(type_, str):
        return type_
    des = deserializer(type_, **kwargs)
    if value is None:
        return des
    return des(value)
795622
private Array _deserializeArray(Element el) throws ConverterException {
	Array array = new ArrayImpl();

	NodeList list = el.getChildNodes();
	int len = list.getLength();
	for (int i = 0; i < len; i++) {
	    Node node = list.item(i);
	    if (node instanceof Element) try {
		array.append(_deserialize((Element) node));
	    }
	    catch (PageException e) {
		throw toConverterException(e);
	    }

	}
	return array;
    }
470828
function compact(source) {
    if (!source) return null;

    if (isArray(source))
        return compactArray(source);

    if (typeof source == 'object')
        return compactObject(source);

    return source;
}
1191516
function deserialize(str) {
  let dlen = 0;

  if (str.length < 8 || str.length > 90)
    throw new Error('Invalid bech32 string length.');

  while (dlen < str.length && str[(str.length - 1) - dlen] !== '1')
    dlen++;

  const hlen = str.length - (1 + dlen);

  if (hlen < 1 || dlen < 6)
    throw new Error('Invalid bech32 data length.');

  dlen -= 6;

  const data = Buffer.allocUnsafe(dlen);

  let chk = 1;
  let lower = false;
  let upper = false;
  let hrp = '';

  for (let i = 0; i < hlen; i++) {
    let ch = str.charCodeAt(i);

    if (ch < 0x21 || ch > 0x7e)
      throw new Error('Invalid bech32 character.');

    if (ch >= 0x61 && ch <= 0x7a) {
      lower = true;
    } else if (ch >= 0x41 && ch <= 0x5a) {
      upper = true;
      ch = (ch - 0x41) + 0x61;
    }

    hrp += String.fromCharCode(ch);
    chk = polymod(chk) ^ (ch >> 5);
  }

  chk = polymod(chk);

  let i;
  for (i = 0; i < hlen; i++)
    chk = polymod(chk) ^ (str.charCodeAt(i) & 0x1f);

  i++;

  while (i < str.length) {
    const ch = str.charCodeAt(i);
    const v = (ch & 0x80) ? -1 : TABLE[ch];

    if (ch >= 0x61 && ch <= 0x7a)
      lower = true;
    else if (ch >= 0x41 && ch <= 0x5a)
      upper = true;

    if (v === -1)
      throw new Error('Invalid bech32 character.');

    chk = polymod(chk) ^ v;

    if (i + 6 < str.length)
      data[i - (1 + hlen)] = v;

    i++;
  }

  if (lower && upper)
    throw new Error('Invalid bech32 casing.');

  if (chk !== 1)
    throw new Error('Invalid bech32 checksum.');

  return [hrp, data.slice(0, dlen)];
}
1253330
function stringJSON2JSON (doc, compact = false) {
  if (!doc || (typeof doc !== 'string' && typeof doc !== 'object')) {
    throw new TypeError('Argument must be a string or object, and not empty: ' + doc)
  }

  let obj = doc
  if (typeof doc === 'string') {
    obj = JSON.parse(doc)
  }

  return JSON.stringify(obj, undefined, compact ? undefined : 2)
}