def rep_per_node(prefix, num_community):
    """
    Used on Libra partitioned data.
    This function reports number of split-copes per node (replication) of
    a partitioned graph
    Parameters
    ----------
    prefix: Partition folder location (contains replicationlist.csv)
    num_community: number of partitions or communities
    """
    ifile = os.path.join(prefix, "replicationlist.csv")
    fhandle = open(ifile, "r")
    r_dt = {}

    fline = fhandle.readline()  ## reading first line, contains the comment.
    print(fline)
    for line in fhandle:
        if line[0] == "#":
            raise DGLError("[Bug] Read Hash char in rep_per_node func.")

        node = line.strip("\n")
        if r_dt.get(node, -100) == -100:
            r_dt[node] = 1
        else:
            r_dt[node] += 1

    fhandle.close()
    ## sanity checks
    for v in r_dt.values():
        if v >= num_community:
            raise DGLError(
                "[Bug] Unexpected event in rep_per_node() in tools.py."
            )

    return r_dt

    Used on Libra partitioned data.
    This function reports number of split-copes per node (replication) of
    a partitioned graph
    Parameters
    ----------
    prefix: Partition folder location (contains replicationlist.csv)
    num_community: number of partitions or communities
    
python/dgl/distgnn/tools/tools.py