Set the state of the GPIO to `value`.

        Args:
            value (bool): ``True`` for high state, ``False`` for low state.

        Raises:
            GPIOError: if an I/O or OS error occurs.
            TypeError: if `value` type is not bool.
172098
def write(self, value):
        
        if not isinstance(value, bool):
            raise TypeError("Invalid value type, should be bool.")

        # Write value
        try:
            if value:
                os.write(self._fd, b"1\n")
            else:
                os.write(self._fd, b"0\n")
        except OSError as e:
            raise GPIOError(e.errno, "Writing GPIO: " + e.strerror)

        # Rewind
        try:
            os.lseek(self._fd, 0, os.SEEK_SET)
        except OSError as e:
            raise GPIOError(e.errno, "Rewinding GPIO: " + e.strerror)
195202
def set(self, value: Optional[bool]):
        
        prev_value = self._value
        self._value = value
        if self._value != prev_value:
            # notify all watchers that this check was changed
            for event in self._events:
                event.set()
642940
def set_value(self, value):
        
        if value:
            self.setCheckState(Qt.Checked)
        else:
            self.setCheckState(Qt.Unchecked)
223065
def set_value(self, value, block_events=False):
        
        if block_events: self.block_events()
        self._widget.setValue(value)
        if block_events: self.unblock_events()
208896
def display_value(self, value):
        

        if not (isinstance(value, bool) or value == 'all'):
            raise InvalidUsage("Display value can be of type bool or value 'all'")

        self._sysparms['sysparm_display_value'] = value
765748
def set_pwm(self, values):
        
        if len(values) != len(self._pins):
            raise ValueError('Number of values has to be identical with '
                             'the number of pins.')
        if not all(0 <= v <= 1 for v in values):
            raise ValueError('Values must be between 0 and 1.')

        for tries in range(self.IO_TRIES):
            try:
                self._set_pwm(self._to_raw_pwm(values))
                break
            except IOError as error:
                if tries == self.IO_TRIES - 1:
                    raise error
        self._state = values
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
1155406
def set(self, value):
        

        # logger.debug('GValue.set: value = %s', value)

        gtype = self.gvalue.g_type
        fundamental = gobject_lib.g_type_fundamental(gtype)

        if gtype == GValue.gbool_type:
            gobject_lib.g_value_set_boolean(self.gvalue, value)
        elif gtype == GValue.gint_type:
            gobject_lib.g_value_set_int(self.gvalue, int(value))
        elif gtype == GValue.guint64_type:
            gobject_lib.g_value_set_uint64(self.gvalue, value)
        elif gtype == GValue.gdouble_type:
            gobject_lib.g_value_set_double(self.gvalue, value)
        elif fundamental == GValue.genum_type:
            gobject_lib.g_value_set_enum(self.gvalue,
                                         GValue.to_enum(gtype, value))
        elif fundamental == GValue.gflags_type:
            gobject_lib.g_value_set_flags(self.gvalue, value)
        elif gtype == GValue.gstr_type:
            gobject_lib.g_value_set_string(self.gvalue, _to_bytes(value))
        elif gtype == GValue.refstr_type:
            vips_lib.vips_value_set_ref_string(self.gvalue, _to_bytes(value))
        elif fundamental == GValue.gobject_type:
            gobject_lib.g_value_set_object(self.gvalue, value.pointer)
        elif gtype == GValue.array_int_type:
            if isinstance(value, numbers.Number):
                value = [value]

            array = ffi.new('int[]', value)
            vips_lib.vips_value_set_array_int(self.gvalue, array, len(value))
        elif gtype == GValue.array_double_type:
            if isinstance(value, numbers.Number):
                value = [value]

            array = ffi.new('double[]', value)
            vips_lib.vips_value_set_array_double(self.gvalue, array,
                                                 len(value))
        elif gtype == GValue.array_image_type:
            if isinstance(value, pyvips.Image):
                value = [value]

            vips_lib.vips_value_set_array_image(self.gvalue, len(value))
            array = vips_lib.vips_value_get_array_image(self.gvalue, ffi.NULL)
            for i, image in enumerate(value):
                gobject_lib.g_object_ref(image.pointer)
                array[i] = image.pointer
        elif gtype == GValue.blob_type:
            # we need to set the blob to a copy of the string that vips_lib
            # can own
            memory = glib_lib.g_malloc(len(value))
            ffi.memmove(memory, value, len(value))

            # this is horrible!
            #
            # * in API mode, we must have 8.6+ and use set_blob_free to
            #   attach the metadata to avoid leaks
            # * pre-8.6, we just pass a NULL free pointer and live with the
            #   leak
            #
            # this is because in API mode you can't pass a builtin (what
            # vips_lib.g_free() becomes) as a parameter to ffi.callback(), and
            # vips_value_set_blob() needs a callback for arg 2
            #
            # additionally, you can't make a py def which calls g_free() and
            # then use the py def in the callback, since libvips will trigger
            # these functions during cleanup, and py will have shut down by
            # then and you'll get a segv

            if at_least_libvips(8, 6):
                vips_lib.vips_value_set_blob_free(self.gvalue,
                                                  memory, len(value))
            else:
                if pyvips.API_mode:
                    vips_lib.vips_value_set_blob(self.gvalue,
                                                 ffi.NULL, memory, len(value))
                else:
                    vips_lib.vips_value_set_blob(self.gvalue,
                                                 glib_lib.g_free,
                                                 memory, len(value))
        else:
            raise Error('unsupported gtype for set {0}, fundamental {1}'.
                        format(type_name(gtype), type_name(fundamental)))
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
997305
def check_and_reset(self, value=None):
    

    if self.check():
      self.reset(value)
      return True
    return False
1342674
def value(self, raw_value):
        """"""
        if raw_value in self._FALSE_VALUES:
            return False
        elif raw_value in self._TRUE_VALUES:
            return True
        else:
            raise ValueError(
                "Could not parse '{}' value as boolean".format(raw_value)
            )
720500
def set_simulate(self, status):
        
        if type(status) != bool:
            raise InvalidInput("Status value must be bool")
        self._simulate = bool2int(status)
954409
def str_to_bool(val):
    

    if isinstance(val, bool):
        return val
    elif val.lower() == 'true':
        return True
    elif val.lower() == 'false':
        return False
    else:
        raise ValueError
149614
def set_value(self, value):
        
        parsed_value = self._parse_value(value)
        self.value = parsed_value
844153
def _set_tasks_state(self, value):
        
        if value not in states.state_numbers.keys():
            raise ValueError(obj=self._uid,
                             attribute='set_tasks_state',
                             expected_value=states.state_numbers.keys(),
                             actual_value=value)

        for task in self._tasks:
            task.state = value
399132
def set_is_executable(self, value):
        
        if value is None or not isinstance(value, bool):
            raise TypeError("IsExecutable must be set to a bool")
        else:
            self.__is_executable = value
669806
def setvalue(self, value):
		
		self._value = abs(value)
		self._sign = 0
		if(value < 0):
			self._sign = 1