<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_modes(mode_string, unary_modes=""):
 """ Parse the mode_string and return a list of triples. If no string is supplied return an empty list. [] If no sign is supplied, return an empty list. [] Discard unused args. [['+', 'a', None]] Return none for unary args when not provided [['+', 'a', 'foo'], ['+', 'b', None], ['+', 'c', None]] This function never throws an error: True """


    # mode_string must be non-empty and begin with a sign
    if not mode_string or not mode_string[0] in '+-':
        return []

    modes = []

    parts = mode_string.split()

    mode_part, args = parts[0], parts[1:]

    for ch in mode_part:
        if ch in "+-":
            sign = ch
            continue
        arg = args.pop(0) if ch in unary_modes and args else None
        modes.append([sign, ch, arg])
    return modes