def convert(node: dict, show_num: bool):
    """ Convert a compact format into fancytree data format 
    
    node is a dict mapping from folder_name to list of children nodes.
    If show_num is True, it will add number of children to a node title.
    """
    data = []
    for k, v in node.items():
        d = {'title': k}
        if v:
            d['folder'] = True
            d['children'] = convert(v, show_num)
            if show_num:
                d['title'] = f"{k} ({len(d['children'])})"
        data.append(d)
    return data