def get_weights_for_KOs(graphs):
    """
    For each graph functions returns dict of weights by KOs,
    ex. dict_graphKO: { pathway1: {KO1: weight1, KO2: weight2}, pathway2: {...} }
    :param graphs: dict of graphs
    :return: dict of pathways with weights for each KO
    """
    dict_graphKO = {}
    for name_pathway in graphs:
        graph = graphs[name_pathway]
        dict_graphKO[name_pathway] = {}

        for start in graph[0]._adj:
            for finish in graph[0]._adj[start]:
                for num in graph[0]._adj[start][finish]:
                    KO = graph[0]._adj[start][finish][num]['label']
                    weight = round(graph[0]._adj[start][finish][num]['weight'], 2)
                    dict_graphKO[name_pathway][KO] = weight
    print('weights done')
    return dict_graphKO