def remove_node(G, node):
    """
    Wrapper around networkx.classes.graph.Graph.remove_node to return a dict mapping an incident node to its edge attributes
    """
    rv = {}
    for edge in G.edges(node, data=True):
        u = edge[0]
        v = edge[1]
        edge_attr = edge[2]
        t = None
        if u == node:
            t = v
        else:
            t = u
        rv[t] = edge_attr
    G.remove_node(node)
    return rv