
    hW3                        S r SSKJr  / SQr " S S\5      r " S S\5      r " S S	\5      r " S
 S\5      r " S S\5      r " S S\5      r	 " S S\5      r
 " S S\5      r " S S\5      r " S S\5      r " S S\5      rg)zViews of core data structures such as nested Mappings (e.g. dict-of-dicts).
These ``Views`` often restrict element access, with either the entire view or
layers of nested mappings being read-only.
    )Mapping)	AtlasViewAdjacencyViewMultiAdjacencyView
UnionAtlasUnionAdjacencyUnionMultiInnerUnionMultiAdjacencyFilterAtlasFilterAdjacencyFilterMultiInnerFilterMultiAdjacencyc                   R    \ rS rSrSrSrS rS rS rS r	S r
S	 rS
 rS rS rSrg)r      a(  An AtlasView is a Read-only Mapping of Mappings.

It is a View into a dict-of-dict data structure.
The inner level of dict is read-write. But the
outer level is read-only.

See Also
========
AdjacencyView: View into dict-of-dict-of-dict
MultiAdjacencyView: View into dict-of-dict-of-dict-of-dict
_atlasc                     SU R                   0$ Nr   r   selfs    L/var/www/html/env/lib/python3.13/site-packages/networkx/classes/coreviews.py__getstate__AtlasView.__getstate__&   s    $++&&    c                     US   U l         g r   r   r   states     r   __setstate__AtlasView.__setstate__)   s    Hor   c                     Xl         g Nr   )r   ds     r   __init__AtlasView.__init__,   s    r   c                 ,    [        U R                  5      $ r!   )lenr   r   s    r   __len__AtlasView.__len__/       4;;r   c                 ,    [        U R                  5      $ r!   )iterr   r   s    r   __iter__AtlasView.__iter__2   s    DKK  r   c                      U R                   U   $ r!   r   r   keys     r   __getitem__AtlasView.__getitem__5   s    {{3r   c                 f    U R                    Vs0 s H  oX   R                  5       _M     sn$ s  snf r!   r   copyr   ns     r   r5   AtlasView.copy8   )    +/;;7;a47<<>!;777   .c                 ,    [        U R                  5      $ r!   )strr   r   s    r   __str__AtlasView.__str__;   r)   r   c                 P    U R                   R                   SU R                  < S3$ )N())	__class____name__r   r   s    r   __repr__AtlasView.__repr__>   s$    ..))*!DKK?!<<r   NrC   
__module____qualname____firstlineno____doc__	__slots__r   r   r#   r'   r,   r1   r5   r=   rD   __static_attributes__ r   r   r   r      s;    
 I'& ! 8 =r   r   c                   (    \ rS rSrSrSrS rS rSrg)r   B   a*  An AdjacencyView is a Read-only Map of Maps of Maps.

It is a View into a dict-of-dict-of-dict data structure.
The inner level of dict is read-write. But the
outer levels are read-only.

See Also
========
AtlasView: View into dict-of-dict
MultiAdjacencyView: View into dict-of-dict-of-dict-of-dict
rM   c                 2    [        U R                  U   5      $ r!   )r   r   r   names     r   r1   AdjacencyView.__getitem__Q   s    T*++r   c                 f    U R                    Vs0 s H  oX   R                  5       _M     sn$ s  snf r!   r4   r6   s     r   r5   AdjacencyView.copyT   r9   r:   N	rC   rG   rH   rI   rJ   rK   r1   r5   rL   rM   r   r   r   r   B   s    
 I,8r   r   c                   (    \ rS rSrSrSrS rS rSrg)r   X   a2  An MultiAdjacencyView is a Read-only Map of Maps of Maps of Maps.

It is a View into a dict-of-dict-of-dict-of-dict data structure.
The inner level of dict is read-write. But the
outer levels are read-only.

See Also
========
AtlasView: View into dict-of-dict
AdjacencyView: View into dict-of-dict-of-dict
rM   c                 2    [        U R                  U   5      $ r!   )r   r   rQ   s     r   r1   MultiAdjacencyView.__getitem__g   s    T[[.//r   c                 f    U R                    Vs0 s H  oX   R                  5       _M     sn$ s  snf r!   r4   r6   s     r   r5   MultiAdjacencyView.copyj   r9   r:   NrV   rM   r   r   r   r   X   s    
 I08r   r   c                   R    \ rS rSrSrSrS rS rS rS r	S r
S	 rS
 rS rS rSrg)r   n   a  A read-only union of two atlases (dict-of-dict).

The two dict-of-dicts represent the inner dict of
an Adjacency:  `G.succ[node]` and `G.pred[node]`.
The inner level of dict of both hold attribute key:value
pairs and is read-write. But the outer level is read-only.

See Also
========
UnionAdjacency: View into dict-of-dict-of-dict
UnionMultiAdjacency: View into dict-of-dict-of-dict-of-dict
_succ_predc                 4    U R                   U R                  S.$ Nr_   r_   r   s    r   r   UnionAtlas.__getstate__~       djj99r   c                 ,    US   U l         US   U l        g Nr`   ra   r_   r   s     r   r   UnionAtlas.__setstate__       7^
7^
r   c                     Xl         X l        g r!   r_   r   succpreds      r   r#   UnionAtlas.__init__   s    

r   c                 ~    [        U R                  R                  5       U R                  R                  5       -  5      $ r!   )r&   r`   keysra   r   s    r   r'   UnionAtlas.__len__   s(    4::??$tzz'8899r   c                     [        [        U R                  R                  5       5      [        U R                  R                  5       5      -  5      $ r!   )r+   setr`   rp   ra   r   s    r   r,   UnionAtlas.__iter__   s2    C

)*S1B-CCDDr   c                 `     U R                   U   $ ! [         a    U R                  U   s $ f = fr!   )r`   KeyErrorra   r/   s     r   r1   UnionAtlas.__getitem__   s2    	#::c?" 	#::c?"	#s    --c                 (   U R                   R                  5        VVs0 s H  u  pXR                  5       _M     nnnU R                  R                  5        H1  u  pX;   a  X1   R	                  U5        M  UR                  5       X1'   M3     U$ s  snnf r!   )r`   itemsr5   ra   update)r   nbrddresults       r   r5   UnionAtlas.copy   sw    04

0@0@0BC0BWS#wwy.0BCzz'')GC}""2& ggi	 *
  Ds   Bc                 H    [        U  Vs0 s H  oX   _M	     sn5      $ s  snf r!   r<   r   r{   s     r   r=   UnionAtlas.__str__   #    d3dsNd3443   c                 l    U R                   R                   SU R                  < SU R                  < S3$ Nr@   z, rA   rB   rC   r`   ra   r   s    r   rD   UnionAtlas.__repr__   .    ..))*!DJJ>DJJ>KKr   ra   r`   NrF   rM   r   r   r   r   n   s=     #I:$:E#5Lr   r   c                   R    \ rS rSrSrSrS rS rS rS r	S r
S	 rS
 rS rS rSrg)r      a  A read-only union of dict Adjacencies as a Map of Maps of Maps.

The two input dict-of-dict-of-dicts represent the union of
`G.succ` and `G.pred`. Return values are UnionAtlas
The inner level of dict is read-write. But the
middle and outer levels are read-only.

succ : a dict-of-dict-of-dict {node: nbrdict}
pred : a dict-of-dict-of-dict {node: nbrdict}
The keys for the two dicts should be the same

See Also
========
UnionAtlas: View into dict-of-dict
UnionMultiAdjacency: View into dict-of-dict-of-dict-of-dict
r_   c                 4    U R                   U R                  S.$ rc   r_   r   s    r   r   UnionAdjacency.__getstate__   re   r   c                 ,    US   U l         US   U l        g rg   r_   r   s     r   r   UnionAdjacency.__setstate__   ri   r   c                     [        [        UR                  5       5      [        UR                  5       5      -  5      S:X  d   eXl        X l        g )Nr   )r&   rs   rp   r`   ra   rk   s      r   r#   UnionAdjacency.__init__   s:    3tyy{#c$))+&6671<<<

r   c                 ,    [        U R                  5      $ r!   )r&   r`   r   s    r   r'   UnionAdjacency.__len__   s    4::r   c                 ,    [        U R                  5      $ r!   )r+   r`   r   s    r   r,   UnionAdjacency.__iter__   s    DJJr   c                 N    [        U R                  U   U R                  U   5      $ r!   )r   r`   ra   r   s     r   r1   UnionAdjacency.__getitem__   s    $**S/4::c?;;r   c                 f    U R                    Vs0 s H  oX   R                  5       _M     sn$ s  snf r!   )r`   r5   r6   s     r   r5   UnionAdjacency.copy   s)    +/::6:a47<<>!:666r:   c                 H    [        U  Vs0 s H  oX   _M	     sn5      $ s  snf r!   r   r   s     r   r=   UnionAdjacency.__str__   r   r   c                 l    U R                   R                   SU R                  < SU R                  < S3$ r   r   r   s    r   rD   UnionAdjacency.__repr__   r   r   r   NrF   rM   r   r   r   r      s<    " #I:$ <75Lr   r   c                   (    \ rS rSrSrSrS rS rSrg)r	      a  A read-only union of two inner dicts of MultiAdjacencies.

The two input dict-of-dict-of-dicts represent the union of
`G.succ[node]` and `G.pred[node]` for MultiDiGraphs.
Return values are UnionAtlas.
The inner level of dict is read-write. But the outer levels are read-only.

See Also
========
UnionAtlas: View into dict-of-dict
UnionAdjacency:  View into dict-of-dict-of-dict
UnionMultiAdjacency:  View into dict-of-dict-of-dict-of-dict
rM   c                    XR                   ;   nXR                  ;   nU(       aF  U(       a&  [        U R                   U   U R                  U   5      $ [        U R                   U   0 5      $ [        0 U R                  U   5      $ r!   )r`   ra   r   )r   nodein_succin_preds       r   r1   UnionMultiInner.__getitem__   sk    **$**$!$**T"2DJJt4DEEdjj.33"djj.//r   c                     [        U R                  R                  5       5      [        U R                  R                  5       5      -  nU Vs0 s H  o"X   R	                  5       _M     sn$ s  snf r!   )rs   r`   rp   ra   r5   )r   nodesr7   s      r   r5   UnionMultiInner.copy   sO    DJJOO%&TZZ__->)??+015a47<<>!5111s   A+NrV   rM   r   r   r	   r	      s     I02r   r	   c                   "    \ rS rSrSrSrS rSrg)r
      ar  A read-only union of two dict MultiAdjacencies.

The two input dict-of-dict-of-dict-of-dicts represent the union of
`G.succ` and `G.pred` for MultiDiGraphs. Return values are UnionAdjacency.
The inner level of dict is read-write. But the outer levels are read-only.

See Also
========
UnionAtlas:  View into dict-of-dict
UnionMultiInner:  View into dict-of-dict-of-dict
rM   c                 N    [        U R                  U   U R                  U   5      $ r!   )r	   r`   ra   )r   r   s     r   r1   UnionMultiAdjacency.__getitem__  s!    tzz$/D1ABBr   N)rC   rG   rH   rI   rJ   rK   r1   rL   rM   r   r   r
   r
      s    
 ICr   r
   c                   <    \ rS rSrSrS rS rS rS rS r	S r
S	rg
)r   i  a  A read-only Mapping of Mappings with filtering criteria for nodes.

It is a view into a dict-of-dict data structure, and it selects only
nodes that meet the criteria defined by ``NODE_OK``.

See Also
========
FilterAdjacency
FilterMultiInner
FilterMultiAdjacency
c                     Xl         X l        g r!   )r   NODE_OK)r   r"   r   s      r   r#   FilterAtlas.__init__  s    r   c                 N  ^  [        T R                  S5      (       a  T R                  R                  $ [        T R                  S5      (       a:  [        T R                  R                  T R
                  R                  5       -  5      $ [        U 4S jT R
                   5       5      $ )Nlengthr   c              3   X   >#    U  H  nTR                  U5      (       d  M  S v   M!     g7f   Nr   .0r7   r   s     r   	<genexpr>&FilterAtlas.__len__.<locals>.<genexpr>#       =kT\\!_11k   *	*hasattrr   r   r&   r   r   rp   sumr   s   `r   r'   FilterAtlas.__len__  s     4<<**<<&&&4<<))t||))DKK,<,<,>>??=dkk===r   c                   ^   S[        T R                  R                  5      -  [        T R                  5      :  nU(       a   U 4S jT R                  R                   5       $ U 4S jT R                   5       $ ! [         a    Sn NKf = f)N   Fc              3   J   >#    U  H  oTR                   ;   d  M  Uv   M     g 7fr!   r   r   s     r   r   'FilterAtlas.__iter__.<locals>.<genexpr>+       F1!$++5EAA1   #	#c              3   X   >#    U  H  nTR                  U5      (       d  M  Uv   M!     g 7fr!   r   r   s     r   r   r   ,       :;a$,,q/;r   r&   r   r   r   AttributeErrorr   node_ok_shorters   ` r   r,   FilterAtlas.__iter__%  n    	$#dll&8&8"99C<LLO Ft||11FF:4;;::	  	$#O	$   8A8 8BBc                     XR                   ;   a%  U R                  U5      (       a  U R                   U   $ [        SU S35      e)NKey 
 not found)r   r   rv   r/   s     r   r1   FilterAtlas.__getitem__.  s=    ++$,,s"3"3;;s##cU*-..r   c                 H    [        U  Vs0 s H  oX   _M	     sn5      $ s  snf r!   r   r   s     r   r=   FilterAtlas.__str__3  r   r   c                 l    U R                   R                   SU R                  < SU R                  < S3$ r   )rB   rC   r   r   r   s    r   rD   FilterAtlas.__repr__6  s/    ..))*!DKK?"T\\<LANNr   )r   r   NrC   rG   rH   rI   rJ   r#   r'   r,   r1   r=   rD   rL   rM   r   r   r   r     s&    
>;/
5Or   r   c                   <    \ rS rSrSrS rS rS rS rS r	S r
S	rg
)r   i:  a@  A read-only Mapping of Mappings with filtering criteria for nodes and edges.

It is a view into a dict-of-dict-of-dict data structure, and it selects nodes
and edges that satisfy specific criteria defined by ``NODE_OK`` and ``EDGE_OK``,
respectively.

See Also
========
FilterAtlas
FilterMultiInner
FilterMultiAdjacency
c                 (    Xl         X l        X0l        g r!   )r   r   EDGE_OK)r   r"   r   r   s       r   r#   FilterAdjacency.__init__H  s    r   c                 N  ^  [        T R                  S5      (       a  T R                  R                  $ [        T R                  S5      (       a:  [        T R                  R                  T R
                  R                  5       -  5      $ [        U 4S jT R
                   5       5      $ )Nr   r   c              3   X   >#    U  H  nTR                  U5      (       d  M  S v   M!     g7fr   r   r   s     r   r   *FilterAdjacency.__len__.<locals>.<genexpr>T  r   r   r   r   s   `r   r'   FilterAdjacency.__len__M  r   r   c                   ^   S[        T R                  R                  5      -  [        T R                  5      :  nU(       a   U 4S jT R                  R                   5       $ U 4S jT R                   5       $ ! [         a    Sn NKf = f)Nr   Fc              3   J   >#    U  H  oTR                   ;   d  M  Uv   M     g 7fr!   r   r   s     r   r   +FilterAdjacency.__iter__.<locals>.<genexpr>\  r   r   c              3   X   >#    U  H  nTR                  U5      (       d  M  Uv   M!     g 7fr!   r   r   s     r   r   r   ]  r   r   r   r   s   ` r   r,   FilterAdjacency.__iter__V  r   r   c                    ^ ^ TT R                   ;   a6  T R                  T5      (       a   UU 4S jn[        T R                   T   U5      $ [        ST S35      e)Nc                 X   > TR                  U 5      =(       a    TR                  TU 5      $ r!   r   r   )r{   r   r   s    r   new_node_ok0FilterAdjacency.__getitem__.<locals>.new_node_okb  s"    ||C(DT\\$-DDr   r   r   r   r   r   rv   )r   r   r   s   `` r   r1   FilterAdjacency.__getitem___  sO    4;;4<<#5#5E t{{40+>>dV:.//r   c                 H    [        U  Vs0 s H  oX   _M	     sn5      $ s  snf r!   r   r   s     r   r=   FilterAdjacency.__str__h  r   r   c                     U R                   R                  nU SU R                  < SU R                  < SU R                  < S3$ r   )rB   rC   r   r   r   rQ   s     r   rD   FilterAdjacency.__repr__k  s>    ~~&&qr$,,)9DLL;K1MMr   )r   r   r   Nr   rM   r   r   r   r   :  s&    
>;05Nr   r   c                   $    \ rS rSrSrS rS rSrg)r   ip  a6  A read-only Mapping of Mappings with filtering criteria for nodes and edges.

It is a view into a dict-of-dict-of-dict-of-dict data structure, and it selects nodes
and edges that meet specific criteria defined by ``NODE_OK`` and ``EDGE_OK``.

See Also
========
FilterAtlas
FilterAdjacency
FilterMultiAdjacency
c              #     ^ #     S[        T R                  R                  5      -  [        T R                  5      :  nU(       a!  U 4S jT R                  R                   5       nOU 4S jT R                   5       nU H@  nSnT R                  U    H  nT R                  X55      (       d  M  Sn  O   USL d  M<  Uv   MB     g ! [         a    Sn Nf = f7f)Nr   Fc              3   J   >#    U  H  oTR                   ;   d  M  Uv   M     g 7fr!   r   r   s     r   r   ,FilterMultiInner.__iter__.<locals>.<genexpr>  s     J#5adkk9I#5r   c              3   X   >#    U  H  nTR                  U5      (       d  M  Uv   M!     g 7fr!   r   r   s     r   r   r     s     B;a$,,q/;r   T)r&   r   r   r   r   r   )r   r   my_nodesr7   some_keys_okr0   s   `     r   r,   FilterMultiInner.__iter__}  s     	$#dll&8&8"99C<LLO J4<<#5#5JHB4;;BHA L{{1~<<''#'L & t#   	$#O	$s4   C8C A+C,	C9	CCCCCc                    ^ ^ TT R                   ;   a6  T R                  T5      (       a   UU 4S jn[        T R                   T   U5      $ [        ST S35      e)Nc                 (   > TR                  TU 5      $ r!   )r   )r0   r{   r   s    r   r   1FilterMultiInner.__getitem__.<locals>.new_node_ok  s    ||C--r   r   r   r   )r   r{   r   s   `` r   r1   FilterMultiInner.__getitem__  sN    $++$,,s"3"3. t{{3/==cU*-..r   rM   N)rC   rG   rH   rI   rJ   r,   r1   rL   rM   r   r   r   r   p  s    
$/r   r   c                       \ rS rSrSrS rSrg)r   i  aC  A read-only Mapping of Mappings with filtering criteria
for nodes and edges.

It is a view into a dict-of-dict-of-dict-of-dict data structure,
and it selects nodes and edges that satisfy specific criteria
defined by ``NODE_OK`` and ``EDGE_OK``, respectively.

See Also
========
FilterAtlas
FilterAdjacency
FilterMultiInner
c                    ^ ^ TT R                   ;   aA  T R                  T5      (       a+  UU 4S jn[        T R                   T   T R                  U5      $ [        ST S35      e)Nc                 X   > TR                  U 5      =(       a    TR                  TX5      $ r!   r   )r{   r0   r   r   s     r   edge_ok1FilterMultiAdjacency.__getitem__.<locals>.edge_ok  s"    ||C(IT\\$-IIr   r   r   )r   r   r   rv   )r   r   r  s   `` r   r1    FilterMultiAdjacency.__getitem__  sU    4;;4<<#5#5J $DKK$5t||WMMdV:.//r   rM   N)rC   rG   rH   rI   rJ   r1   rL   rM   r   r   r   r     s    0r   r   N)rJ   collections.abcr   __all__r   r   r   r   r   r	   r
   r   r   r   r   rM   r   r   <module>r     s   
 $(= (=V8I 8,8 8,4L 4Ln1LW 1Lh2j 2>C. C&,O' ,O^3Ng 3Nl&/ &/R0? 0r   