value will be an int or float.

        Subclasses may override this method.
760527
def _set_leftMargin(self, value):
        
        diff = value - self.leftMargin
        self.moveBy((diff, 0))
        self.width += diff
915235
def encode(cls, value):
        
        try:
            coerced = int(value)
            if coerced + 0 == value:
                return repr(coerced)

        except (TypeError, ValueError):
            pass

        raise InvalidValue('not an int')
534555
def set_float(val):
    
    out = None
    if not val in (None, ''):
        try:
            out = float(val)
        except ValueError:
            return None
        if numpy.isnan(out):
            out = default
    return out
1247393
def set_t(self, value):
        '''
        
        '''
        if isinstance(value, int) is False:
            raise TypeError("The type of __t must be int.")
        self.__t = value
1001908
def _cast_number(value): # source: https://bitbucket.org/openpyxl/openpyxl/src/93604327bce7aac5e8270674579af76d390e09c0/openpyxl/cell/read_only.py?at=default&fileviewer=file-view-default
    ""
    m = FLOAT_REGEX.search(value)
    if m is not None:
        return float(value)
    return int(value)
1172188
def encode(cls, value):
        
        try:
            if float(value) + 0 == value:
                return repr(value)
        except (TypeError, ValueError):
            pass

        raise InvalidValue('not a float')
693245
def _typed_value(self, value):
        

        if value not in self._value_cache:
            new_value = value
            if is_int(value):
                new_value = int(value)
            elif is_float(value):
                new_value = float(value)
            elif is_bool(value):
                new_value = to_bool(value)
            elif is_none(value):
                new_value = None
            self._value_cache[value] = new_value

        return self._value_cache[value]
509280
def as_int(value, default = 0)
      res = default

      if value
        if value.is_a?(Fixnum)
          res = value
        elsif value.respond_to?(:to_i)
          res = value.to_i
        end
      end

      res
    end
942474
def value(self, value):
        """"""
        dtype = TYPES[type(value)] if self._type is None else self._type

        lib.set_data_type(self._data, dtype)
        lib.set_data_value(self._data, self.clips_value(value))
870761
public void fconst(float value) throws IOException
    {
        if (value == 0 || value == 1 || value == 2)
        {
            super.fconst((int) value);
        }
        else
        {
            ldc(value);
        }
    }
988136
def set_gamma_value(self, value):
        '''
        
        '''
        if isinstance(value, float) is False:
            raise TypeError("The type of __gamma_value must be float.")
        self.__gamma_value = value
1103859
def _cast_float(self, value):
        """"""
        try:
            return float(value)
        except ValueError:
            msg.err("Cannot convert {} to float for line {}.".format(value, self.identifier))
            exit(1)
798899
function isNotFloat(value, message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled && typeof value === 'number' && value % 1 === 0) {
        throw TypeException.expectedType(assertionTypes.IS_NOT_FLOAT, value, '<float>', message, id);
    }
}
1157521
public static Integer toInt(Object value, Integer defaultValue) {
		return convert(Integer.class, value, defaultValue);
	}
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
1340074
def toint(number):
    
    if isinstance(number, float):
        number = round(number, 0)
    return int(number)
317223
def set(self, value):
        

        if not isinstance(value, int_types) and not isinstance(value, str_cls):
            raise TypeError(unwrap(
                '''
                %s value must be an integer or a unicode string, not %s
                ''',
                type_name(self),
                type_name(value)
            ))

        if isinstance(value, str_cls):
            if value not in self._reverse_map:
                raise ValueError(unwrap(
                    '''
                    %s value "%s" is not a valid value
                    ''',
                    type_name(self),
                    value
                ))

            value = self._reverse_map[value]

        elif value not in self._map:
            raise ValueError(unwrap(
                '''
                %s value %s is not a valid value
                ''',
                type_name(self),
                value
            ))

        Integer.set(self, value)