Sets the accelerometer sensitivity to 2, 4, 8 or 16 according to the given value. Throws an ArgumentError if
        the value provided is not valid.
        :param value: the target sensitivity.
175894
def setAccelerometerSensitivity(self, value):
        
        # note that this implicitly disables the self tests on each axis
        # i.e. the full byte is actually 000[accel]000 where the 1st 3 are the accelerometer self tests, the next two
        # values are the actual sensitivity and the last 3 are unused
        # the 2 [accel] bits are translated by the device as follows; 00 = 2g, 01 = 4g, 10 = 8g, 11 = 16g
        # in binary we get 2 = 0, 4 = 1000, 8 = 10000, 16 = 11000
        # so the 1st 3 bits are always 0
        try:
            self.i2c_io.write(self.MPU6050_ADDRESS,
                              self.MPU6050_RA_ACCEL_CONFIG,
                              {2: 0, 4: 8, 8: 16, 16: 24}[value])
            self._accelerationFactor = value / 32768.0
            self.accelerometerSensitivity = value
            logger.debug("Set accelerometer sensitivity = %d", value)
        except KeyError:
            raise ArgumentError(value + " is not a valid sensitivity (2,4,8,18)")
1233178
def period(self, value: float):
        
        if value < 0:
            raise ValueError("Period must be greater or equal than zero.")
        self._period = timedelta(seconds=value)
224595
def set_thresholds(self, touch, release):
        
        assert touch >= 0 and touch <= 255, 'touch must be between 0-255 (inclusive)'
        assert release >= 0 and release <= 255, 'release must be between 0-255 (inclusive)'
        # Set the touch and release register value for all the inputs.
        for i in range(12):
            self._i2c_retry(self._device.write8, MPR121_TOUCHTH_0 + 2*i, touch)
            self._i2c_retry(self._device.write8, MPR121_RELEASETH_0 + 2*i, release)
199745
public final void setValue(final Float value) {
        Condition.INSTANCE.ensureAtLeast(value, getMinValue(),
                "The value must be at least the minimum value");
        Condition.INSTANCE.ensureAtMaximum(value, getMaxValue(),
                "The value must be at maximum the maximum value");
        float roundedValue = adaptToStepSize(roundToDecimals(value));

        if (this.value != roundedValue) {
            this.value = roundedValue;
            this.currentValue = roundedValue;
            persistFloat(roundedValue);
            notifyChanged();
        }
    }
809340
def set_value(self, value):
        
        # Find index of choice
        try:
            value_index = self._parameter.options.index(value)
            self.input_button_group.button(value_index).setChecked(True)
        except ValueError:
            last_index = len(self._parameter.options) - 1
            self.input_button_group.button(last_index).setChecked(
                True)
            self.custom_value.setValue(value)

        self.toggle_custom_value()
158337
def set_value(self, value):
        """"""

        if self.data_type == self.BOOLEAN_TYPE:
            self.value_boolean = bool(value)
        elif self.data_type == self.NUMBER_TYPE:
            self.value_number = float(value)
        else:
            self.value = value
240878
public void setPitchIncrement(double value)
    {
        if (value < 0)
        {
            String message = Logging.getMessage("generic.ArgumentOutOfRange", value);
            Logging.logger().severe(message);
            throw new IllegalArgumentException(message);
        }
        this.pitchStep = value;
    }
1352221
private void set(double value)
    {
        cur = value;
        if (!overMax && cur > max)
        {
            cur = max;
        }
        if (cur < Alterable.MIN)
        {
            cur = Alterable.MIN;
        }
    }
326367
def set_speed(self, value):
        ''' '''
        self._combined_speed = float(value)
        speed_per_min = int(self._combined_speed * SEC_PER_MIN)
        command = GCODES['SET_SPEED'] + str(speed_per_min)
        log.debug("set_speed: {}".format(command))
        self._send_command(command)
797337
def set(self, value, samples=0):
        '''
        
        '''
        if self.params.length > self.pos and samples > 0:
            l = min(samples, self.params.length-self.pos)
            self.data[self.pos:self.pos+l] = np.full(l, value, dtype=np.float)
            self.pos += l
        self.latest = value
        return self
1143019
def _norm(self, value):
        
        if isinstance(value, self.valid_types):
            self._byte_value = value * self._unit_value
            self._bit_value = self._byte_value * 8.0
        else:
            raise ValueError("Initialization value '%s' is of an invalid type: %s. "
                             "Must be one of %s" % (
                                 value,
                                 type(value),
                                 ", ".join(str(x) for x in self.valid_types)))
1076525
def __set_unit_price(self, value):
        '''
        
        '''
        try:
            if value < 0:
                raise ValueError()

            self.__unit_price = Decimal(str(value))
        except ValueError:
            raise ValueError("Unit Price must be a positive number")
811237
def operands(self, value):
        
        if len(value) != 3:
            raise Exception("Invalid instruction operands : %s" % str(value))

        self._operands = value
669806
def setvalue(self, value):
		
		self._value = abs(value)
		self._sign = 0
		if(value < 0):
			self._sign = 1
1331447
def set_value(self, value):
        
        check_call(_LIB.MXProfileSetCounter(self.handle, int(value)))
421690
public void setAccelerometerRange(AccelerometerRange range) {
        Buffer buffer = new Buffer();
        buffer.writeByte(range.getRawValue());
        sendMessage(BeanMessageID.CC_ACCEL_SET_RANGE, buffer);
    }
679728
public synchronized ProgressBar setValue(int value) {
        if(value < min) {
            value = min;
        }
        if(value > max) {
            value = max;
        }
        if(this.value != value) {
            this.value = value;
            invalidate();
        }
        return this;
    }