code: def set_mode(self,mode):
          
          if mode < 0 or mode > 3:
              raise ValueError('Mode must be a value 0, 1, 2, or 3.')
          self._device.mode(mode)
docs: 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