code: def checksum(data):
      
      assert isinstance(data, bytes)
      assert len(data) >= MINIMUM_MESSAGE_SIZE - 2
      assert len(data) <= MAXIMUM_MESSAGE_SIZE - 2
      __checksum = 0
      for data_byte in data:
          __checksum += data_byte
      __checksum = -(__checksum % 256) + 256
      try:
          __checksum = bytes([__checksum])
      except ValueError:
          __checksum = bytes([0])
      return __checksum
docs: :return: int