def set_mode(self, mode):
if mode < <NUM_LIT:0> or mode > <NUM_LIT:3>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if mode & <NUM_LIT>:<EOL><INDENT>self._clock_base = GPIO.HIGH<EOL><DEDENT>else:<EOL><INDENT>self._clock_base = GPIO.LOW<EOL><DEDENT>if mode & <NUM_LIT>:<EOL><INDENT>self._read_leading = False<EOL><DEDENT>else:<EOL><INDENT>self._read_leading = True<EOL><DEDENT>self._gpio.output(self._sclk, self._clock_base)<EOL>
Set SPI mode which controls clock polarity and phase.  Should be a
        numeric value 0, 1, 2, or 3.  See wikipedia page for details on meaning:
        http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus