def tcsort(item):  # FIXME SUCH WOW SO INEFFICIENT O_O
    """ get len of transitive closure assume type items is tree... """
    return len(item[1]) + sum(tcsort(kv) for kv in item[1].items())
get len of transitive closure assume type items is tree...