Set the percentage of free space to use.
513356
def percent(self, value: float) -> 'Size':
        """"""
        raise_not_number(value)
        self.maximum = '{}%'.format(value)
        return self
203444
def get_reserved_space(self):
        """"""
        reserved_space_ratio = .45
        max_reserved_space = 8
        _, height = click.get_terminal_size()
        return min(int(round(height * reserved_space_ratio)), max_reserved_space)
1188909
def _mem(self):
        """"""
        value = int(psutil.virtual_memory().percent)
        set_metric("memory", value, category=self.category)
        gauge("memory", value)
244810
def set(self, start, stop, length=None, units='bytes'):
        """"""
        assert is_byte_range_valid(start, stop, length), \
            'Bad range provided'
        self._units = units
        self._start = start
        self._stop = stop
        self._length = length
        if self.on_update is not None:
            self.on_update(self)
315381
public function percentUsage()
    {
        $total = $this->systemTotal();
        $free  = $this->systemFree();

        $usage = [];

        foreach( $total as $slotId => $amount ) {
            $usage[ $slotId ] = intval( ceil( ( ( $amount - $free[ $slotId ] ) * 100 ) / $amount ) );
        }

        return $usage;
    }
1073412
function () {
        var threshold = this.slot.keys.length * 0.9;

        if (this.slot.size < threshold) {
            this.capacity(this.slot.size);
        }
    }
927294
def set_ownership(self):
        """"""
        assert self.section is not None

        for t in self.children:
            t.parent = self
            t._section = self.section
            t.doc = self.doc
            t.set_ownership()
1011704
def storage_color(self, user_storage):
        
        p = user_storage.percentage
        if p >= 0 and p < 60:
            return "success"
        if p >= 60 and p < 90:
            return "warning"
        if p >= 90 and p <= 100:
            return "danger"
        raise ValueError("percentage out of range")
806238
public void makeSpace(int sizeNeeded) {
        int needed = count + sizeNeeded - buf.length;
        if (needed > 0) {
            bump(needed);
        }
    }
365054
def set_volume(percentage):
	'''
	'''

	if percentage > 100 or percentage < 0:
		raise ValueError('percentage must be an integer between 0 and 100')

	if system.get_name() == 'windows':
		# TODO: Implement volume for Windows. Looks like WinAPI is the
		# solution...
		pass

	elif system.get_name() == 'mac':
		# OS X uses 0-10 instead of percentage
		volume_int = percentage / 10

		sp.Popen(['osascript', '-e', 'set Volume %d' % volume_int]).wait()

	else:
		# Linux/Unix
		formatted = str(percentage) + '%'
		sp.Popen(['amixer', '--quiet', 'sset', 'Master', formatted]).wait()
304000
def _adjust_width(self):
        """"""
        if self.bar_width > self.max_iter:
            self.bar_width = int(self.max_iter)
767615
protected function setProperties($percentage)
    {
        if ($percentage > 1) {
            throw new \InvalidArgumentException('$percentage must be less than 1');
        }

        $this->sourceImageHeight = $this->sourceImage->getHeight();
        $this->sourceImageWidth = $this->sourceImage->getWidth();

        $this->mergeImageHeight = $this->mergeImage->getHeight();
        $this->mergeImageWidth = $this->mergeImage->getWidth();

        $this->calculateOverlap($percentage);
        $this->calculateCenter();
    }
1363556
function (percentage) {
    var progressBar = document.getElementById('progress-bar');
    progressBar.MaterialProgress.setProgress(percentage);

    progressBar.style.display = 'inherit';
  }
856758
public void setProgress(float percent){
		if(mCircular)
			((CircularProgressDrawable)mProgressDrawable).setProgress(percent);
		else
			((LinearProgressDrawable)mProgressDrawable).setProgress(percent);
	}
109653
def as_percent(self, percent):
        
        if not self:
            return self.wrap_str()

        length = len(self)
        # Using mod 100, to provide some kind of "auto reset". 0 is 0 though.
        percentmod = (int(percent) % 100) or min(percent, 100)
        index = int((length / 100) * percentmod)
        try:
            barstr = str(self[index])
        except IndexError:
            barstr = self[-1]

        return self.wrap_str(barstr)
813104
private void setDefaultCapacity() {
        Object capacity = getParam("ddb_default_read_capacity"); 
        if (capacity != null) {
            READ_CAPACITY_UNITS = Integer.parseInt(capacity.toString());
        }
        capacity = getParam("ddb_default_write_capacity");
        if (capacity != null) {
            WRITE_CAPACITY_UNITS = Integer.parseInt(capacity.toString());
        }
        m_logger.info("Default table capacity: read={}, write={}", READ_CAPACITY_UNITS, WRITE_CAPACITY_UNITS);
    }
756332
function setThumbSizeAspect(percentSize, percentLeft, percentTop, parentw, parenth, aspect) {

    var width, height;
    if( parentw < parenth*aspectRatio){
        width = parentw * percentSize;
        height = width/aspect;
    }
    else {
        height = parenth * percentSize;
        width = height*aspect;
    }
    var left;
    if( percentLeft < 0) {
        left = parentw - width;
    }
    else {
        left = 0;
    }
    left += Math.floor(percentLeft*parentw);
    var top = 0;
    if( percentTop < 0) {
        top = parenth - height;
    }
    else {
        top = 0;
    }
    top += Math.floor(percentTop*parenth);
    return {
        left:left,
        top:top,
        width:width,
        height:height
    };
}