def write_i2c_block_data(self, addr, cmd, vals):
assert self._device is not None, '<STR_LIT>'<EOL>data = bytearray(len(vals)+<NUM_LIT:1>)<EOL>data[<NUM_LIT:0>] = cmd & <NUM_LIT>  <EOL>data[<NUM_LIT:1>:] = vals[<NUM_LIT:0>:]   <EOL>self._select_device(addr)<EOL>self._device.write(data)<EOL>
Write a buffer of data to the specified cmd register of the device.