Sets INPUT (1) or OUTPUT (0) direction on pins. Inversion setting is applicable for input pins  1-inverted 0-noninverted input polarity.
196682
def set_pullups(self, port0 = 0x00, port1 = 0x00):
        ''
        self.bus.write_byte_data(self.address, self.PULLUP_PORT0, port0)
        self.bus.write_byte_data(self.address, self.PULLUP_PORT1, port1)
        return
1025452
def change_digital(self, pin_nr, value):
        
        if not self._board:
            return
        with self._lock:
            self._act_digital[pin_nr].pin.write(value)
761585
def _invert(self, pos):
        """"""
        assert 0 <= pos < self.len
        self._datastore.invertbit(pos)
523450
def switch_to_output(self, value=False, **kwargs):
        
        self.direction = digitalio.Direction.OUTPUT
        self.value = value
56319
@Override
    public void setPercentValue(GpioPinAnalogOutput pin, Number percent){
        setPercentValue(pin.getPin(), percent);
    }
406407
final int setParity(final int parity)
	{
		try {
			return setControl(PARITY, parity);
		}
		catch (final IOException e) {
			logger.error("set parity failed", e);
		}
		return 0;
	}
578615
void setBalance(
    int       b)
  {
    if ( (b == -1) || (b == 0) || (b == 1) )
      _balance = (short) b;
    else
     {
       String x = "Attempt to set invalid balance factor: " + b;
       throw new IllegalArgumentException(x);
     }
  }
629896
public void setInputOffsets(int proc, int row, int rowStart)
    {
        mInputProcessed = proc;
        mInputRow = row;
        mInputRowStart = rowStart;
    }
628612
public final void setOrientation(int orientation) {
        mOrientation = orientation;
        mOrientationState = getOrientationStateFromParam(mOrientation);
        invalidate();
        if (mOuterAdapter != null) {
            mOuterAdapter.setOrientation(mOrientation);
        }

    }
155815
def set_output pin, state
			state = false if state == :low
			state = true  if state == :high

			if ( @pin_states >> ( pin - 1 )).odd? && ( state == false ) or
			   ( @pin_states >> ( pin - 1 )).even? && ( state == true ) then

				mask = 0 + ( 1 << ( pin - 1 ))
				@pin_states ^= mask
			end
			
			write_output
		end
416334
def set_mode(mode)
      raise UnsupportedModeError unless @onboard_pin.supported_modes.include?(mode)
      @board.set_pin_mode(@number, mode) unless current_mode == mode
    end
86571
@Override
    public void setValue(Pin pin, Number value) {
        super.setValue(pin, value.doubleValue());
    }
327873
public void setDirectionalLight(int i, Color color, boolean enableColor, float x, float y, float z) {
		float directionalColor[] = {
            (float)color.getRed(),
            (float)color.getGreen(),
            (float)color.getBlue(),
            (float)color.getAlpha()
        };
		float pos[] = { x, y, z, 0 };
		gl.glEnable(GL2.GL_LIGHTING);
		gl.glEnable(GL2.GL_LIGHT0 + i);
		gl.glLightfv(GL2.GL_LIGHT0 + i, GL2.GL_POSITION, pos, 0);
		if(enableColor)
		    gl.glLightfv(GL2.GL_LIGHT0 + i, GL2.GL_DIFFUSE, directionalColor, 0);
	}
255101
function setCurrentOrientation(orientationType,callback){

    if("landscape"==orientationType.toLowerCase()){
        UIDevice.currentDevice.setValueForKey(UIInterfaceOrientationLandscapeLeft,"orientation");
        setShouldAutoRotate(false);
    }
    else if("portrait"==orientationType.toLowerCase()){
        UIDevice.currentDevice.setValueForKey(UIInterfaceOrientationPortrait,"orientation");
        setShouldAutoRotate(false);

    }else if("all" == orientationType.toLowerCase()){
        setShouldAutoRotate(true);
    }
    if(undefined!==callback){
        callback();
    }

}
536082
def backward(self, speed=1):
        
        if isinstance(self.enable_device, DigitalOutputDevice):
            if speed not in (0, 1):
                raise ValueError(
                    'backward speed must be 0 or 1 with non-PWM Motors')
        self.enable_device.off()
        self.phase_device.on()
        self.enable_device.value = speed
1148005
def _set_LED(self, status):
        
        # DIO pin 1 (LED), active low
        self.hw.remote_at(
            dest_addr=self.remote_addr,
            command='D1',
            parameter='\x04' if status else '\x05')
1265240
def _output_pins(self, pins):
        
        [self._validate_channel(pin) for pin in pins.keys()]
        # Set each changed pin's bit.
        for pin, value in iter(pins.items()):
            if value:
                self.gpio[int(pin/8)] |= 1 << (int(pin%8))
            else:
                self.gpio[int(pin/8)] &= ~(1 << (int(pin%8)))
        # Write GPIO state.
        self._write_gpio()