Sets the current value equal to num
433500
def set(self, num):
        
        self._value = str(round(float(num), self.nplaces))
        self._variable.set(self._value)
576149
def set_current(self, current):
        
        self.current = current
        self.input = current.input
        # self.req = current.request
        # self.resp = current.response
        self.output = current.output
        self.cmd = current.task_data['cmd']

        if self.cmd and NEXT_CMD_SPLITTER in self.cmd:
            self.cmd, self.next_cmd = self.cmd.split(NEXT_CMD_SPLITTER)
        else:
            self.next_cmd = None
1331317
def set_current(self, channel, value, unit='A'):
        '''
        '''
        dac_offset = self._ch_cal[channel]['DAC']['offset']
        dac_gain = self._ch_cal[channel]['DAC']['gain']
        if unit == 'raw':
            value = value
        elif unit == 'A':
            value = int((-value * 1000000 - dac_offset) / dac_gain)  # fix sign of output
        elif unit == 'mA':
            value = int((-value * 1000 - dac_offset) / dac_gain)  # fix sign of output
        elif unit == 'uA':
            value = int((-value - dac_offset) / dac_gain)  # fix sign of output
        else:
            raise TypeError("Invalid unit type.")

        self._set_dac_value(channel=channel, value=value)
1331447
def set_value(self, value):
        
        check_call(_LIB.MXProfileSetCounter(self.handle, int(value)))
704317
function set(cb, num, mymuted) {
    cancel();
    get(function (err, cur, muted) {
      // OS X BUG
      // The lowest volume setting is 0 < x < 1, but it reads as 0
      // Thus it's not possible to tell muted vs
      num = parseInt(num, 10);
      // TODO make this an error
      if (isNaN(num)) {
        num = cur;
      }
      if ('undefined' !== typeof mymuted) {
        muted = mymuted;
      }
      setRaw(cb, num, muted);
    });
  }
288805
def set_value(self, pymux, value):
        
        try:
            value = int(value)
            if value < 0:
                raise ValueError
        except ValueError:
            raise SetOptionError('Expecting an integer.')
        else:
            setattr(pymux, self.attribute_name, value)
998851
def add(self, num):
        
        try:
            val = self.value() + num
        except:
            val = num

        chunk = self.mfac.value()
        if val % chunk > 0:
            if num > 0:
                val = chunk*(val // chunk + 1)
            elif num < 0:
                val = chunk*(val // chunk)

        val = max(self._min(), min(self._max(), val))
        self.set(val)
1263102
protected void setValue(int newPosition, T1 valueSum, long valueN,
      boolean currentExisting) {
    if (valueN > 0) {
      if (currentExisting) {
        newBasicValueSumList[newPosition] = operations
            .add11(newBasicValueSumList[newPosition], valueSum);
        newBasicValueNList[newPosition] += valueN;
      } else {
        newBasicValueSumList[newPosition] = valueSum;
        newBasicValueNList[newPosition] = valueN;
      }
    }
  }
1095548
def add(self, num):
        
        try:
            val = self.value() + num
        except:
            val = num
        self.set(max(0, val))
519463
def num(self, count=None, show=None):  # (;$count,$show)
        
        if count is not None:
            try:
                self.persistent_count = int(count)
            except ValueError:
                raise BadNumValueError
            if (show is None) or show:
                return str(count)
        else:
            self.persistent_count = None
        return ""
1371463
def set(self, value: int):
        
        max_value = int(''.join(['1' for _ in range(self._bit_width)]), 2)

        if value > max_value:
            raise ValueError('the value {} is larger than '
                             'the maximum value {}'.format(value, max_value))

        self._value = value
        self._text_update()
808769
def set_load_current(self, current_amps):
        
        new_val = int(round(current_amps * 1000))
        if not 0 <= new_val <= 30000:
            raise ValueError("Load Current should be between 0-30A")
        self._load_mode = self.SET_TYPE_CURRENT
        self._load_value = new_val
        self.__set_parameters()
1252363
public function setNum($num = 20)
    {
        if (!is_numeric($num) && $num !== self::SEARCH_ALL) {
            throw new \InvalidArgumentException(
                'Argument can only be numeric or "all" to return all results.'
            );
        }
        $this->otherOptions['num'] = $num;

        return $this;
    }
106309
def set(self, value):
        """"""
        if self.validate(value):
            #print "Parameter " + self.id + " successfully set to " + repr(value)
            self.hasvalue = True
            if isinstance(value, float):
                self.value = round(value)
            else:
                self.value = int(value)
            return True
        else:
            #print "Parameter " + self.id + " COULD NOT BE set to " + repr(value)
            return False
1316780
protected function setCurrent()
    {
        if (0 === \count($this->buffer)) {
            $this->bufferize($this->types);
        }

        $this->current = array_pop($this->buffer);
    }
1129753
def dtcurrent(self, value):
        """"""
        assert isinstance(value, bool)
        if value and self.dparamscurrent:
            raise RuntimeError("Can't set both dparamscurrent and dtcurrent True")
        if value != self.dtcurrent:
            self._dtcurrent = value
            self._updateInternals()
24554
def set_value(self, value):
        
        if value:
            self.setChecked(Qt.Checked)
        else:
            self.setChecked(Qt.Unchecked)