<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_checksum(self):
 """Set byte 14 of the userdata to a checksum value."""

        data_sum = self.cmd1 + self.cmd2
        for i in range(1, 14):
            data_sum += self._userdata['d{:d}'.format(i)]
        chksum = 0xff - (data_sum & 0xff) + 1
        self._userdata['d14'] = chksum