Convert raw input value of the field.
768209
def _converter(self, value):
        """"""
        if not isinstance(value, datetime.date):
            raise TypeError('{0} is not valid date'.format(value))
        return value
907660
def deserialize(self, raw_data, **kwargs):
        """"""
        super(DateTimeField, self).deserialize(raw_data, **kwargs)
        return self.converted
404217
def _convert_entry(self, entry):
        """"""
        result = {}
        for key, value in entry.items():
            if isinstance(value, list):
                result[key] = [self._convert_field(key, val) for val in value]
            else:
                result[key] = self._convert_field(key, value)
        return result
735630
def mrai_to_raw(self, amount):
        

        amount = self._process_value(amount, 'int')

        payload = {"amount": amount}

        resp = self.call('mrai_to_raw', payload)

        return int(resp['amount'])
856889
def validate(self, raw_data, **kwargs):
        
        try:
            converted_data = float(raw_data)
            super(FloatField, self).validate(converted_data, **kwargs)
            return raw_data
        except ValueError:
            raise ValidationException(self.messages['invalid'], repr(raw_data))
1274215
def _deserialize_value(val, raw: false)
      val = val.pack('C*')
      val = @desc.post_process(val) if !raw && @desc.read_processors?
      val
    end
340873
def _get_field(instance, field):
    
    
    value = getattr(instance, field)
    if hasattr(value, 'raw'):
        value = value.raw
    return value
637292
def normalize_field(self, value):
        
        if self.default is not None:
            if value is None or value == '':
                value = self.default
        return value
581441
def convert_field(self, value, conversion):
        """"""
        if isinstance(value, MissingField):
            if conversion is not None:
                value.conversion = conversion
            return value

        return super(FormatterWrapper, self).convert_field(value, conversion)
221228
def _value_data(self, value):
        """"""
        return codecs.decode(
            codecs.encode(self.value_value(value)[1], 'base64'), 'utf8')
97421
public int getRawFieldData(Convert field)
    {
        String strKey = this.getFullKey(field.getFieldName());
        Class<?> classData = field.getField().getDataClass();
        Object objValue = this.getMessage().getNative(strKey);
        try {
            objValue = DataConverters.convertObjectToDatatype(objValue, classData, null);  // I do this just to be careful.
        } catch (Exception ex) {
            objValue = null;
        }
        return field.setData(objValue);
    }
634999
def get_val(source, extract=None, transform=None):
  """"""
  if extract is None:
    raw_value = source
  else:
    raw_value = extract(source)

  if transform is None:
    return raw_value
  else:
    return transform(raw_value)
308182
def format(input, **params):
    
    PARAM_FORMAT_STRING = 'format.string'
    PARAM_FORMAT_INPUT = 'format.input'
    PARAM_RESULT_FIELD = 'result.field'
    IN_DESC_FIELD = 'field'
    IN_DESC_TYPE = 'type'

    format_string = params.get(PARAM_FORMAT_STRING)
    format_inputs = params.get(PARAM_FORMAT_INPUT)
    result_field = params.get(PARAM_RESULT_FIELD)
    for row in input:
        row_input = []
        for desc in format_inputs:
            row_input.append(Converter.convert(row[desc[IN_DESC_FIELD]], desc[IN_DESC_TYPE]))
        row[result_field] = format_string.format(*row_input)
    return input
794593
def to_python(self, value):
        """"""
        if isinstance(value, FileDescriptor):
            return value
        elif isinstance(value, str):
            return FileDescriptor(value)
        elif isinstance(value, dict):
            try:
                path = value['file']
            except KeyError:
                raise ValidationError("dictionary must contain a 'file' element")

            if not isinstance(path, str):
                raise ValidationError("field's file element must be a string")

            size = value.get('size', None)
            if size is not None and not isinstance(size, int):
                raise ValidationError("field's size element must be an integer")

            total_size = value.get('total_size', None)
            if total_size is not None and not isinstance(total_size, int):
                raise ValidationError("field's total_size element must be an integer")

            is_remote = value.get('is_remote', None)
            if is_remote is not None and not isinstance(is_remote, bool):
                raise ValidationError("field's is_remote element must be a boolean")

            file_temp = value.get('file_temp', None)
            if file_temp is not None and not isinstance(file_temp, str):
                raise ValidationError("field's file_temp element must be a string")

            refs = value.get('refs', None)
            if refs is not None and not isinstance(refs, list):
                # TODO: Validate that all refs are strings.
                raise ValidationError("field's refs element must be a list of strings")

            return FileDescriptor(
                path,
                size=size,
                total_size=total_size,
                is_remote=is_remote,
                file_temp=file_temp,
                refs=refs,
            )
        elif not isinstance(value, None):
            raise ValidationError("field must be a FileDescriptor, string or a dict")
1216461
def parse_value(self, value):
        """"""
        parsed = super(IntField, self).parse_value(value)
        if parsed is None:
            return parsed
        return int(parsed)
1344495
def to_python(self, value, context=None):
        """"""
        value = value.copy()
        res = {}
        errors = []
        for field, schema in self._fields.items():
            name = schema.get_attr('name', field)
            if name in value:
                try:
                    res[field] = schema.to_python(
                        value.pop(name),
                        context=context
                    )
                except exceptions.ValidationErrors as ex:
                    self._update_errors_by_exception(errors, ex, name)
        self._raise_exception_when_errors(errors, value)
        res.update(value)
        return res
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)