'Decode byte list (Packet.bytes) to attributes'

def _decode(self):

    if (len(self.bytes) == 0):
        raise _SNAPError("Can't    decode    and    empty    packet")
    self.SYNC = self.bytes[0]
    self.HDB2 = self.bytes[1]
    self.HDB1 = self.bytes[2]
    self.DAB = self.bytes[3]
    self.SAB = self.bytes[4]
    self.NDB = _breakHDB1(self.HDB1)
    self.dataBytes = []
    for d in self.bytes[5:(5 + self.NDB)]:
        self.dataBytes.append(d)
    self.CRC = self.bytes[(5 + self.NDB)::(6 + self.NDB)][0]
    numLeftoverBytes = ((len(self.bytes) - 6) - self.NDB)
    self.leftoverBytes = self.bytes[(6 + self.NDB):len(self.bytes)]
    if (numLeftoverBytes > 0):
        raise _SNAPError((('Decoded    packet    has    ' + str(numLeftoverBytes)) + '    bytes    left    over'))
    (self.ACK, self.NAK) = _breakHDB2(self.HDB2)
    self.bytes = self.bytes[:(6 + self.NDB)]
    self.decoded = True
