original_docstring:  Generate an adjacency matrix (size NxN for N node graph) for an input snapPY graph
  
    :param G: snapPY input graph
    
docstring: Generate an adjacency matrix (size NxN for N node graph) for an input snapPY graph
docstring_tokens: Generate an adjacency matrix ( size NxN for N node graph ) for an input snapPY graph
code: def gen_adj_mat(G):
    """ Generate an adjacency matrix (size NxN for N node graph) for an input snapPY graph
  
    :param G: snapPY input graph
    """
    nodes = G.GetNodes()
    print(nodes)
    mat = np.zeros((nodes, nodes))
    for edge in G.Edges():
      src = edge.GetSrcNId() #source node
      dst = edge.GetDstNId() #dest node
      if (src >= nodes):
        src = src % nodes
      if (dst >= nodes):
        dst = dst % nodes
      mat[src][dst] += 1
    print(mat)
    return mat
code_tokens: def gen_adj_mat ( G ) : nodes = G . GetNodes ( ) print ( nodes ) mat = np . zeros ( ( nodes , nodes ) ) for edge in G . Edges ( ) : src = edge . GetSrcNId ( ) dst = edge . GetDstNId ( ) if ( src >= nodes ) : src = src % nodes if ( dst >= nodes ) : dst = dst % nodes mat [ src ] [ dst ] += 1 print ( mat ) return mat
short_docstring: Generate an adjacency matrix (size NxN for N node graph) for an input snapPY graph
short_docstring_tokens: Generate an adjacency matrix ( size NxN for N node graph ) for an input snapPY graph
comment: """ Generate an adjacency matrix (size NxN for N node graph) for an input snapPY graph
  
    :param G: snapPY input graph
    """$SEP$#source node$SEP$#dest node