pipeline/util.py
def build_and_save_idmap(graph, outfile, idname='author'):
    """Save vertex ID to vertex name mapping and then return it."""
    first_col = '%s_id' % idname
    idmap = {v['name']: v.index for v in graph.vs}
    rows = sorted(idmap.items())
    write_csv(outfile, (first_col, 'node_id'), rows)
    return idmap
Save vertex ID to vertex name mapping and then return it.
Save vertex ID to vertex name mapping and then return it.
Save vertex ID to vertex name mapping and then return it .
def build_and_save_idmap(graph, outfile, idname='author'):
    first_col = '%s_id' % idname
    idmap = {v['name']: v.index for v in graph.vs}
    rows = sorted(idmap.items())
    write_csv(outfile, (first_col, 'node_id'), rows)
    return idmap
def build_and_save_idmap ( graph , outfile , idname = 'author' ) : first_col = '%s_id' % idname idmap = { v [ 'name' ] : v . index for v in graph . vs } rows = sorted ( idmap . items ( ) ) write_csv ( outfile , ( first_col , 'node_id' ) , rows ) return idmap
Save vertex ID to vertex name mapping and then return it.
Save vertex ID to vertex name mapping and then return it .
"""Save vertex ID to vertex name mapping and then return it."""
graph
outfile
idname