Given a raw value stored on a Mutagen object, decode and
        return the represented value.
766202
def deserialize(self, mutagen_value):
        
        if self.suffix and isinstance(mutagen_value, six.text_type) \
           and mutagen_value.endswith(self.suffix):
            return mutagen_value[:-len(self.suffix)]
        else:
            return mutagen_value
1086989
def raw_data(self, value):
        """"""
        if value:
            try:
                value = value.read()
            except AttributeError:
                pass
            b64 = base64.b64encode(value.encode('utf-8'))
            self.data = b64.decode('utf-8')
508165
def decode_datavalue(self,
                         datatype: str,
                         datavalue: Mapping[str, object]) -> object:
        
        decode = cast(Callable[[Client, str, Mapping[str, object]], object],
                      self.datavalue_decoder)
        return decode(self, datatype, datavalue)
1195536
def encode(self, value):
        
        if self.decode_responses and isinstance(value, bytes):
            value = value.decode(self.encoding)
        elif not self.decode_responses and isinstance(value, str):
            value = value.encode(self.encoding)
        return value
995061
def gen_decode(iterable):
        ""
        sync = False
        for b in iterable:
            if sync and b & 0xE0:
                warn("Invalid unsynched data", Warning)
            if not (sync and b == 0x00):
                yield b
            sync = (b == 0xFF)
1130163
def from_raw(self, rval: RawValue, jptr: JSONPointer = "") -> Value:
        """"""
        def convert(val):
            if isinstance(val, list):
                res = ArrayValue([convert(x) for x in val])
            elif isinstance(val, dict):
                res = ObjectValue({x: convert(val[x]) for x in val})
            else:
                res = val
            return res
        return convert(rval)
808198
def _decode_v2(value):
    
    if re.search(r'(?<!\$):', value):
        raise ValueError("Unescaped ':' in the encoded string")

    decode_colons = value.replace('$:', ':')

    if re.search(r'(?<!\$)(\$\$)*\$([^$]|\Z)', decode_colons):
        raise ValueError("Unescaped '$' in encoded string")
    return decode_colons.replace('$$', '$')
879938
def decode(self, value, value_type):
        
        if value_type == 'i':
            return int(value)

        if value_type == 'z':
            value = zlib.decompress(value)
            value_type = 'p'

        if value_type == 'p':
            return pickle.loads(force_bytes(value))

        raise ValueError(
            "Unknown value_type '{}' read from the cache table."
            .format(value_type),
        )
46567
def decode(self, value):
        
        # Use the default value unless the field accepts None types
        has_null_encoder = bool(encode_decode_null in self._decoders)

        if value is None and self._default is not None and not has_null_encoder:
            value = self._default

        for decoder in self._decoders:
            try:
                return decoder(value)
            except ValueError as ex:
                pass

        raise ValueError('Value \'{}\' is invalid. {}'
                         .format(value, ex.message))
381189
def to_primitive(self, value, context=None):
        

        if context and context.get('rel_ids'):
            return value.rid
        else:
            return {'rtype': value.rtype, 'rid': value.rid}
540710
def get_decode_value(self):
        """"""
        if self._store_type == PUBLIC_KEY_STORE_TYPE_HEX:
            value = bytes.fromhex(self._value)
        elif self._store_type == PUBLIC_KEY_STORE_TYPE_BASE64:
            value = b64decode(self._value)
        elif self._store_type == PUBLIC_KEY_STORE_TYPE_BASE85:
            value = b85decode(self._value)
        elif self._store_type == PUBLIC_KEY_STORE_TYPE_JWK:
            # TODO: need to decide on which jwk library to import?
            raise NotImplementedError
        else:
            value = self._value
        return value
670414
def coerce(cls, key, value):
        """"""

        if isinstance(value, string_types):
            value = value.strip()
            if value[0] == '[':  # It's json encoded, probably
                try:
                    value = json.loads(value)
                except ValueError:
                    raise ValueError("Failed to parse JSON: '{}' ".format(value))
            else:
                value = value.split(',')

        if not value:
            value = []

        self = MutationList((MutationObj.coerce(key, v) for v in value))
        self._key = key
        return self
277124
def set(self, mutagen_file, value):
        
        self.store(mutagen_file, self.serialize(value))
124686
function raw(obj) {
  const result = {}
  for (const key in obj) {
    const value = obj[key]
    if (value !== null && value !== undefined) {
      result[key] = value.toString()
    }
  }
  return result
}
1172188
def encode(cls, value):
        
        try:
            if float(value) + 0 == value:
                return repr(value)
        except (TypeError, ValueError):
            pass

        raise InvalidValue('not a float')
1140669
def from_bytes(self, raw):
        ''''''
        if len(raw) < 4:
            raise NotEnoughDataError("Not enough bytes ({}) to reconstruct a Null object".format(len(raw)))
        fields = struct.unpack('=I', raw[:4])
        self._af = fields[0]
        return raw[4:]
331283
def decode_uuid(value):
    """"""
    return uuid.UUID(bytes=bytes(bytearray(ffi.unpack(value.data, 16))))