def assign_clusters(graph, cluster_dict, alpha):
    """
    From the clustering dict, assigns the cluster label to each node in graph.
    :param graph: networkx graph.
    :param cluster_dict: clustering dict created by read_in_clusters.
    :param alpha: alpha value.
    :return: networkx graph, having nodes with a populated "cluster" attribute.
    """
    for node in graph.nodes:
        cluster = int(cluster_dict[node][alpha])
        graph.nodes[node]["cluster"] = cluster
    return graph