def setup(self, pin, value):
self._validate_pin(pin)<EOL>if value == GPIO.IN:<EOL><INDENT>self.iodir[int(pin/<NUM_LIT:8>)] |= <NUM_LIT:1> << (int(pin%<NUM_LIT:8>))<EOL><DEDENT>elif value == GPIO.OUT:<EOL><INDENT>self.iodir[int(pin/<NUM_LIT:8>)] &= ~(<NUM_LIT:1> << (int(pin%<NUM_LIT:8>)))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>self.write_iodir()<EOL>
Set the input or output mode for a specified pin.  Mode should be
        either GPIO.OUT or GPIO.IN.