examples/node2vec_main.py
def read_graph():
    '''
    Reads the input network in networkx.
    '''
    if args.weighted:
        G = nx.read_edgelist(args.input, nodetype=int, data=(('weight', float),), create_using=nx.DiGraph())
    else:
        G = nx.read_edgelist(args.input, nodetype=int, create_using=nx.DiGraph())
        for edge in G.edges():
            G[edge[0]][edge[1]]['weight'] = 1

    if not args.directed:
        G = G.to_undirected()

    return G

    Reads the input network in networkx.
    
Reads the input network in networkx.
Reads the input network in networkx .
def read_graph():
    if args.weighted:
        G = nx.read_edgelist(args.input, nodetype=int, data=(('weight', float),), create_using=nx.DiGraph())
    else:
        G = nx.read_edgelist(args.input, nodetype=int, create_using=nx.DiGraph())
        for edge in G.edges():
            G[edge[0]][edge[1]]['weight'] = 1
    if not args.directed:
        G = G.to_undirected()
    return G
def read_graph ( ) : if args . weighted : G = nx . read_edgelist ( args . input , nodetype = int , data = ( ( 'weight' , float ) , ) , create_using = nx . DiGraph ( ) ) else : G = nx . read_edgelist ( args . input , nodetype = int , create_using = nx . DiGraph ( ) ) for edge in G . edges ( ) : G [ edge [ 0 ] ] [ edge [ 1 ] ] [ 'weight' ] = 1 if not args . directed : G = G . to_undirected ( ) return G
Reads the input network in networkx.
Reads the input network in networkx .
'''
    Reads the input network in networkx.
    '''