def _decode_ack(packet, packet_buff, offset):
 if (len(packet_buff) != (offset + 2)):
  raise InvalidPacketException((u'ACK packet has invalid size (!=%s): %s' % ((offset + 2), hexlify(packet_buff))))
 (block_number,) = struct.unpack_from('!H', packet_buff, offset)
 packet['block_number'] = block_number
 return packet

def _decode_ack ( packet , packet_buff , offset ) : if ( len ( packet_buff ) != ( offset + 2 ) ) : raise InvalidPacketException ( ( u'ACK packet has invalid size (!=%s): %s' % ( ( offset + 2 ) , hexlify ( packet_buff ) ) ) ) ( block_number , ) = struct . unpack_from ( '!H' , packet_buff , offset ) packet [ 'block_number' ] = block_number return packet
decodes a ack packet .