<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def swo_supported_speeds(self, cpu_speed, num_speeds=3):
 """Retrives a list of SWO speeds supported by both the target and the connected J-Link. The supported speeds are returned in order from highest to lowest. Args: self (JLink):
 the ``JLink`` instance cpu_speed (int):
 the target's CPU speed in Hz num_speeds (int):
 the number of compatible speeds to return Returns: A list of compatible SWO speeds in Hz in order from highest to lowest. """

        buf_size = num_speeds
        buf = (ctypes.c_uint32 * buf_size)()
        res = self._dll.JLINKARM_SWO_GetCompatibleSpeeds(cpu_speed, 0, buf, buf_size)
        if res < 0:
            raise errors.JLinkException(res)

        return list(buf)[:res]