Set a float option.

            Args:
                option (str): name of option.
                value (float): value of the option.

            Raises:
                TypeError: Value must be a float.
15381
def set_float(self, option, value):
        
        if not isinstance(value, float):
            raise TypeError("Value must be a float")
        self.options[option] = value
1125086
def eval_option_value(self, option):
        
        try:
            value = eval(option, {}, {})
        except (SyntaxError, NameError, TypeError):
            return option
        if type(value) in (str, bool, int, float):
            return value
        elif type(value) in (list, tuple):
            for v in value:
                if type(v) not in (str, bool, int, float):
                    self._write_error("Value of element of list object has wrong type %s" % v)
            return value
        return option
867018
def set_option(self, option, value):
        
        CONF.set(self.CONF_SECTION, str(option), value)
306393
def float(self, rule, **kwargs):
        
        rule.value = float(rule.value)
        return rule
749030
def float_range(value):
    
    try:
        value = float(value)
    except Exception:
        raise argparse.ArgumentTypeError('Invalid float value: \'{}\''.format(value))
    if value < 0.0 or value > 1.0:
        raise argparse.ArgumentTypeError('Invalid float value: \'{}\''.format(value))
    return value
913598
def value(self, value):
        
        opt_type = defines.OptionRegistry.LIST[self._number].value_type
        if opt_type == defines.INTEGER:
            if type(value) is not int:
                value = int(value)
            if byte_len(value) == 0:
                value = 0
        elif opt_type == defines.STRING:
            if type(value) is not str:
                value = str(value)
        elif opt_type == defines.OPAQUE:
            if type(value) is bytes:
                pass
            else:
                if value is not None:
                    value = bytes(value, "utf-8")

        self._value = value
53957
def set(self, val, default=False, imported=False):
        
        if hasattr(self.validator, '__call__'):
            try:
                val = self.validator(val)
            except Exception as exc:
                raise type(exc)(
                    'Could not validate value for "%s" setting: %s' %
                    (self.name, exc)
                ) from None
        self.value = val
        self.imported = imported
        if default:
            self.default = val
        self.modified = True
1094272
def set_value(self, value):
        
        self._value = value
        setattr(self.target, self._name, value)
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)
149614
def set_value(self, value):
        
        parsed_value = self._parse_value(value)
        self.value = parsed_value
1282063
def set_integer(self, option, value):
        
        try:
            int_value = int(value)
        except ValueError as err:
            print(err.args)

        self.options[option] = value
669806
def setvalue(self, value):
		
		self._value = abs(value)
		self._sign = 0
		if(value < 0):
			self._sign = 1
1084622
def set_value(self, value):
        
        v = 0
        measure_unit = 'px'
        try:
            v = int(float(value.replace('px', '')))
        except ValueError:
            try:
                v = int(float(value.replace('%', '')))
                measure_unit = '%'
            except ValueError:
                pass
        self.numInput.set_value(v)
        self.dropMeasureUnit.set_value(measure_unit)
715823
def to_float(value, default=_marker):
    
    if not is_floatable(value):
        if default is not _marker:
            return to_float(default)
        fail("Value %s is not floatable" % repr(value))
    return float(value)
46313
def set(self, value):
        

        if not isinstance(value, byte_cls):
            raise TypeError(unwrap(
                '''
                %s value must be a byte string, not %s
                ''',
                type_name(self),
                type_name(value)
            ))

        self._bytes = value
        self.contents = value
        self._header = None
        if self._indefinite:
            self._indefinite = False
            self.method = 0
        if self._trailer != b'':
            self._trailer = b''
1221535
def set_float_info(self, field, data):
        
        if getattr(data, 'base', None) is not None and \
           data.base is not None and isinstance(data, np.ndarray) \
           and isinstance(data.base, np.ndarray) and (not data.flags.c_contiguous):
            self.set_float_info_npy2d(field, data)
            return
        c_data = c_array(ctypes.c_float, data)
        _check_call(_LIB.XGDMatrixSetFloatInfo(self.handle,
                                               c_str(field),
                                               c_data,
                                               c_bst_ulong(len(data))))
651708
def set_option(self, name, value):
        
        self.__validate_option_name(name)
        self.__options[name] = value