+
    �°³jt0  ã                   óÞ   € R t . ROt^ RIt^ RIHt RR lt]! ^RR7      RR l4       t]P                  ! RRR7      RR	 l4       t	]! ^ R
R7      ]P                  ! RRR7      RR l4       4       t
R# )aû  
*************************
Multi-line Adjacency List
*************************
Read and write NetworkX graphs as multi-line adjacency lists.

The multi-line adjacency list format is useful for graphs with
nodes that can be meaningfully represented as strings.  With this format
simple edge data can be stored but node or graph data is not.

Format
------
The first label in a line is the source node label followed by the node degree
d.  The next d lines are target node labels and optional edge data.
That pattern repeats for all nodes in the graph.

The graph with edges a-b, a-c, d-e can be represented as the following
adjacency list (anything following the # in a line is a comment)::

     # example.multiline-adjlist
     a 2
     b
     c
     d 1
     e
N)Ú	open_filec           
   #  ó  "  € V P                  4       '       Ed~   V P                  4       '       dÎ   V P                  4        F·  w  r#VP                  4        UUUUu. uF!  w  rEVP                  4        F  w  rgWG3NK
  	  K#  	  ppppp\	        V4      p	\        V4      V,           \        V	4      ,           x € V F<  w  rJV
f   \        V4      x € K  \        V4      V,           \        V
4      ,           x € K>  	  K¹  	  R# V P                  4        F„  w  r#\	        V4      p	\        V4      V,           \        V	4      ,           x € VP                  4        F<  w  rJV
f   \        V4      x € K  \        V4      V,           \        V
4      ,           x € K>  	  K†  	  R# V P                  4       '       dñ   \        4       pV P                  4        FÐ  w  r#VP                  4        UUUUu. uF)  w  rEWK9  g   K  VP                  4        F  w  rgWG3NK
  	  K+  	  ppppp\	        V4      p	\        V4      V,           \        V	4      ,           x € V F<  w  rJV
f   \        V4      x € K  \        V4      V,           \        V
4      ,           x € K>  	  VP                  V4       KÒ  	  R# \        4       pV P                  4        F³  w  r#VP                  4        UU
u. uF  w  rJWK9  g   K  WJ3NK  	  ppp
\	        V4      p	\        V4      V,           \        V	4      ,           x € V F<  w  rJV
f   \        V4      x € K  \        V4      V,           \        V
4      ,           x € K>  	  VP                  V4       Kµ  	  R# u uppppi u uppppi u up
pi 5i)a<  Generate lines representing the graph `G` in multiline adjacency list format.

Parameters
----------
G : NetworkX graph

delimiter : str, optional (default=" ")
   Separator for node labels.

Yields
------
str
    A line of data in multiline adjacency list format for a node or one of
    its neighbors in `G`.

Examples
--------
>>> G = nx.lollipop_graph(4, 3)
>>> for line in nx.generate_multiline_adjlist(G):
...     print(line)
0 3
1 {}
2 {}
3 {}
1 2
2 {}
3 {}
2 1
3 {}
3 1
4 {}
4 1
5 {}
5 1
6 {}
6 0

See Also
--------
write_multiline_adjlist, read_multiline_adjlist
N)Úis_directedÚis_multigraphÚ	adjacencyÚitemsÚlenÚstrÚsetÚadd)ÚGÚ	delimiterÚsÚnbrsÚuÚdatadictÚkeyÚdataÚ	nbr_edgesÚdegÚdÚseens   &&          Úe/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/readwrite/multiline_adjlist.pyÚgenerate_multiline_adjlistr   '   sÀ  é € ðT 	‡}�}‡ƒØ�?‰?×ÒØŸ;™;ž=‘�ð (,§z¡z¤|öá'3™˜Ø%-§^¡^Ö%5™	˜ð “Iá%5ñ Ù'3ð ó ô
 ˜)“n�Ü˜!“f˜yÕ(¬3¨s«8Õ3Ò3Û%‘D�AØ’yÜ! !›fœä! !›f yÕ0´3°q³6Õ9Ô9ó	 &ó )ð Ÿ;™;ž=‘�Ü˜$“i�Ü˜!“f˜yÕ(¬3¨s«8Õ3Ò3Ø ŸJ™JžL‘D�AØ’yÜ! !›fœä! !›f yÕ0´3°q³6Õ9Ô9ó	 )ó )ð �?‰?×ÒÜ“5ˆDØŸ;™;ž=‘�ð (,§z¡z¤|öá'3™˜Ø‘}ô ð &.§^¡^Ö%5™	˜ð “Iñ &6ñ Ù'3ð ó ô ˜)“n�Ü˜!“f˜yÕ(¬3¨s«8Õ3Ò3Û%‘D�AØ’yÜ! !›fœä! !›f yÕ0´3°q³6Õ9Ô9ñ	 &ð
 —‘˜–ó )ô  “5ˆDØŸ;™;ž=‘�Ø04·
±
´ÔN±©¨ÀÁœV˜a›V±�	ÑNÜ˜)“n�Ü˜!“f˜yÕ(¬3¨s«8Õ3Ò3Û%‘D�AØ’yÜ! !›fœä! !›f yÕ0´3°q³6Õ9Ô9ñ	 &ð
 —‘˜–ó )ùõSùõ2ùó" OùsC   ‚-N°*NÁ'M0ÂD+NÆ-4NÇ!
M8Ç0 M8ÈB?NË
N ËN Ë%B!NÚwb)Úmodec                ó°  € ^ RI p^ RIpVRP                  VP                  4      ,           pV R2V,           RVP	                  VP                  4       4       R2,           V,           RV P                   R2,           pVP                  VP                  V4      4       \        W4       F,  p	V	R,          p	VP                  V	P                  V4      4       K.  	  R# )an  Write the graph G in multiline adjacency list format to path

Parameters
----------
G : NetworkX graph

path : string or file
   Filename or file handle to write to.
   Filenames ending in .gz or .bz2 will be compressed.

comments : string, optional
   Marker for comment lines

delimiter : string, optional
   Separator for node labels

encoding : string, optional
   Text encoding.

Examples
--------
>>> from pathlib import Path
>>> import tempfile
>>> tmp_path = Path(tempfile.gettempdir())

>>> G = nx.path_graph(4)
>>> fpath = tmp_path / "test.multi_adjlist"
>>> nx.write_multiline_adjlist(G, fpath)

View the data as stored in the file, ignoring header lines which start with
the comment character ("#" by default):

>>> with open(fpath) as fh:
...     lines_from_file = fh.readlines()
>>> print("".join(l for l in lines_from_file if not l.startswith("#")))
0 1
1 {}
1 1
2 {}
2 1
3 {}
3 0
<BLANKLINE>

The path can be a file handle or a string with the name of the file. If a
file handle is provided, it has to be opened in 'wb' mode.

>>> fpath = tmp_path / "test.multi_adjlist2"
>>> with open(fpath, "wb") as fh:
...     nx.write_multiline_adjlist(G, fh)
>>> with open(fpath) as fh:
...     lines_from_file = fh.readlines()
>>> print("".join(l for l in lines_from_file if not l.startswith("#")))
0 1
1 {}
1 1
2 {}
2 1
3 {}
3 0
<BLANKLINE>

See Also
--------
read_multiline_adjlist
NÚ Ú
z GMT )
ÚsysÚtimeÚjoinÚargvÚasctimeÚgmtimeÚnameÚwriteÚencoder   )
r   Úpathr   ÚcommentsÚencodingr   r    ÚpargsÚheaderÚ	multilines
   &&&&&     r   Úwrite_multiline_adjlistr.   ‰   sÀ   € óH Ûà�s—x‘x §¡Ó)Õ)€Eàˆ'�ˆØ
õ	à�$—,‘,˜tŸ{™{›}Ó-Ð.¨bÐ
1õ	2ð õ	ð ˆa�f‰fˆX�Rˆ.õ		ð ð 	‡J�Jˆv�}‰}˜XÓ&Ô'ä/°Ö=ˆ	Ø�TÕˆ	Ø�
‰
�9×#Ñ# HÓ-Ö.ó >ó    T)ÚgraphsÚreturns_graphc           	     ój  € ^ RI Hp \        P                  ! ^ V4      pV  EFN  pVP	                  V4      p	V	^ 8¼  d   VRV	 pV'       g   K+   VP                  R4      P                  V4      w  r«\        V4      pTe
    T! T
4      p
TP                  T
4       \        T4       FÈ  p  \        T 4      pTP	                  T4      p	T	^ 8¼  d   TRT	 pT'       g   K4   TP                  R4      P                  T4      p\        T4      pT^8  d   Kl  TP                  ^ 4      pR	P!                  T4      pTe
    T! T4      pTe    R
T! T4      /pM	 T! T4      pTP"                  ! T
T3/ TB  KÊ  	  EKQ  	  V#   \         d   p\        RT R24      ThRp?ii ; i  \         d   p\        RT
 RT 24      ThRp?ii ; i  \         d   pRT
 R2p\        T4      ThRp?ii ; i  \         d   p\        RT RT 24      ThRp?ii ; i  \         d   p\        RT RT 24      ThRp?ii ; i   / p LÜ; i)aÆ  Parse lines of a multiline adjacency list representation of a graph.

Parameters
----------
lines : list or iterator of strings
    Input data in multiline adjlist format

create_using : NetworkX graph constructor, optional (default=nx.Graph)
   Graph type to create. If graph instance, then cleared before populated.

nodetype : Python type, optional
   Convert nodes to this type.

edgetype : Python type, optional
   Convert edges to this type.

comments : string, optional
   Marker for comment lines

delimiter : string, optional
   Separator for node labels.  The default is whitespace.

Returns
-------
G: NetworkX graph
    The graph corresponding to the lines in multiline adjacency list format.

Examples
--------
>>> lines = [
...     "1 2",
...     "2 {'weight':3, 'name': 'Frodo'}",
...     "3 {}",
...     "2 1",
...     "5 {'weight':6, 'name': 'Saruman'}",
... ]
>>> G = nx.parse_multiline_adjlist(iter(lines), nodetype=int)
>>> list(G)
[1, 2, 3, 5]

)Úliteral_evalNr   z(Failed to read node and degree on line (Ú)zFailed to convert node (z
) to type z"Failed to find neighbor for node (Ú ÚweightzFailed to convert edge data ()Úastr3   ÚnxÚempty_graphÚfindÚrstripÚsplitÚintÚBaseExceptionÚ	TypeErrorÚadd_nodeÚrangeÚnextÚStopIterationr   Úpopr!   Úadd_edge)Úlinesr)   r   Úcreate_usingÚnodetypeÚedgetyper3   r   ÚlineÚpr   r   ÚerrÚiÚmsgÚvlistÚnumbÚvr   Úedgedatas   &&&&&&              r   Úparse_multiline_adjlistrS   ß   sv  € õZ !ä
�Š�q˜,Ó'€AÜˆØ�I‰I�hÓˆØ�Œ6Ø˜˜�8ˆDßÙð	YØ—{‘{ 4Ó(×.Ñ.¨yÓ9‰HˆQÜ�c“(ˆCð ÒðÙ˜Q“K�ð
 	
�
‰
�1ŒÜ�s–ˆAØð2Ü ›;�Dð —I‘I˜hÓ'�Ø˜”6Ø  ˜8�Dß‘4ØØ—K‘K Ó%×+Ñ+¨IÓ6ˆEÜ�u“:ˆDØ�aŒxÙØ—	‘	˜!“ˆAØ—7‘7˜5“>ˆDØÒ#ðÙ  ›�Að
 Ò#ðØ (©(°4«.Ð9‘Hð"Ù+¨DÓ1�Hð �JŠJ�q˜!Ñ(˜xÔ(ôK ñ' ðt €Høôc ô 	YÜÐFÀtÀfÈAÐNÓOÐUXÐXûð	Yûô
 !ô ÜØ.¨q¨c°¸H¸:ÐFóàðûðûô %ô 2Ø>¸q¸cÀÐC�CÜ# C›.¨cÐ1ûð2ûô" %ô Ü#Ø2°1°#°ZÀ¸zÐJóàðûðûô %ô Ü#Ø7¸°v¸ZÈÀzÐRóàðûðûð"Ø!’Hús„   Á-E5Á>FÂ'F=Ä5G"Å
HÅH,Å5FÆ FÆFÆF:Æ#F5Æ5F:Æ=GÇGÇGÇ"HÇ-G?Ç?HÈH)ÈH$È$H)È,H2Úrbc           	     ó>   a€ V3R lV  4       p\        VVVVVVR7      # )an  Read graph in multi-line adjacency list format from path.

Parameters
----------
path : string or file
   Filename or file handle to read.
   Filenames ending in .gz or .bz2 will be decompressed.

create_using : NetworkX graph constructor, optional (default=nx.Graph)
   Graph type to create. If graph instance, then cleared before populated.

nodetype : Python type, optional
   Convert nodes to this type.

edgetype : Python type, optional
   Convert edge data to this type.

comments : string, optional
   Marker for comment lines

delimiter : string, optional
   Separator for node labels.  The default is whitespace.

Returns
-------
G : NetworkX graph

Examples
--------
>>> from pathlib import Path
>>> import tempfile
>>> tmp_path = Path(tempfile.gettempdir())

>>> G = nx.path_graph(4)
>>> fpath = tmp_path / "test.multi_adjlistP4"
>>> nx.write_multiline_adjlist(G, fpath)
>>> H = nx.read_multiline_adjlist(fpath)

Data read from the file are interpreted as strings by default, regardless of
the node type of the original graph.

>>> G.edges
EdgeView([(0, 1), (1, 2), (2, 3)])
>>> H.edges
EdgeView([('0', '1'), ('1', '2'), ('2', '3')])

The node data can be converted to a specific type with the `nodetype`
parameter.

>>> H = nx.read_multiline_adjlist(fpath, nodetype=int)
>>> H.edges
EdgeView([(0, 1), (1, 2), (2, 3)])
>>> nx.utils.edges_equal(G.edges, H.edges)
True

Since nodes must be hashable, the function `nodetype` must return hashable
types (e.g. int, float, str, frozenset - or tuples of those, etc.)

The optional `create_using` parameter indicates the type of NetworkX graph
created. The default is ``nx.Graph``, an undirected graph. To read the data
as a directed graph use:

>>> H = nx.read_multiline_adjlist(fpath, create_using=nx.DiGraph)
>>> H.is_directed()
True

The path can be a file or a string with the name of the file. If a
file is provided, it has to be opened in 'rb' mode.

>>> with open(fpath, "rb") as fh:
...     H = nx.read_multiline_adjlist(fh, nodetype=int)
>>> H.edges
EdgeView([(0, 1), (1, 2), (2, 3)])

Notes
-----
This format does not store graph, node, or edge data.

See Also
--------
write_multiline_adjlist
c              3   óD   <"  € T F  qP                  S4      x € K  	  R # 5i)N)Údecode)Ú.0rJ   r*   s   & €r   Ú	<genexpr>Ú)read_multiline_adjlist.<locals>.<genexpr>©  s   øé € Ð4©t t�[‰[˜×"Ð"«tùs   ƒ )r)   r   rG   rH   rI   )rS   )r(   r)   r   rG   rH   rI   r*   rF   s   &&&&&&f r   Úread_multiline_adjlistr[   L  s/   ø€ ôz 5©tÓ4€EÜ"ØØØØ!ØØôð r/   )r   r.   rS   r[   )r   )r   Ú#úutf-8)r\   NNNN)r\   NNNNr]   )Ú__doc__Ú__all__Únetworkxr8   Únetworkx.utilsr   r   r.   Ú_dispatchablerS   r[   © r/   r   Ú<module>rd      s”   ðñò6€ó Ý $ô_ñD ˆ1�4ÔóR/ó ðR/ðj ×Ò˜¨TÔ2óió 3ðiñX ˆ1�4ÔØ×Ò˜¨TÔ2ócó 3ó òcr/   