#NEWLINE# @ open_file ( 0 , mode = 'rb' ) #NEWLINE# def read_edgelist( path , comments = '#' , delimiter = None , create_using = None , nodetype = None , data = True , edgetype = None , encoding = 'utf-8' ) : #NEWLINE# #INDENT# 'Read a graph from a list of edges.\n\n    Parameters\n    ----------\n    path : file or string\n       File or filename to read. If a file is provided, it must be\n       opened in \'rb\' mode.\n       Filenames ending in .gz or .bz2 will be uncompressed.\n    comments : string, optional\n       The character used to indicate the start of a comment.\n    delimiter : string, optional\n       The string used to separate values.  The default is whitespace.\n    create_using : Graph container, optional,\n       Use specified container to build graph.  The default is networkx.Graph,\n       an undirected graph.\n    nodetype : int, float, str, Python type, optional\n       Convert node data from strings to specified type\n    data : bool or list of (label,type) tuples\n       Tuples specifying dictionary key names and types for edge data\n    edgetype : int, float, str, Python type, optional OBSOLETE\n       Convert edge data from strings to specified type and use as \'weight\'\n    encoding: string, optional\n       Specify which encoding to use when reading file.\n\n    Returns\n    -------\n    G : graph\n       A networkx Graph or other type specified with create_using\n\n    Examples\n    --------\n    >>> nx.write_edgelist(nx.path_graph(4), "test.edgelist")\n    >>> G=nx.read_edgelist("test.edgelist")\n\n    >>> fh=open("test.edgelist", \'rb\')\n    >>> G=nx.read_edgelist(fh)\n    >>> fh.close()\n\n    >>> G=nx.read_edgelist("test.edgelist", nodetype=int)\n    >>> G=nx.read_edgelist("test.edgelist",create_using=nx.DiGraph())\n\n    Edgelist with data in a list:\n\n    >>> textline = \'1 2 3\'\n    >>> fh = open(\'test.edgelist\',\'w\')\n    >>> d = fh.write(textline)\n    >>> fh.close()\n    >>> G = nx.read_edgelist(\'test.edgelist\', nodetype=int, data=((\'weight\',float),))\n    >>> list(G)\n    [1, 2]\n    >>> list(G.edges(data=True))\n    [(1, 2, {\'weight\': 3.0})]\n\n    See parse_edgelist() for more examples of formatting.\n\n    See Also\n    --------\n    parse_edgelist\n\n    Notes\n    -----\n    Since nodes must be hashable, the function nodetype must return hashable\n    types (e.g. int, float, str, frozenset - or tuples of those, etc.)\n    ' #NEWLINE# lines = ( line . decode ( encoding ) for line in path ) #NEWLINE# return parse_edgelist ( lines , comments = comments , delimiter = delimiter , create_using = create_using , nodetype = nodetype , data = data )