Increase/decrease volume
 :up increase volume
 :down decreases volume
 :set sets the volume at <value>
540757
def volume(action,value=30)
      cmd =
      case action
      when :up then "volume 1"
      when :down then "volume 0"
      when :set then "volume #{value} 1"
      else return false
      end
      resp = command cmd, /Volume/
      resp.gsub("Volume: ","").gsub(" %\n","")
    end
792544
function lower (value) {
  if (value === null || value === undefined) {
    return value
  }
  return String.prototype.toLowerCase.call(value)
}
670899
def set_expanding(self):
        """"""

        status = not self.expanding
        if status:
            self.expanding = True
        return status
620147
public void update(final float value) {
    if (Float.isNaN(value)) { return; }
    if (isEmpty()) {
      minValue_ = value;
      maxValue_ = value;
    } else {
      if (value < minValue_) { minValue_ = value; }
      if (value > maxValue_) { maxValue_ = value; }
    }
    if (levels_[0] == 0) {
      compressWhileUpdating();
    }
    n_++;
    isLevelZeroSorted_ = false;
    final int nextPos = levels_[0] - 1;
    assert levels_[0] >= 0;
    levels_[0] = nextPos;
    items_[nextPos] = value;
  }
1027963
def _func(self, volume, params):
        
        e0, b0, b1, v0 = tuple(params)
        eta = (volume / v0) ** (1. / 3.)
        squiggle = -3.*np.log(eta)
        return e0 + b0 * v0 * squiggle ** 2 / 6. * (3. + squiggle * (b1 - 2))
154392
public void setLowerAndUpperBounds(double lower, double upper) {
        if (data == null) {
            return;
        }

        this.originalLowerBound = lower;
        this.originalUpperBound = upper;
        if (originalLowerBound < min) {
            offset = Math.abs(originalLowerBound) + 10;
        } else {
            offset = Math.abs(min) + 10;
        }

        if (calibrationType == MEAN) {
            lowerBound = (originalLowerBound + offset) * (mean + offset) / (min + offset) - offset;
            upperBound = (originalUpperBound + offset) * (mean + offset) / (max + offset) - offset;
        } else {
            lowerBound = originalLowerBound;
            upperBound = originalUpperBound;
        }
        hasBounds = true;
        setDeviation();
    }
764027
def setting(self, opt, val):
        """"""
        opt = opt.encode()
        if isinstance(val, basestring):
            fluid_settings_setstr(self.settings, opt, val)
        elif isinstance(val, int):
            fluid_settings_setint(self.settings, opt, val)
        elif isinstance(val, float):
            fluid_settings_setnum(self.settings, opt, val)
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);
    });
  }
90033
@Override
	public void decrease(final int steps) throws IOException {

		if (currentValue == 0) {
			return;
		}
		if (steps < 0) {
			throw new RuntimeException("Only positive values for parameter 'steps' allowed!");
		}
		if (getNonVolatileMode() != MicrochipPotentiometerNonVolatileMode.VOLATILE_ONLY) {
			throw new RuntimeException("'decrease' is only valid for NonVolatileMode.VOLATILE_ONLY!");
		}

		// check boundaries
		final int actualSteps;
		if (steps > currentValue) {
			actualSteps = currentValue;
		} else {
			actualSteps = steps;
		}

		int newValue = currentValue - actualSteps;

		// if lower-boundary then set value in device to ensure sync
		// and for a large number of steps it is better to set a new value
		if ((newValue == 0)
				|| (steps > 5)) {

			setCurrentValue(newValue);

		}
		// for a small number of steps use 'decrease'-method
		else {

			controller.decrease(DeviceControllerChannel.valueOf(channel), actualSteps);

			currentValue = newValue;

		}

	}
669806
def setvalue(self, value):
		
		self._value = abs(value)
		self._sign = 0
		if(value < 0):
			self._sign = 1
1054472
def increment(self, attr, amount=1):
        
        return self.set(attr, operation.Increment(amount))
1066898
@Override
	public void increase(final int steps) throws IOException {

		int maxValue = getMaxValue();

		if (currentValue == maxValue) {
			return;
		}
		if (steps < 0) {
			throw new RuntimeException("only positive values for parameter 'steps' allowed!");
		}
		if (getNonVolatileMode() != MicrochipPotentiometerNonVolatileMode.VOLATILE_ONLY) {
			throw new RuntimeException("'increase' is only valid for NonVolatileMode.VOLATILE_ONLY!");
		}

		// check boundaries
		final int actualSteps;
		if ((steps + currentValue) > maxValue) {
			actualSteps = maxValue - currentValue;
		} else {
			actualSteps = steps;
		}

		int newValue = currentValue + actualSteps;

		// if upper-boundary then set value in device to ensure sync
		// and for a large number of steps it is better to set a new value
		if ((newValue == maxValue)
				|| (steps > 5)) {

			setCurrentValue(newValue);

		}
		// for a small number of step simply repeat 'increase'-commands
		else {

			controller.increase(DeviceControllerChannel.valueOf(channel), actualSteps);

			currentValue = newValue;

		}

	}
248204
function(mute) {
			if (!Crafty.support.audio)
				return;
			var s;
			for (var i in this.sounds) {
				s = this.sounds[i];
				s.obj.volume = mute ? 0 : s.volume;
			}
			this.muted = mute;
		}
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()
1292932
def set_m_vol(self, vol=None, relative=False):
        '''
        
        '''
        if vol != None:
            if relative:
                vol += self.m_vol
            self.m_vol = min(max(vol, 0), 1)
        pygame.mixer.music.set_volume(self.m_vol)
182723
void set2(int newPrice, int optCur, int back) {
        price = newPrice;
        optPrev = optCur + 1;
        backPrev = back;
        prev1IsLiteral = true;
        hasPrev2 = false;
    }
957438
def set_volume(self, percent, update_group=True):
        """"""
        if percent not in range(0, 101):
            raise ValueError('Volume percent out of range')
        new_volume = self._client['config']['volume']
        new_volume['percent'] = percent
        self._client['config']['volume']['percent'] = percent
        yield from self._server.client_volume(self.identifier, new_volume)
        if update_group:
            self._server.group(self.group.identifier).callback()
        _LOGGER.info('set volume to %s on %s', percent, self.friendly_name)