<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_packet(self, socket):
 """ Read packet and put it into inbox :param socket: Socket to read from :type socket: socket.socket :return: Read packet :rtype: APPMessage """

        data, (ip, port) = socket.recvfrom(self._buffer_size)
        packet, remainder = self._unpack(data)
        self.inbox.put((ip, port, packet))
        self.new_packet.set()
        self.debug(u"RX: {}".format(packet))

        if packet.header.sequence_number is not None:
            # Packet needs to be acknowledged
            self._send_ack(ip, port, packet)
        ack_seq = packet.header.ack_sequence_number
        if ack_seq is not None:
            # Packet got acknowledged
            with self._seq_ack_lock:
                if ack_seq in self._seq_ack:
                    self.debug(u"Seq {} got acked".format(ack_seq))
                    self._seq_ack.remove(ack_seq)
        return packet