from typing import OrderedDict


def parse_label_paths(raw_str):
    """
    raw str in the format of: 
        [name_1:]n_class_1:path_1,[name_2:]n_class_2:path_2,...
    """
    raw_toks = [tok.split(":") for tok in raw_str.split(",") if tok]
    if raw_toks and len(raw_toks[0]) == 3:
        raw_toks = OrderedDict([(tok[0], (int(tok[1]), tok[2])) for tok in raw_toks])
    return raw_toks