
    )i[                     v   S SK r S SKJr  S SKJr  S SKJrJrJrJ	r	J
r
JrJrJr  SSKJr  SSKJrJrJrJrJrJr  SrSrSrSr\\\\\4   4   r\S	\\\4   4   r\(       a  SS
KJr  \\4S\S\S\S\4S jjr \4S\S\S\S\4S jjr!S\S\S\S\S\S\4S jr"\4S\S\#S\4S jjr$\4S\S\#S\4S jjr% S.S\S\S\S\4S jjr&S\S\	\   4S jr'S\	\   S\	\	\      4S  jr( " S! S"\)5      r* " S# S$\*5      r+ " S% S&\)5      r,/ S'Qr-/ S(Qr. " S) S*\/5      r0\0" S 5      r1\ " S+ S	5      5       r2 " S, S-\)5      r3g)/    N)	dataclass)
itemgetter)TYPE_CHECKINGAnyDictListOptionalSetTupleUnion   )utils)T_bboxT_numT_obj
T_obj_iter
T_obj_listT_point   TableSettings)Pageedgesx_tolerancey_tolerancereturnc                     / / S.nU  H  nX4S      R                  U5        M     [        R                  " US   SU5      n[        R                  " US   SU5      nXV-   $ )zg
Given a list of edges, snap any within `tolerance` pixels of one another
to their positional average.
vhorientationr   x0r   top)appendr   snap_objects)r   r   r   by_orientatione	snapped_v	snapped_hs          P/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/pdfplumber/table.py
snap_edgesr*      sk     352,>N'(//2  "">##6kJI"">##6{KI      r    	tolerancec                 >   US:X  a  Su  p4OUS:X  a  Su  p4O[        S5      e[        [        U [        U5      S95      nUS   /nUSS	  HP  nUS
   nXs   X   U-   ::  a*  Xt   X   :  a  [        R
                  " XXt   5      US
'   M=  M?  UR                  U5        MR     U$ )zs
Given a list of edges along the same infinite line, join those that
are within `tolerance` pixels of one another.
r   )r!   x1r   )r"   bottomzOrientation must be 'v' or 'h'keyr   r   N)
ValueErrorlistsortedr   r   resize_objectr#   )	r   r    r,   min_propmax_propsorted_edgesjoinedr&   lasts	            r)   join_edge_groupr<   '   s     c'(		,(9::u*X*>?@L1oF!"bz;4>I56{T^+"00Mr
 ,
 MM!  Mr+   snap_x_tolerancesnap_y_tolerancejoin_x_tolerancejoin_y_tolerancec                   ^^ S[         S[        [        [        4   4S jnUS:  d  US:  a  [	        XU5      n [        XS9n[        R                  " XeS9nUU4S jU 5       n[        [        R                  " U6 5      n U $ )zp
Using the `snap_edges` and `join_edge_group` methods above,
merge a list of edges into a more "seamless" list.
edger   c                 0    U S   S:X  a  SU S   4$ SU S   4$ )Nr    r   r"   r   r!    )rB   s    r)   	get_groupmerge_edges.<locals>.get_groupP   s-    #%e%%d$$r+   r   r0   c              3   \   >#    U  H!  u  p[        X!S    US    S:X  a  TOT5      v   M#     g7f)r   r   N)r<   ).0kitemsr?   r@   s      r)   	<genexpr>merge_edges.<locals>.<genexpr>[   s?       $HA 	Q4adck*?O	
 	
 $s   ),)
r   r   strr   r*   r5   	itertoolsgroupbyr4   chain)	r   r=   r>   r?   r@   rE   _sortededge_groupsedge_gens	      ``    r)   merge_edgesrT   D   s    % %%U
"3 % !/!354DEU*G##G;K $	H (+,ELr+   wordsword_thresholdc           
        ^ [         R                  " U [        S5      S5      n[        U4S jU5      n[	        [        [         R                  U5      5      n[        U5      S:X  a  / $ [        [        [        S5      U5      5      n[        [        [        S5      U5      5      n/ nU H(  nUUUUS   US   Xe-
  SS.UUUS	   US	   Xe-
  SS./-  nM*     U$ )
z]
Find (imaginary) horizontal lines that connect the tops
of at least `word_threshold` words.
r"   r   c                     > [        U 5      T:  $ NlenxrV   s    r)   <lambda>"words_to_edges_h.<locals>.<lambda>m       c!f&>r+   r   r!   r.   r   )r!   r.   r"   r/   widthr    r/   )
r   cluster_objectsr   filterr4   mapobjects_to_rectr[   minmax)	rU   rV   by_toplarge_clustersrectsmin_x0max_x1r   rs	    `       r)   words_to_edges_hrn   e   s     ""5*U*;Q?F>GNU**N;<E
5zQ	Z%u-.FZ%u-.FE xE(" {H+"
 	
 0 Lr+   c           
        ^^ [         R                  " U [        S5      S5      n[         R                  " U [        S5      S5      nS[        S[        4S jn[         R                  " XS5      nX#-   U-   n[        US S9n[        U4S	 jU5      n[        [        [         R                  U5      5      n	/ n
U	 H2  m[        U4S
 jU
 5       5      nU(       a  M!  U
R                  T5        M4     [        U
5      S:X  a  / $ [        [         R                  U
5      n[        [        U[        S5      S95      n[        [        [        S5      U5      5      n[        [        [        S5      U5      5      n[        [        [        S5      U5      5      nU Vs/ s H  nUS   US   UUUU-
  SS.PM     snUUUUUU-
  SS./-   $ s  snf )zm
Find (imaginary) vertical lines that connect the left, right, or
center of at least `word_threshold` words.
r!   r   r.   wordr   c                 0    [        U S   U S   -   5      S-  $ )Nr!   r.      )float)rp   s    r)   
get_center$words_to_edges_v.<locals>.get_center   s    T$Z$t*,-11r+   c                     [        U 5      * $ rY   rZ   )r]   s    r)   r^   "words_to_edges_v.<locals>.<lambda>   s
    c!fWr+   r0   c                     > [        U 5      T:  $ rY   rZ   r\   s    r)   r^   rw      r`   r+   c              3   R   >#    U  H  n[         R                  " TU5      v   M     g 7frY   )r   get_bbox_overlap)rH   cbboxs     r)   rK   #words_to_edges_v.<locals>.<genexpr>   s#     P?O!e,,T155?Os   $'r   r"   r/   r   r!   r.   r"   r/   heightr    )r   rb   r   r   r   r5   rc   r4   rd   objects_to_bboxanyr#   r[   bbox_to_rectrg   rf   )rU   rV   by_x0by_x1rt   	by_centerclusterssorted_clustersri   bboxescondensed_bboxesoverlapcondensed_rectssorted_rectsrl   min_top
max_bottombr|   s    `                @r)   words_to_edges_vr      s    !!%D)91=E!!%D)91=E2 25 2 %%e;I}y(H X+<=O>PN #e++^<=F &(P?OPPw##D) 
 !	%,,.>?OJt4DEFLZ%|45F#j'67GSH-|<=J 
 A D'D'  7*	
 
   7*	
		  
s   F>c           	        ^ 0 nS V^s/ s H  m[        [        U4S jU 5      5      PM     snu  pV[        U[        SS5      S9 H  n[        U[        SS5      S9 H  nUS   US   U-   ::  d  M  US   US   U-
  :  d  M%  US   US   U-
  :  d  M6  US   US   U-   ::  d  MG  US   US   4n	X;  a  / / S.X9'   X9   S   R	                  U5        X9   S	   R	                  U5        M     M     U$ s  snf )
z]
Given a list of edges, return the points at which they intersect
within `tolerance` pixels.
r   c                    > U S   T:H  $ )Nr    rD   )r]   os    r)   r^   (edges_to_intersections.<locals>.<lambda>   s    a.!3r+   r!   r"   r0   r/   r.   r   r   )r4   rc   r5   r   r#   )
r   r   r   intersectionsr   v_edgesh_edgesr   r   vertexs
       `     r)   edges_to_intersectionsr      s    &(MFPFPV3U;<jG GD%!89Zt%<=A5ah45x[QuX%;<tW4;!67tW4;!67D'1U8,.242,>M)%c*11!4%c*11!4 > : !s   #C/r   c                 V  ^ ^^^^ S[         S[         S[        4U 4S jjm[        [        T R	                  5       5      5      m[        T5      mS[        [            S[        S[        [           4UU U4S jjmUU4S j[        [        T5      5       5       n[        [        S	U5      5      $ )
a   
Given a list of points (`intersections`), return all rectangular "cells"
that those points describe.

`intersections` should be a dictionary with (x0, top) tuples as keys,
and a list of edge objects as values. The edge objects should correspond
to the edges that touch the intersection.
p1p2r   c                 N  > S[         S[        [           4S jnU S   US   :X  a:  U" TU    S   5      R                  U" TU   S   5      5      n[	        U5      (       a  gU S   US   :X  a:  U" TU    S   5      R                  U" TU   S   5      5      n[	        U5      (       a  gg	)
Nr   r   c                 H    [        [        [        R                  U 5      5      $ rY   )setrd   r   obj_to_bbox)r   s    r)   edges_to_setCintersections_to_cells.<locals>.edge_connects.<locals>.edges_to_set   s    s5,,e455r+   r   r   Tr   r   F)r   r
   r   intersectionr[   )r   r   r   commonr   s       r)   edge_connects-intersections_to_cells.<locals>.edge_connects   s    	6
 	6s6{ 	6 a5BqE>!-"3C"89FF]2.s34F 6{{a5BqE>!-"3C"89FF]2.s34F 6{{r+   pointsic                   > UTS-
  :X  a  g X   nXS-   S  nU Vs/ s H  oDS   US   :X  d  M  UPM     nnU Vs/ s H  oDS   US   :X  d  M  UPM     nnU Hn  nT
" X'5      (       d  M  U HV  nT
" X(5      (       d  M  US   US   4n	U	T;   d  M$  T
" X5      (       d  M3  T
" X5      (       d  MB  US   US   U	S   U	S   4s  s  $    Mp     g s  snf s  snf )Nr   r   rD   )r   r   ptrestr]   belowrightbelow_ptright_ptbottom_rightr   r   n_pointss             r)   find_smallest_cell2intersections_to_cells.<locals>.find_smallest_cell
  s    1Y!eg 2DqaDBqEMD2 2DqaDBqEMD2H ..!$R22 (Xa[9 "]2%l==%l== qE2a5,q/<?KK "	 " ' 32s   C
C
CCc              3   6   >#    U  H  nT" TU5      v   M     g 7frY   rD   )rH   r   r   r   s     r)   rK   )intersections_to_cells.<locals>.<genexpr>%  s     J7I!"61--7Is   N)r   boolr4   r5   keysr[   r   intr	   r   rangerc   )r   cell_genr   r   r   r   s   ` @@@@r)   intersections_to_cellsr      s    ' w 4 & &++-./F6{H4= S Xf=M  6 KuS[7IJHtX&''r+   cellsc                   ^ S[         S[        [        [        [        [        4   4S jn[        U 5      n[	        5       m/ n/ n[        U5      (       Ga  [        U5      n[        U5       H  nU" U5      n[        U5      S:X  a2  T[	        U5      -  mUR                  U5        UR                  U5        ML  [        U4S jU 5       5      nUS:  d  Mi  T[	        U5      -  mUR                  U5        UR                  U5        M     [        U5      U:X  a:  UR                  [        U5      5        TR                  5         UR                  5         [        U5      (       a  GM  [        U5      (       a  UR                  [        U5      5        [        US S9n	U	 V
s/ s H  n
[        U
5      S:  d  M  U
PM     nn
U$ s  sn
f )	zy
Given a list of bounding boxes (`cells`), return a list of tables that
hold those cells most simply (and contiguously).
r|   r   c                      U u  pp4X4X4X24X444$ rY   rD   )r|   r!   r"   r.   r/   s        r)   bbox_to_corners(cells_to_tables.<locals>.bbox_to_corners/  s#    "	B<"RLAAr+   r   c              3   ,   >#    U  H	  oT;   v   M     g 7frY   rD   )rH   r{   current_cornerss     r)   rK   "cells_to_tables.<locals>.<genexpr>H  s     "NA#7s   c                 &    [        S U  5       5      $ )Nc              3   4   #    U  H  oS    US   4v   M     g7f)r   r   NrD   )rH   r{   s     r)   rK   4cells_to_tables.<locals>.<lambda>.<locals>.<genexpr>a  s     .GQ!ad|Qs   )rf   )ts    r)   r^   !cells_to_tables.<locals>.<lambda>a  s    3.GQ.G+Gr+   r0   r   )r   r   r   r4   r   r[   r#   removesumclearr5   )r   r   remaining_cellscurrent_cellstablesinitial_cell_countcellcell_cornerscorner_countrQ   r   filteredr   s               @r)   cells_to_tablesr   )  s   Bf Bw'/Q)R B 5kO
 %(EO"$MF
o

 /)D*40L=!Q&3|#44$$T*&&t,  #"N"NN  !##s<'88O!((.#**40# *( }!33MM$}-.!!#!5 o

> =d=)* V!GHG"17ac!fqj7H1O 2s   F=3F=c                   .    \ rS rSrS\\\      4S jrSrg)	CellGroupif  r   c                 V   Xl         [        [        [        S5      [	        S U5      5      5      [        [        [        S5      [	        S U5      5      5      [        [        [        S5      [	        S U5      5      5      [        [        [        S5      [	        S U5      5      5      4U l        g Nr   r   rr   r   )r   rf   rd   r   rc   rg   r|   )selfr   s     r)   __init__CellGroup.__init__g  sx    
JqM6$#678JqM6$#678JqM6$#678JqM6$#678	
	r+   )r|   r   N)	__name__
__module____qualname____firstlineno__r   r	   r   r   __static_attributes__rD   r+   r)   r   r   f  s    
d8F#34 
r+   r   c                       \ rS rSrSrg)Rowiq  rD   Nr   r   r   r   r   rD   r+   r)   r   r   q      r+   r   c                       \ rS rSrSSS\\   4S jr\S\4S j5       r\S\\	   4S j5       r
S	\S\\\\         4S
 jrSrg)Tableiu  pager   r   c                     Xl         X l        g rY   )r   r   )r   r   r   s      r)   r   Table.__init__v  s    	
r+   r   c           
         U R                   n[        [        [        S5      U5      5      [        [        [        S5      U5      5      [	        [        [        S5      U5      5      [	        [        [        S5      U5      5      4$ r   )r   rf   rd   r   rg   )r   r{   s     r)   r|   
Table.bboxz  sa    JJJqM1%&JqM1%&JqM1%&JqM1%&	
 	
r+   c                    [        U R                  [        SS5      S9n[        [        [	        [        [        S5      U R                  5      5      5      5      n/ n[        R                  " U[        S5      5       HU  u  pEU Vs0 s H  ofS   U_M
     nn[        U Vs/ s H  oR                  U5      PM     sn5      n	UR                  U	5        MW     U$ s  snf s  snf )Nr   r   r0   )r5   r   r   r4   r   rd   rN   rO   r   getr#   )
r   rQ   xsrowsy	row_cellsr   xdictr]   rows
             r)   r   
Table.rows  s    Aq)9:&SA

;<=>%--gz!}ELA/89yt!Wd]yE9R0Ryy|R01CKK F  :0s   CC
kwargsc           	      d   U R                   R                  n/ nS[        S[        S[        4S jnU R
                   H  n/ nU Vs/ s H  ot" XuR                  5      (       d  M  UPM     nnUR                   H  n	U	c  S n
O|U Vs/ s H  ot" Xy5      (       d  M  UPM     nn[        U5      (       aJ  U	S   US'   U	S   US'   S	U;   a  U	S
   U	S   -
  US'   U	S   U	S   -
  US'   [        R                  " U40 UD6n
OSn
UR                  U
5        M     UR                  U5        M     U$ s  snf s  snf )Ncharr|   r   c                     U S   U S   -   S-  nU S   U S   -   S-  nUu  pEpg[        X4:  =(       a    X6:  =(       a    X%:  =(       a    X':  5      $ )Nr"   r/   rr   r!   r.   )r   )r   r|   v_midh_midr!   r"   r.   r/   s           r)   char_in_bbox#Table.extract.<locals>.char_in_bbox  sa    %[4>1Q6E$Z$t*,1E"&BRV5:VELVu~ r+   r   x_shiftr   y_shiftlayoutrr   layout_widthr   layout_height )r   charsr   r   r   r   r|   r   r[   r   extract_textr#   )r   r   r  	table_arrr   r   arrr   	row_charsr   	cell_text
cell_charss               r)   extractTable.extract  sE   				u 	F 	t 	 99CC*/P%$<hh3O%IP		< $I *3")2l46N  " :,0Gy),0Gy)#v-59!WtAw5FF>26:1gQ6GF?3$)$6$6z$LV$L	$&	

9%# "$ S!- 0 - Q"s   D(#D(D-D-)r   r   N)r   r   r   r   r   r   r   propertyr|   r   r   r   r	   rM   r
  r   rD   r+   r)   r   r   u  st    V DL  
f 
 
 d3i  % %T(3--@(A %r+   r   )lineslines_stricttextexplicit)snap_tolerancer=   r>   join_tolerancer?   r@   edge_min_lengthmin_words_verticalmin_words_horizontalintersection_toleranceintersection_x_toleranceintersection_y_tolerancec                       \ rS rSrSrg)
UnsetFloati  rD   Nr   rD   r+   r)   r  r    r   r+   r  c                   l   \ rS rSr% Sr\\S'   Sr\\S'   Sr\	\
\\\4         \S'   Sr\	\
\\\4         \S'   \r\\S'   \r\\S	'   \r\\S
'   \r\\S'   \r\\S'   \r\\S'   Sr\\S'   \r\\S'   \r\\S'   Sr\\S'   \r\\S'   \r \\S'   Sr!\	\"\\#4      \S'   SS jr$\%S\	\&   SS 4S j5       r'Sr(g)r   i  r  vertical_strategyhorizontal_strategyNexplicit_vertical_linesexplicit_horizontal_linesr  r=   r>   r  r?   r@   r   r  r  r  r  r  r  text_settingsr   c           	      H   [          H*  n[        X5      =(       d    SS:  d  M  [        SU S35      e   S H?  n[        XS-   5      nU[        ;  d  M  [        U SSR	                  [        5       S35      e   U R
                  c  0 U l        S	 H=  nX@R
                  ;  d  M  U R
                  R                  S
S5      U R
                  U'   M?     S
U R
                  ;   a  U R
                  S
	 S H.  u  pE[        X5      [        L d  M  [        X[        X5      5        M0     U $ )ao  Clean up user-provided table settings.

Validates that the table settings provided consists of acceptable values and
returns a cleaned up version. The cleaned up version fills out the missing
values with the default values in the provided settings.

TODO: Can be further used to validate that the values are of the correct
    type. For example, raising a value error when a non-boolean input is
    provided for the key ``keep_blank_chars``.

:param table_settings: User-provided table settings.
:returns: A cleaned up version of the user-provided table settings.
:raises ValueError: When an unrecognised key is provided.
r   zTable setting 'z' cannot be negative)
horizontalvertical	_strategyz_strategy must be one of{,})r   r   r,   r   ))r=   r  )r>   r  )r?   r  )r@   r  )r  r  )r  r  )	NON_NEGATIVE_SETTINGSgetattrr3   TABLE_STRATEGIESjoinr   r   UNSETsetattr)r   settingr    strategyattrfallbacks         r)   __post_init__TableSettings.__post_init__  s)     -G&+!q0 ?7);O!PQQ - 6Kt;%>?H// "m $"234B8  6 %!#D 3D---+/+=+=+A+A+q+Q""4( 3 $,,,"";/
ND t"e+GD$;<
 r+   settingsc                     Uc  U " 5       $ [        X5      (       a  U$ [        U[        5      (       a?  0 n0 nUR                  5        H  u  pEUS S S:X  a	  XSUSS  '   M  XRU'   M     X2S'   U " S0 UD6$ [        SU 35      e)N   text_r   zCannot resolve settings: rD   )
isinstancedictrJ   r3   )clsr3  core_settingsr   rI   r   s         r)   resolveTableSettings.resolve  s    5L&&O$''MM (Ra5G#+,!AB%('(!$	 )
 .;/*'''8
CDDr+   )r   )r   r   ))r   r   r   r   r  rM   __annotations__r  r  r	   r   r   r   r   r  DEFAULT_SNAP_TOLERANCEr  r+  r=   r>   DEFAULT_JOIN_TOLERANCEr  r?   r@   r  DEFAULT_MIN_WORDS_VERTICALr  r   DEFAULT_MIN_WORDS_HORIZONTALr  r  r  r  r   r   r   r1  classmethodT_table_settingsr;  r   rD   r+   r)   r   r     s   $s$&&CGXd5+>&?@GEIxU5%<-@(ABI2NE2#e##e#2NE2#e##e#OU88 <#<$%E%&+e+&+e+.2M8DcN+23j Ex(89 Eo E Er+   c                   B    \ rS rSrSrSSSS\\   4S jjrS\4S	 jr	S
r
g)TableFinderi,  a  
Given a PDF page, find plausible table structures.

Largely borrowed from Anssi Nurminen's master's thesis:
http://dspace.cc.tut.fi/dpub/bitstream/handle/123456789/21520/Nurminen.pdf?sequence=3

... and inspired by Tabula:
https://github.com/tabulapdf/tabula-extractor/issues/16
Nr   r   r3  c                    Xl         [        R                  U5      U l        U R	                  5       U l        [        U R
                  U R                  R                  U R                  R                  5      U l	        [        U R                  5      U l        [        U R                  5       Vs/ s H  n[        U R                   U5      PM     snU l        g s  snf rY   )r   r   r;  r3  	get_edgesr   r   r  r  r   r   r   r   r   r   )r   r   r3  
cell_groups       r)   r   TableFinder.__init__7  s    	%--h7^^%
3JJMM22MM22

 ,D,>,>?
;J4::;V
;VZE$))Z(;V
 
s   + Cr   c           
         U R                   nS HL  n[        XS-   5      nUS:X  d  M  [        USU-   S-   5      n[        U5      S:  d  M<  [        SU SU S	35      e   UR                  nUR
                  nUS
:X  d  US
:X  a/  U R                  R                  " S0 UR                  =(       d    0 D6n/ nUR                  =(       d    /  H  n	[        U	[        5      (       a;  [        R                  " U	5       H  n
U
S   S:X  d  M  UR                  U
5        M!     MS  UR                  U	U	U R                  R                  S   U R                  R                  S   U R                  R                  S   U R                  R                  S   -
  SS.5        M     US:X  a,  [        R                   " U R                  R"                  S5      nOTUS:X  a+  [        R                   " U R                  R"                  SSS9nO#US
:X  a  [%        WUR&                  S9nOUS:X  a  / nWU-   n/ nUR(                  =(       d    /  H  n	[        U	[        5      (       a;  [        R                  " U	5       H  n
U
S   S:X  d  M  UR                  U
5        M!     MS  UR                  U R                  R                  S   U R                  R                  S   U R                  R                  S   U R                  R                  S   -
  U	U	SS.5        M     US:X  a,  [        R                   " U R                  R"                  S5      nOTUS:X  a+  [        R                   " U R                  R"                  SSS9nO#US
:X  a  [+        WUR,                  S9nOUS:X  a  / nWU-   n[/        U5      [/        U5      -   n[1        UUR2                  UR4                  UR6                  UR8                  S9n[        R                   " UUR:                  S9$ )N)r#  r"  r$  r  	explicit__linesrr   zIf z"_strategy == 'explicit', explicit_zD_lines must be specified as a list/tuple of two or more floats/ints.r  r    r   r   r   r~   r  r  line)	edge_type)rV   r   r   )r!   r.   ra   r"   r/   r    )r=   r>   r?   r@   )
min_lengthrD   )r3  r(  r[   r3   r  r  r   extract_wordsr   r  r7  r8  r   obj_to_edgesr#   r|   filter_edgesr   r   r  r  rn   r  r4   rT   r=   r>   r?   r@   r  )r   r3  r    r.  r  v_strath_stratrU   
v_explicitdescr&   v_baser   
h_explicith_baser   r   s                    r)   rG  TableFinder.get_edgesE  s   ==5Kx{)BCH:%+*Ch*NOu:>$k] +$$/= 1'(  6 ,,..f6 1II++Mx/E/E/KME
44::D$%%++D1A'3."))!, 2 !!""#yy~~a0"&)).."3"&)).."3diinnQ6G"G'*	 ;" g''		=F&''		OF%eH<W<WXF
"FZ
66<"<D$%%++D1A'3."))!, 2 !!"iinnQ/"iinnQ/!%!2TYY^^A5F!F#"&'*	 =" g''		=F&''		OF%h&C&CF 
"FZQ$q'!%66%66%66%66
 !!%H4L4LMMr+   )r   r   r   r   r3  r   rY   )r   r   r   r   __doc__r	   rC  r   r   rG  r   rD   r+   r)   rE  rE  ,  s0    
V 
x8H/I 
[N: [Nr+   rE  )r   r   )4rN   dataclassesr   operatorr   typingr   r   r   r   r	   r
   r   r   r  r   _typingr   r   r   r   r   r   r>  r?  r@  rA  rM   T_intersectionsrC  r   r   r*   r<   rT   r   rn   r   r   r   r   objectr   r   r   r)  r'  rs   r  r+  r   rE  rD   r+   r)   <module>rb     s2    !  N N N  J J     wS*_ 556$sCx.89 
 0/!!! ! 	!& =S$'49:  	
  D .J(('*((X .H<<'*<<@ EF$)<A6<(/ <(d6l <(~:4< :Df,> :z
 
	) 	?F ?D A   	 	 	1 YE YE YExtN& tNr+   