<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_target_info_len2(target, mode="lowest"):
 """Converts target into a length 2 Python version tuple. Modes: - "lowest" (default):
 Gets the lowest version supported by the target. - "highest": Gets the highest version supported by the target. - "nearest": If the current version is supported, returns that, otherwise gets the highest."""

    supported_vers = get_vers_for_target(target)
    if mode == "lowest":
        return supported_vers[0]
    elif mode == "highest":
        return supported_vers[-1]
    elif mode == "nearest":
        if sys.version_info[:2] in supported_vers:
            return sys.version_info[:2]
        else:
            return supported_vers[-1]
    else:
        raise CoconutInternalException("unknown get_target_info_len2 mode", mode)