def node_weight(G, u):
    """
    Computes the weighted degree of a node
    :param G: networkx.Graph
            Graph containing the node u
    :param u: node
            Node of which the degree will be computed
    :return:
        w: double
         Degree of u
    """
    w = 0
    for v in G[u].keys():
        w = w + G[u][v]['weight']
    return w