<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_register(self, addr, data):
 """Sets an arbitrary register at @addr and subsequent registers depending on how much data you decide to write. It will automatically fill extra bytes with zeros. You cannot write more than 14 bytes at a time. @addr should be a static constant from the Addr class, e.g. Addr.Speed"""

        assert len(data) <= 14, "Cannot write more than 14 bytes at a time"
        cmd = chr(addr) + chr(len(data) | 0x80)
        for byte in data:
            cmd += chr(cast_to_byte(byte))
        cmd += (16 - len(cmd)) * chr(0)
        self._dev.send_bytes(cmd)