String deserialisation just return the value as a string
482594
def to_python(cls, value, **kwargs):
        """"""
        if not value:
            return ''
        try:
            return str(value)
        except:
            pass
        try:
            return value.encode('utf-8')
        except:
            pass
        raise cls.exception("Cannot deserialize value {0} tostring".format(value))
335000
def _deserialize_property_value(self, to_deserialize: PrimitiveJsonType, deserializer_cls: Type) -> Any:
        
        deserializer = self._create_deserializer_of_type_with_cache(deserializer_cls)
        assert deserializer is not None
        return deserializer.deserialize(to_deserialize)
217828
def _from_string(cls, serialized):
        
        # Allow access to _from_string protected method
        library_key = LibraryLocator._from_string(serialized)  # pylint: disable=protected-access
        parsed_parts = LibraryLocator.parse_url(serialized)

        block_id = parsed_parts.get('block_id', None)
        if block_id is None:
            raise InvalidKeyError(cls, serialized)

        block_type = parsed_parts.get('block_type')
        if block_type is None:
            raise InvalidKeyError(cls, serialized)

        return cls(library_key, parsed_parts.get('block_type'), block_id)
1156048
def string(value) -> str:
        
        return system_json.dumps(Json(value).safe_object(), ensure_ascii=False)
1360843
function __deserializeString(buffer, start, options) {
	let step = 1;
	let dataView = new DataView(buffer);
	let length = dataView.getUint32(start, true);
	start += 4;
	let end = start + length;
	let dataArray = [];
	for (let i = start; i < end; i += step) {
		dataArray.push(dataView.getUint8(i));
	}
	let data = UTF8Decode(Uint8Array.from(dataArray).buffer);
	return { anchor: end, value: data };
}
378851
def convert_value(v):
    
    if v and isinstance(v, six.string_types):
        v = v.strip()
        if (v.startswith('{') and v.endswith('}')) or (v.startswith('[') and v.endswith(']')):
            try:
                return json.loads(v)
            except Exception as e:
                logger.error(e)

    return v
434578
def to_string(s, encoding=None, errors='strict'):
    """"""
    encoding = encoding or 'utf-8'
    if isinstance(s, bytes):
        return s.decode(encoding, errors)
    if not is_string(s):
        s = string_type(s)
    return s
1084022
def _deserialize(cls, key, value, fields):
        
        converter = cls._get_converter_for_field(key, None, fields)
        return converter.deserialize(value)
858516
def deserialize(cls, string):
        """"""

        data = json.loads(string)
        for fieldname, value in data.items():
            data[fieldname] = getattr(cls, fieldname).cache_to_python(value)
        return cls(**data)
1249439
def _deserialize_value(cls, types, value):
        

        if types.main == list and value is not None:
            return cls._deserialize_list(types.sub, value)
        else:
            return cls.deserialize(types.main, value)
821904
def deserialize_property(value: Any) -> Any:
    
    if value == UNKNOWN:
        return None

    # ListValues are projected to lists
    if isinstance(value, struct_pb2.ListValue):
        return [deserialize_property(v) for v in value]

    # Structs are projected to dictionaries
    if isinstance(value, struct_pb2.Struct):
        return deserialize_properties(value)

    # Everything else is identity projected.
    return value
1012574
def to_string(self, value):
        """"""
        if isinstance(value, six.binary_type):
            value = value.decode('utf-8')
        return self.to_json(value)
1134084
def get_as_string(self, key):
        
        value = self.get(key)
        return StringConverter.to_string(value)
893203
def to_json(self, value):
        
        if self._enable_enforce_type:
            value = self.enforce_type(value)
        return super(XMLString, self).to_json(value)
834277
def deserialize_from_http_generics(cls, body_bytes, headers):
        # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any
        
        # Try to use content-type from headers if available
        content_type = None
        if 'content-type' in headers:
            content_type = headers['content-type'].split(";")[0].strip().lower()
        # Ouch, this server did not declare what it sent...
        # Let's guess it's JSON...
        # Also, since Autorest was considering that an empty body was a valid JSON,
        # need that test as well....
        else:
            content_type = "application/json"

        if body_bytes:
            return cls.deserialize_from_text(body_bytes, content_type)
        return None
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
}
1022695
def deserialize(self):
        

        body = super(Deserializer, self).deserialize()

        self.parse(body)
        return self.normalize(body)