def parse_modes(modes, targets=None, noargs=''):
    if not targets:
        targets = []
    cleaned = []
    for mode in modes:
        if mode in '-+':
            char = mode
            continue
        target = targets.pop(0) if mode not in noargs else None
        cleaned.append((char, mode, target))
    return cleaned
Parse channel modes:
dataset/ETHPy150Open gawel/irc3/irc3/utils.py/parse_modes