Value to be written on register.

        :param value: An integer.
        :raises: IllegalDataValueError when value isn't in range.
345122
def value(self, value):
        
        try:
            struct.pack('>' + conf.TYPE_CHAR, value)
        except struct.error:
            raise IllegalDataValueError

        self._value = value
419493
def validate_value_range(self, value):
        
        low, high = self.value_range
        if not low <= value <= high:
            error('Value [%s] is out of range %s', value, self.value_range)
870006
def encode(self, value):
        ""
        if isinstance(value, Token):
            return value.encoded_value
        elif isinstance(value, bytes):
            return value
        elif isinstance(value, bool):
            # special case bool since it is a subclass of int
            raise DataError("Invalid input of type: 'bool'. Convert to a "
                            "byte, string or number first.")
        elif isinstance(value, float):
            value = repr(value).encode()
        elif isinstance(value, (int, long)):
            # python 2 repr() on longs is '123L', so use str() instead
            value = str(value).encode()
        elif not isinstance(value, basestring):
            # a value we don't know how to deal with. throw an error
            typename = type(value).__name__
            raise DataError("Invalid input of type: '%s'. Convert to a "
                            "byte, string or number first." % typename)
        if isinstance(value, unicode):
            value = value.encode(self.encoding, self.encoding_errors)
        return value
1137582
def _process_value(value):
    
    if not value:
        value = _("Not set")
    # XXX: bad data, e.g. in AS Method field
    elif value == "None":
        value = _("Not set")
    # 0 is detected as the portal UID
    elif value == "0":
        pass
    elif api.is_uid(value):
        value = _get_title_or_id_from_uid(value)
    elif isinstance(value, (dict)):
        value = json.dumps(sorted(value.items()), indent=1)
    elif isinstance(value, (list, tuple)):
        value = sorted(map(_process_value, value))
        value = "; ".join(value)
    elif isinstance(value, unicode):
        value = api.safe_unicode(value).encode("utf8")
    return str(value)
898815
def set(self, value):
        

        if not isinstance(value, int_types):
            raise TypeError(unwrap(
                '''
                %s value must be an integer, not %s
                ''',
                type_name(self),
                type_name(value)
            ))

        self._native = value
        self.contents = int_to_bytes(value, signed=False)
        self._header = None
        if self._indefinite:
            self._indefinite = False
            self.method = 0
        if self._trailer != b'':
            self._trailer = b''
240073
def SetValue(self, identifier, value):
    
    if not isinstance(identifier, py2to3.STRING_TYPES):
      raise TypeError('Identifier not a string type.')

    identifier = identifier.lower()
    self._values[identifier] = value
541897
def validate(self, value):
        
        if value is None:
            if self.required:
                raise ValidationError('{} - None values are not allowed'.format(self.column_name or self.db_field))
        return value
739016
def data(self, value):
        
        if value is not None and not isinstance(value, unicode):
            value = value.decode('utf-8')
        self._data = value
307232
def value(self, value):
        
        # For custom value
        if value not in self.options:
            if len(self.labels) == len(self.options):
                self.options[-1] = value
            else:
                self.options.append(value)

        self._value = value
1172188
def encode(cls, value):
        
        try:
            if float(value) + 0 == value:
                return repr(value)
        except (TypeError, ValueError):
            pass

        raise InvalidValue('not a float')
524085
def WriteUInt256(self, value):
        
        if type(value) is UInt256:
            value.Serialize(self)
        else:
            raise Exception("Cannot write value that is not UInt256")
507476
def value_to_python(self, value):
        
        if not isinstance(value, bytes):
            raise tldap.exceptions.ValidationError("should be bytes")
        if value is None:
            return value
        try:
            return int(value)
        except (TypeError, ValueError):
            raise tldap.exceptions.ValidationError("is invalid integer")
961546
def validate(self, value):
        
        try:
            # trap blank fields here
            if not self.blank or value:
                v = int(value)
                if v < 0:
                    return None
            return value
        except ValueError:
            return None
1233082
def validate_int(value):
    

    if value and not isinstance(value, int):
        try:
            int(str(value))
        except (TypeError, ValueError):
            raise ValidationError('not a valid number')
    return value
1325086
def run(self, value):
        
        if self.pass_ and not value.strip():
            return True

        if not isinstance(value, type(self.asserted_type)):
            self.error = self.error.format(type(value), self.asserted_type)
            return False
        return True
515829
def run(self, value):
        
        if self.pass_ and not value.strip():
            return True

        if (value.strip() if self.strip else value) not in self.given_list:
            self.error = self.error.format(value)
            return False
        return True
1331447
def set_value(self, value):
        
        check_call(_LIB.MXProfileSetCounter(self.handle, int(value)))