+
    )i*"                         R t ^ RIt^ RIt^ RIHt . ROtR t]! ^RR7      RR l4       t]! ^ RR7      ]P                  ! RRR	7      RR
 l4       4       t
]P                  ! RRR	7      R 4       tR tR# )a
  
*****
Pajek
*****
Read graphs in Pajek format.

This implementation handles directed and undirected graphs including
those with self loops and parallel edges.

Format
------
See http://vlado.fmf.uni-lj.si/pub/networks/pajek/doc/draweps.htm
for format information.

N)	open_filec              #  B  "   V P                   R8X  d   RpMV P                   pRV P                  4        2x  \        V 4      p\        \	        V\        ^\        V4      ^,           4      4      4      pV EFL  pV P                  P                  V/ 4      P                  4       pVP                  RR4      pVP                  RR4      p \        VP                  RW4,          4      4      pYT&   TP                  R	R
4      p
RP                  \        \         YYgT
34      4      pTP#                  4        F  w  r\%        T\&        4      '       d9   TP)                  4       R8w  d$   TR\!        T4       R\!        T4       2,          pKS  \*        P,                  ! RT R\%        T\&        4      '       d   RMR R24       K  	  Tx  EKO  	  V P/                  4       '       d   Rx  MRx  V P1                  RR7       F  w  rpVP                  4       pVP                  RR4      pRP                  \        \         W>,          W=,          V34      4      pVP#                  4        F  w  r\%        V\&        4      '       d9   VP)                  4       R8w  d$   VR\!        V4       R\!        V4       2,          pKS  \*        P,                  ! RT R\%        V\&        4      '       d   RMR R24       K  	  Vx  K  	  R#   \         d    p	T	;P                  R,          un        h Rp	?	ii ; i5i)zGenerate lines in Pajek graph format.

Parameters
----------
G : graph
   A Networkx graph

References
----------
See http://vlado.fmf.uni-lj.si/pub/networks/pajek/doc/draweps.htm
for format information.
 NetworkXz
*vertices xg        yidNshapeellipse zNode attribute z is not processed. zEmpty attributezNon-string attribute.*arcs*edgesT)dataweightg      ?zEdge attribute )zSPajek format requires 'id' to be an int(). Refer to the 'Relabeling nodes' section.)nameorderlistdictziprangelennodesgetcopypopint
ValueErrorargsjoinmap	make_qstritems
isinstancestrstripwarningswarnis_directededges)Gr   r   
nodenumbernnar   r   r   errr	   skvuedgedatadvalues   &                 V/var/www/html/photoedit/myenv/lib/python3.14/site-packages/networkx/readwrite/pajek.pygenerate_pajekr7      s     	vv|vv qwwyk
""GEc%q#e*q.!9:;J WW[[B$$&FF3FF3		RVVD*-01B 1w	*HHSRA%$89:HHJDA!S!!aggi2oq1a	!~66%aS(;R\]^`cRdRd=N  kA  <C  CD  E	  7 < 	}}''t',hMMOh$HHSZ]JM5$IJKGGIDA!S!!aggi2oq1a	!~66%aS(;R\]^`cRdRd=N  kA  <C  CD  E	   -5  	HH  H 	s2   CL!K2(C2LDL2L=LLLwb)modec                |    \        V 4       F,  pVR,          pVP                  VP                  V4      4       K.  	  R# )a`  Write graph in Pajek format to path.

Parameters
----------
G : graph
   A Networkx graph
path : file or string
   File or filename to write.
   Filenames ending in .gz or .bz2 will be compressed.

Examples
--------
>>> G = nx.path_graph(4)
>>> nx.write_pajek(G, "test.netP4")

Warnings
--------
Optional node attributes and edge attributes must be non-empty strings.
Otherwise it will not be written into the file. You will need to
convert those attributes to strings if you want to keep them.

References
----------
See http://vlado.fmf.uni-lj.si/pub/networks/pajek/doc/draweps.htm
for format information.

N)r7   writeencode)r*   pathencodinglines   &&& r6   write_pajekrA   c   s1    8 q!

4;;x() "    rbT)graphsreturns_graphc                2   a V3R lV  4       p\        V4      # )a  Read graph in Pajek format from path.

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

Returns
-------
G : NetworkX MultiGraph or MultiDiGraph.

Examples
--------
>>> G = nx.path_graph(4)
>>> nx.write_pajek(G, "test.net")
>>> G = nx.read_pajek("test.net")

To create a Graph instead of a MultiGraph use

>>> G1 = nx.Graph(G)

References
----------
See http://vlado.fmf.uni-lj.si/pub/networks/pajek/doc/draweps.htm
for format information.
c              3   D   <"   T F  qP                  S4      x  K  	  R # 5i)N)decode).0r@   r?   s   & r6   	<genexpr>read_pajek.<locals>.<genexpr>   s     4tt[[""ts    )parse_pajek)r>   r?   liness   &f r6   
read_pajekrN      s    < 5t4EurB   c           	     
  a ^ RI p\        V \        4      '       d   \        V P	                  R4      4      p \        V  Uu. uF  q"P                  R4      NK  	  up4      p \        P                  ! 4       p. oV '       Ed    \        V 4      pTP                  4       P                  R4      '       d&    TP	                  R^4      w  rVYcP                  R&   K_  TP                  4       P                  R4      '       EdP   / pTP	                  4       w  rH\        \        T4      4       EF  p	\        T 4      p TP	                  \        T4      P                  R4      4       U
u. uF  qP!                  R4      NK  	  pp
TR,          w  rSP%                  T4       TP'                  T4       YWT&   YP(                  T,          R&    TR	,          w  rpTP(                  T,          P+                  R
\-        T
4      R\-        T4      RT/4       \/        TR,          TR,          4      pTP(                  T,          P+                  T4       EK"  	  EK  TP                  4       P                  R4      '       g'   TP                  4       P                  R4      '       Edt   TP                  4       P                  R4      '       d   \        P0                  ! T4      pTP                  4       P                  R4      '       d   TP3                  4       pT  F  p TP	                  \        T4      P                  R4      4       U
u. uF  qP!                  R4      NK  	  pp
\5        T4      ^8  d   K\  TR,          w  ppXP7                  TT4      pTP7                  TT4      p/ p TR,          pTP+                  R\-        T^ ,          4      /4       \/        TR,          TR,          4      pTP+                  T4       TP8                  ! TT3/ TB  K  	  EK  TP                  4       P                  R4      '       g   EK  \        P:                  ! T4      pT3R l\=        T 4       4       pTP?                  T4       EK  V# u upi     T# ; i  \         d     EK  i ; iu up
i   \"         d    TP	                  \        T4      4      p ELEi ; i    EL; iu up
i   \"         d    TP	                  \        T4      4      p ELi ; i    EL>; i)zParse Pajek format graph from string or iterable.

Parameters
----------
lines : string or iterable
   Data in Pajek format.

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

See Also
--------
read_pajek

Nr;   z*networkr   z	*verticeszutf-8:       Nr   :rQ      Nr   r   r	   :rR   NrQ   :   NrQ   r   r   z*edge:rQ      Nr   :rT   NrQ   :   NrQ   z*matrixc              3      <"   T FY  w  r\        VP                  4       4       F7  w  r4\        V4      ^ 8w  g   K  SV,          SV,          R\        V4      /3x  K9  	  K[  	  R# 5i)rP   r   N)	enumeratesplitr   )rI   rowr@   colr   labelss   &    r6   rJ   parse_pajek.<locals>.<genexpr>  s[      #3KS#,TZZ\#:KSt9> BfSkHc$i+@A#: B#3s
   2A$*A$) shlexr#   r$   iterrX   rstripnxMultiDiGraphnextlower
startswithgraphr   r   r   r=   rH   AttributeErrorappendadd_noder   updatefloatr   
MultiGraphto_directedr   r   add_edgeDiGraphrW   add_edges_from)rM   r]   r@   r*   llabelr   
nodelabelsnnodesir   	splitliner   r   r	   
extra_attruivir2   r1   	edge_datawadj_listr[   s   &                      @r6   rL   rL      s   $  %U[[&'6++d#67E
AF
%	UA 779
++'ggdA.
 #'WWY!!+..J	IA3v;'K438;;s1v}}W?U3V!3Va)3V  !
 &cN	e$

5!!&2')t$"+C.KA%GGEN))eAhU1XwF
 !4)D/B
%%j1+ (, WWY!!(++qwwy/C/CG/L/Lwwy##G,,MM!$wwy##G,,MMO438;;s1v}}W?U3V!3Va)3V  ! y>A%"3BNN2r*NN2r*	!#A$$had%<=
 !4)D/B
  , 

1a-9-7 8 WWY!!),,

1A#,U#3H X&Hm 7	^ HW  ! & 4 %CF 3I4! & 4 %CF 3I4s   Q1 Q6 1Q> 3+RR7R AS+S6S
S,S;6Q;>RRR%R?>R?S
S%S87S8;T c                b    \        V \        4      '       g   \        V 4      p RV 9   d   RV  R2p V # )z[Returns the string representation of t.
Add outer double-quotes if the string has a space.
r   ")r#   r$   )ts   &r6   r!   r!     s3     aF
axs!HHrB   )rN   rL   r7   rA   )zUTF-8)__doc__r&   networkxr`   networkx.utilsr   __all__r7   rA   _dispatchablerN   rL   r!    rB   r6   <module>r      s       $
HGT 14* *@ 14T2 3 @ T2l 3l^rB   