import csv


def read_in_generic(labeling_file):
    """
    Reads clusters into format: {node: cluster}.
    :param labeling_file: labeling file with two columns: node and cluster.
    :return: dict {node: cluster}.
    """
    cluster_dict = {}
    with open(labeling_file, "r") as f:
        lines = csv.reader(f)
        first = True
        for row in lines:
            if first:
                first = False
            else:
                cluster_dict[int(row[0])] = int(row[1])
    return cluster_dict