def write(self, data, assert_ss=True, deassert_ss=True):
<EOL>if self._mosi is None:<EOL><INDENT>raise RuntimeError('<STR_LIT>')<EOL><DEDENT>if assert_ss and self._ss is not None:<EOL><INDENT>self._gpio.set_low(self._ss)<EOL><DEDENT>for byte in data:<EOL><INDENT>for i in range(<NUM_LIT:8>):<EOL><INDENT>if self._write_shift(byte, i) & self._mask:<EOL><INDENT>self._gpio.set_high(self._mosi)<EOL><DEDENT>else:<EOL><INDENT>self._gpio.set_low(self._mosi)<EOL><DEDENT>self._gpio.output(self._sclk, not self._clock_base)<EOL>self._gpio.output(self._sclk, self._clock_base)<EOL><DEDENT><DEDENT>if deassert_ss and self._ss is not None:<EOL><INDENT>self._gpio.set_high(self._ss)<EOL><DEDENT>
Half-duplex SPI write.  If assert_ss is True, the SS line will be
        asserted low, the specified bytes will be clocked out the MOSI line, and
        if deassert_ss is True the SS line be put back high.