Deserialize input value to valid Property value

        This method uses the Property :code:`deserializer` if available.
        Otherwise, it uses :code:`from_json`. Any keyword arguments are
        passed through to these methods.
175616
def deserialize(self, value, **kwargs):                                    #pylint: disable=unused-argument
        
        kwargs.update({'trusted': kwargs.get('trusted', False)})
        if self.deserializer is not None:
            return self.deserializer(value, **kwargs)
        if value is None:
            return None
        return self.from_json(value, **kwargs)
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
121787
def fromJSON(value):
        
        j = json.loads(value)
        v = GPDataFile()
        if "defaultValue" in j:
            v.value = j['defaultValue']
        else:
            v.value = j['value']
        if 'paramName' in j:
            v.paramName = j['paramName']
        elif 'name' in j:
            v.paramName = j['name']
        return v
342847
def deserialize(self, data):
        '''
        
        '''
        ct_in_map = {
            'application/x-www-form-urlencoded': self._form_loader,
            'application/json': salt.utils.json.loads,
            'application/x-yaml': salt.utils.yaml.safe_load,
            'text/yaml': salt.utils.yaml.safe_load,
            # because people are terrible and don't mean what they say
            'text/plain': salt.utils.json.loads
        }

        try:
            # Use cgi.parse_header to correctly separate parameters from value
            value, parameters = cgi.parse_header(self.request.headers['Content-Type'])
            return ct_in_map[value](tornado.escape.native_str(data))
        except KeyError:
            self.send_error(406)
        except ValueError:
            self.send_error(400)
558570
def fromJSON(value):
        
        j = json.loads(value)
        v = GPDouble()
        if "defaultValue" in j:
            v.value = j['defaultValue']
        else:
            v.value = j['value']
        if 'paramName' in j:
            v.paramName = j['paramName']
        elif 'name' in j:
            v.paramName = j['name']
        return v
780341
def _deserialize(type, value)
      case type.to_sym
      when :DateTime
        DateTime.parse(value)
      when :Date
        Date.parse(value)
      when :String
        value.to_s
      when :Integer
        value.to_i
      when :Float
        value.to_f
      when :BOOLEAN
        if value.to_s =~ /\A(true|t|yes|y|1)\z/i
          true
        else
          false
        end
      when :Object
        # generic object (usually a Hash), return directly
        value
      when /\AArray<(?<inner_type>.+)>\z/
        inner_type = Regexp.last_match[:inner_type]
        value.map { |v| _deserialize(inner_type, v) }
      when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
        k_type = Regexp.last_match[:k_type]
        v_type = Regexp.last_match[:v_type]
        {}.tap do |hash|
          value.each do |k, v|
            hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
          end
        end
      else # model
        temp_model = TelestreamCloud::Qc.const_get(type).new
        temp_model.build_from_hash(value)
      end
    end
855777
def _deserialize_class(cls, input_cls_name, trusted, strict):
        """"""
        if not input_cls_name or input_cls_name == cls.__name__:
            return cls
        if trusted and input_cls_name in cls._REGISTRY:
            return cls._REGISTRY[input_cls_name]
        if strict:
            raise ValueError(
                'Class name {} from deserialization input dictionary does '
                'not match input class {}'.format(input_cls_name, cls.__name__)
            )
        return cls
96614
def _from_dict(cls, values, value_filter, dictionary, allow_unset=True):
        """"""
        if not isinstance(dictionary, Mapping):
            raise TypeError('dictionary should be mapping')
        obj = cls(values, value_filter)
        values = obj.__values
        for name, value in dictionary.items():
            if not isinstance(name, string_types):
                raise TypeError('Key %s is not a string' % str(name))
            setattr(values, name, value)
        if obj.missing and not allow_unset:
            raise ValueError('%d value(s) are unset' % len(obj.missing))
        return obj
998874
private void deserializeMethod(ObjectInput stream) throws IOException, ClassNotFoundException {
        MethodValues method = null;
        if (SERIALIZATION_V2 == getDeserializationVersion()) {
            method = MethodValues.find(readByteArray(stream));
        } else {
            method = MethodValues.find((String) stream.readObject());
        }
        if (null == method) {
            throw new IOException("Missing method");
        }
        setMethod(method);
    }
1166819
def deserialize_by_field(value, field):
    
    if isinstance(field, forms.DateTimeField):
        value = parse_datetime(value)
    elif isinstance(field, forms.DateField):
        value = parse_date(value)
    elif isinstance(field, forms.TimeField):
        value = parse_time(value)
    return value
234615
def deserialize_object(self, attr, **kwargs):
        
        if attr is None:
            return None
        if isinstance(attr, ET.Element):
            # Do no recurse on XML, just return the tree as-is
            return attr
        if isinstance(attr, basestring):
            return self.deserialize_basic(attr, 'str')
        obj_type = type(attr)
        if obj_type in self.basic_types:
            return self.deserialize_basic(attr, self.basic_types[obj_type])
        if obj_type is _long_type:
            return self.deserialize_long(attr)

        if obj_type == dict:
            deserialized = {}
            for key, value in attr.items():
                try:
                    deserialized[key] = self.deserialize_object(
                        value, **kwargs)
                except ValueError:
                    deserialized[key] = None
            return deserialized

        if obj_type == list:
            deserialized = []
            for obj in attr:
                try:
                    deserialized.append(self.deserialize_object(
                        obj, **kwargs))
                except ValueError:
                    pass
            return deserialized

        else:
            error = "Cannot deserialize generic object with type: "
            raise TypeError(error + str(obj_type))
989442
function deserialize (value, columnDefinitions) {

    var deserializedValue = {};
    
    try {
        Validate.notNull(columnDefinitions, 'columnDefinitions');
        Validate.isObject(columnDefinitions);

        Validate.notNull(value);
        Validate.isObject(value);

        for (var property in value) {
            var columnName = storeHelper.getColumnName(columnDefinitions, property); // this helps us deserialize with proper case for the property name
            deserializedValue[columnName] = deserializeMember(value[property], storeHelper.getColumnType(columnDefinitions, property));
        }
        
    } catch (error) {
        throw new verror.VError(error, 'Failed to deserialize value ' + JSON.stringify(value) + '. Column definitions: ' + JSON.stringify(columnDefinitions));
    }

    return deserializedValue;
}
1019464
def fromJSON(value):
        
        j = json.loads(value)
        v = GPBoolean()
        if "defaultValue" in j:
            v.value = j['defaultValue']
        else:
            v.value = j['value']
        if 'paramName' in j:
            v.paramName = j['paramName']
        elif 'name' in j:
            v.paramName = j['name']
        return v
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))
223173
def _deserialize(self, value, attr, obj):
        
        if value is None:
            return None

        try:
            attribute_elements = [attr_element.split(",") for attr_element in obj.getlist(attr)]
            attribute_params = [param for attr_param in attribute_elements for param in attr_param]

            return PrintableList(super(QueryStringList, self)._deserialize(attribute_params, attr, obj))
        except ValueError:
            raise ValidationError("Invalid query string list argument")
998140
def deserialize(self, to_deserialize: PrimitiveJsonType) \
            -> Optional[Union[SerializableType, List[SerializableType]]]:
        
        if to_deserialize is None:
            # Implements #17
            return None
        elif isinstance(to_deserialize, List):
            deserialized = []
            for item in to_deserialize:
                item_deserialized = self.deserialize(item)
                deserialized.append(item_deserialized)
            return deserialized
        else:
            mappings_not_set_in_constructor = []    # type: List[PropertyMapping]

            init_kwargs = dict()    # type: Dict[str, Any]
            for mapping in self._property_mappings:
                if mapping.object_constructor_parameter_name is not None:
                    value = mapping.serialized_property_getter(to_deserialize)
                    if not (mapping.optional and value is None):
                        decoded_value = self._deserialize_property_value(value, mapping.deserializer_cls)
                        if isinstance(decoded_value, list):
                            collection = mapping.collection_factory(decoded_value)
                            decoded_value = collection

                        argument = mapping.object_constructor_argument_modifier(decoded_value)
                        init_kwargs[mapping.object_constructor_parameter_name] = argument
                else:
                    mappings_not_set_in_constructor.append(mapping)

            decoded = self._deserializable_cls(**init_kwargs)
            assert type(decoded) == self._deserializable_cls

            for mapping in mappings_not_set_in_constructor:
                assert mapping.object_constructor_parameter_name is None
                if mapping.serialized_property_getter is not None and mapping.object_property_setter is not None:
                    value = mapping.serialized_property_getter(to_deserialize)
                    if not (mapping.optional and value is None):
                        decoded_value = self._deserialize_property_value(value, mapping.deserializer_cls)
                        if isinstance(decoded_value, list):
                            collection = mapping.collection_factory(decoded_value)
                            decoded_value = collection

                        mapping.object_property_setter(decoded, decoded_value)

            return decoded
909519
def deserialize_enum(data, enum_obj):
        
        if isinstance(data, enum_obj):
            return data
        if isinstance(data, Enum):
            data = data.value
        if isinstance(data, int):
            # Workaround. We might consider remove it in the future.
            # https://github.com/Azure/azure-rest-api-specs/issues/141
            try:
                return list(enum_obj.__members__.values())[data]
            except IndexError:
                error = "{!r} is not a valid index for enum {!r}"
                raise DeserializationError(error.format(data, enum_obj))
        try:
            return enum_obj(str(data))
        except ValueError:
            for enum_value in enum_obj:
                if enum_value.value.lower() == str(data).lower():
                    return enum_value
            # We don't fail anymore for unknown value, we deserialize as a string
            _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj)
            return Deserializer.deserialize_unicode(data)