Converts the value to one that is safe to store on a record within
        the record values dictionary

        :param      value | <variant>

        :return     <variant>
332204
def store(self, value, context=None):
        
        if isinstance(value, (str, unicode)) and self.testFlag(self.Flags.Encrypted):
            value = orb.system.security().encrypt(value)

        return super(AbstractStringColumn, self).store(value, context=context)
297049
def FoldValue(self, value):
    
    if value is False and self._data_type_definition.false_value is not None:
      return self._data_type_definition.false_value

    if value is True and self._data_type_definition.true_value is not None:
      return self._data_type_definition.true_value

    raise ValueError('No matching True and False values')
707503
def to_bool(self, value):
        

        try:
            value = value.lower()
        except:
            pass
        try:
            value = value.encode('utf-8')
        except:
            pass
        try:
            value = int(value)
        except:
            pass
        if value in ('true', 1):
            return True
        else:
            return False
983903
def format_atomic(value):
    
    # Perform escaping
    if isinstance(value, str):
        if any(r in value for r in record.RESERVED_CHARS):
            for k, v in record.ESCAPE_MAPPING:
                value = value.replace(k, v)
    # String-format the given value
    if value is None:
        return "."
    else:
        return str(value)
1014801
def diff_safe(cls, value):
        """"""
        if isinstance(value, Frame):
            return {'_str': str(value), '_id': value._id}
        elif isinstance(value, (list, tuple)):
            return [cls.diff_safe(v) for v in value]
        return value
397545
def config(self, value: dict) -> None:
        

        self._config = value or {}
        validate_config('verifier', self._config)
18724
def invalidate_value(
        cls,
        value: Any,
        exc: Type[Exception]=EncodingTypeError,
        msg: Optional[str]=None,
    ) -> None:
        
        raise exc(
            "Value `{rep}` of type {typ} cannot be encoded by {cls}{msg}".format(
                rep=abbr(value),
                typ=type(value),
                cls=cls.__name__,
                msg="" if msg is None else (": " + msg),
            )
        )
666305
def distinct_on(self, value):
        
        if isinstance(value, str):
            value = [value]
        self._distinct_on[:] = value
87539
def encode(cls, value):
        
        try:
            coerced = [str(v) for v in value]
            if coerced == value:
                return ",".join(coerced).encode(cls._encoding) if len(
                    value) > 0 else None
        except TypeError:
            pass

        raise InvalidValue('not a list of strings')
86818
def to_simple(self, value, **options):  # nolint
        "  "

        # (string, unicode)
        if isinstance(value, basestring):
            return smart_unicode(value)

        # (int, long, float, real, complex, decimal)
        if isinstance(value, Number):
            return float(str(value)) if isinstance(value, Decimal) else value

        # (datetime, data, time)
        if isinstance(value, (datetime, date, time)):
            return self.to_simple_datetime(value)

        # (dict, ordereddict, mutable mapping)
        if isinstance(value, collections.MutableMapping):
            return dict(
                (k, self.to_simple(v, **options)) for k, v in value.items())

        # (tuple, list, set, iterators)
        if isinstance(value, collections.Iterable):
            return [self.to_simple(o, **options) for o in value]

        # (None, True, False)
        if value is None or value is True or value is False:
            return value

        if hasattr(value, 'to_simple') and not inspect.isclass(value):
            return self.to_simple(value.to_simple(self), **options)

        if isinstance(value, Model):
            return self.to_simple_model(value, **options)

        return str(value)
1263215
def validate(self, value):
        
        val = value
        if isinstance(val, str):
            #FIXME: unsafe decoding
            val = unicode(value)
        val = super(String, self).validate(val)
        if not isinstance(val, unicode):
            raise ValueError("Not a string: %r" % (value, ))
        return val
1034005
def validate(self, value):
    
    if value is not None and not isinstance(value, self.data_type):
      raise datastore_errors.BadValueError(
          "Property %s must be convertible to a %s instance (%s)" %
          (self.name, self.data_type, value))
    return super(JsonProperty, self).validate(value)
976186
def offset(self, value):
        

        self._query = self._query.skip(value)

        return self
343514
def setValueSafe(self, row, value):
        ''
        try:
            return self.setValue(row, value)
        except Exception as e:
            exceptionCaught(e)
747622
def validate_value(self, value):
        """"""
        if self.readonly:
            raise ValidationError(self.record, "Cannot set readonly field '{}'".format(self.name))
        if value not in (None, self._unset):
            if self.supported_types and not isinstance(value, tuple(self.supported_types)):
                raise ValidationError(self.record, "Field '{}' expects one of {}, got '{}' instead".format(
                    self.name,
                    ', '.join([repr(t.__name__) for t in self.supported_types]),
                    type(value).__name__)
                )
928532
def __stripValue(self, value):
        
        if isinstance(value, str):
            if ( value[0] == '"' and value[-1] == '"' ) or ( value[0] == '[' and value[-1] == ']' ):
                return value[1:-1]
        return value
1172571
def format(self, value):
        
        if not isinstance(value, Arguments):
            value = value.iteritems()
        return dict((k, self.fields[k].format(v)) for k, v in value)