def generate_graph(nc, seed):
    out_dir = FULLY + 'small-world-n1000-k10-p5-nc' + str(nc) + '-seed' + str(
        seed)
    graph = create_graph(n=1000, nc=nc, feature_dim=16, k=10, p=0.5, seed=seed)
    features = get_features_from_graph(graph)
    FullySynthetic.save_graph(out_dir, graph, features)
    return out_dir
    check_graphs_labels_distinguish(graphs)

    while len(graphs) > 1:
        graph = nx.compose(graphs[0], graphs[1])
        graphs = [graph, *graphs[2:]]
    print("====Large graph====")
    print(nx.info(graphs[0]))
    print("Number of connected components:",
          len(list(nx.connected_components(graphs[0]))))
    return graphs[0]


def get_features_from_graph(graph):
    features = None
    if 'feature' in graph.node[graph.nodes()[0]]:
        features = []
        for idx, node in enumerate(graph.nodes()):
            features.append(graph.node[node]['feature'])
        features = np.array(features)
    return features


if __name__ == '__main__':
    args = parse_args()
    print(args)
    graph = create_graph(args.n, args.nc, args.feature_dim, args.k, args.p,
                         args.seed)
    features = get_features_from_graph(graph)
    FullySynthetic.save_graph(args.output_dir, graph, features)