original_docstring:  Generate a snapPY graph based on an adjacency matrix
  
    :param M: adjacency matrix representing stored graph
    
docstring: Generate a snapPY graph based on an adjacency matrix
docstring_tokens: Generate a snapPY graph based on an adjacency matrix
code: def gen_graph(M): #generate SNAP graph from adjacency matrix
    """ Generate a snapPY graph based on an adjacency matrix
  
    :param M: adjacency matrix representing stored graph
    """
    newG = snap.PNGraph.New()
    [ newG.AddNode(i) for i in range(len(M)) ]
    #for i in range(len(M)):
    #  newG.AddNode(i)
    for i in range(len(M)):
      for j in range(len(M[i])):
        if M[i][j] > 0:
          newG.AddEdge(i, j)
    return newG
code_tokens: def gen_graph ( M ) : newG = snap . PNGraph . New ( ) [ newG . AddNode ( i ) for i in range ( len ( M ) ) ] for i in range ( len ( M ) ) : for j in range ( len ( M [ i ] ) ) : if M [ i ] [ j ] > 0 : newG . AddEdge ( i , j ) return newG
short_docstring: Generate a snapPY graph based on an adjacency matrix
short_docstring_tokens: Generate a snapPY graph based on an adjacency matrix
comment: #generate SNAP graph from adjacency matrix$SEP$""" Generate a snapPY graph based on an adjacency matrix
  
    :param M: adjacency matrix representing stored graph
    """$SEP$#for i in range(len(M)):$SEP$#  newG.AddNode(i)