<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def unlock_kinetis(jlink):
 """Unlock for Freescale Kinetis K40 or K60 device. Args: jlink (JLink):
 an instance of a J-Link that is connected to a target. Returns: ``True`` if the device was successfully unlocked, otherwise ``False``. Raises: ValueError: if the J-Link is not connected to a target. """

    if not jlink.connected():
        raise ValueError('No target to unlock.')

    method = UNLOCK_METHODS.get(jlink.tif, None)
    if method is None:
        raise NotImplementedError('Unsupported target interface for unlock.')

    return method(jlink)