<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_mode(self, anchor_id, mode):
 """ Send a packet to set the anchor mode. If the anchor receive the packet, it will change mode and resets. """

        data = struct.pack('<BB', LoPoAnchor.LPP_TYPE_MODE, mode)
        self.crazyflie.loc.send_short_lpp_packet(anchor_id, data)