
    *i(i                     f   S r SSKrSSKrSSKrSSKrSSKJr  SSKJrJ	r	  SSK	J
r
  / SQr\R                  r\R                  r0 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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,S# r-S$ r.S% r/S& r0S' r1S( r2S) r3S* r4S+ r5S, r6S- r7S. r8S/ r9S0 r:S1 r;S2 r<S3 r=S4 r>S5 r?S6 r@S7 rAS8 rBS9 rCS: rDS; rES< rFS= rGS> rHS? rIS@ rJSA rKSB rLSC rMSD rNSE rOSF rPSG rQSH rRSI rSSJ rTSK rUSL rVSM rWSN rXSO rYSP rZSQ r[SR r\SS r]ST r^SU r_\QSV\RSW\SSX\TSY\WSZ\VS[\LS\\[S]\]S^\^S_\_S`0r`Sa raSb rbSc rcSd rdSe reSf rfSg rgSh rhSi riSj rjSk rkSl rlSm rmSn rnSo ro " Sp Sq\p5      rq " Sr Ss5      rrSt rsSu rtSv ruSw rvSx rwSSy jrxSz ry0 4S{ jrzS| r{S} r|S~ r}S r~S rS rS rS rS rSS jrS r0 4S jr\GR                  " S\GR                  5      GR                  r\GR                  " S\GR                  5      GR                  rS rS rSS jrg)a9  
Auxiliary functions for f2py2e.

Copyright 1999 -- 2011 Pearu Peterson all rights reserved.
Copyright 2011 -- present NumPy Developers.
Permission to use, modify, and distribute this software is given under the
terms of the NumPy (BSD style) LICENSE.

NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
    N)reduce   )__version__cfuncs)errmess)`
applyrules	debugcapi
dictappendr   gentitlegetargs2getcallprotoargumentgetcallstatementgetfortrannamegetpymethoddef
getrestdocgetusercodegetusercode1getdimensionhasbodyhascallstatement	hascommonhasexternalshasinitvaluehasnotehasresultnoteisallocatableisarrayisarrayofstringsischaracterischaracterarrayischaracter_or_characterarray	iscomplexiscstyledirectiveiscomplexarrayiscomplexfunctioniscomplexfunction_warnisdoubleisdummyroutine
isexternal
isfunctionisfunction_wrapisint1isint1array	isintegerisintent_aux
isintent_cisintent_callbackisintent_copyisintent_dictisintent_hideisintent_inisintent_inoutisintent_inplaceisintent_nothideisintent_outisintent_overwrite	islogicalislogicalfunctionislong_complexislong_doubleislong_doublefunctionislong_longislong_longfunctionismoduleismoduleroutine
isoptional	isprivate
isvariable
isrequired	isroutineisscalarissigned_long_longarrayisstringisstringarrayisstring_or_stringarrayisstringfunctionissubroutineget_f2py_modulenameissubroutine_wrapisthreadsafe
isunsignedisunsigned_charisunsigned_chararrayisunsigned_long_longisunsigned_long_longarrayisunsigned_shortisunsigned_shortarrayl_andl_notl_oroutmessreplaceshow
stripcommathrow_errorisattr_valuegetuseblocksprocess_f2cmap_dictcontainscommoncontainsderivedtypesc                 z    [         R                  SS5      (       a   [        R                  R	                  U 5        g g )Nverboser   )optionsgetsysstdoutwrite)ts    Q/var/www/html/ai-backend/venv/lib/python3.13/site-packages/numpy/f2py/auxfuncs.pyr]   r]   ;   s*    {{9a  

 !    c                     S[         ;   $ )Ncapi)debugoptionsvars    ro   r	   r	   @   s    \!!rp   c                 X    SU ;   =(       a    U S   S:H  =(       a    [        U 5      (       + $ Ntypespec	characterr)   rt   s    ro   _ischaracterr{   D   .     ZK!? #rp   c                 X    SU ;   =(       a    U S   S:H  =(       a    [        U 5      (       + $ rw   rz   rt   s    ro   	_isstringr~   I   r|   rp   c                 0    [        U 5      =(       a    SU ;  $ Ncharselectorr{   rt   s    ro   r!   r!   N   s    :s!::rp   c                 F    [        U 5      =(       a    [        U 5      (       + $ Nr!   r   rt   s    ro   r   r   R   s    (-Bgcl2BBrp   c                 <    [        U 5      =(       a    [        U 5      $ r   r   rt   s    ro   r    r    V   s    (->'#,>rp   c                 0    [        U 5      =(       a    SU ;   $ r   r   rt   s    ro   rM   rM   Z   s    63!66rp   c                 F    [        U 5      =(       a    [        U 5      (       + $ r   rM   r   rt   s    ro   rK   rK   ^   s    "3'<,<<rp   c                 <    [        U 5      =(       a    [        U 5      $ r   r   rt   s    ro   rL   rL   b   s    "3'8GCL8rp   c                 <    [        U 5      =(       a    U S   S   S:H  $ )N	dimensionz(*))rL   rt   s    ro   r   r   f   s#     ?#k"22"6%"??rp   c                 :    SU ;   =(       a    [        U 5      (       + $ Nr   rz   rt   s    ro   r   r   l   s    #5jo"55rp   c                 j    [        U 5      =(       d    [        U 5      =(       d    [        U 5      (       + $ r   )r   rK   r)   rt   s    ro   rI   rI   p   s!    @@CAArp   c                 N    [        U 5      =(       a    U R                  S5      S;   $ Nrx   )complexzdouble complexrI   rj   rt   s    ro   r"   r"   t   s'    C= @77:"??@rp   c                 N    [        U 5      =(       a    U R                  S5      S:H  $ )Nrx   logicalr   rt   s    ro   r;   r;   y       C==SWWZ0I==rp   c                 N    [        U 5      =(       a    U R                  S5      S:H  $ )Nrx   integerr   rt   s    ro   r.   r.   }   r   rp   c                 N    [        U 5      =(       a    U R                  S5      S:H  $ )Nrx   realr   rt   s    ro   isrealr      s    C=:SWWZ0F::rp   c                 h     U S   S   $ ! [          a     U S   S   s $ ! [          a      g f = ff = f)Nkindselector*kindKeyErrorrt   s    ro   get_kindr      sM    >"3'' 	~&v.. 		s    
 
11
-1-1c                     U R                  S5      S:H  =(       a%    [        U 5      S:H  =(       a    [        U 5      (       + $ Nrx   r   1)rj   r   r   rt   s    ro   r,   r,      s8    77:)+ 6SMS 6)0%56rp   c                 l    [        U 5      (       d  gU R                  S5      S;  a  g[        U 5      S:H  $ )Nr   rx   r   r   8rI   rj   r   rt   s    ro   r@   r@      s2    C==
wwz"88C=Crp   c                 l    [        U 5      (       d  gU R                  S5      S:w  a  g[        U 5      S:H  $ )Nr   rx   r   -1r   rt   s    ro   rT   rT      1    C==
wwzi'C=D  rp   c                 l    [        U 5      (       d  gU R                  S5      S:w  a  g[        U 5      S:H  $ )Nr   rx   r   -2r   rt   s    ro   rX   rX      r   rp   c                 l    [        U 5      (       d  gU R                  S5      S:w  a  g[        U 5      S:H  $ )Nr   rx   r   -4r   rt   s    ro   rS   rS      r   rp   c                 l    [        U 5      (       d  gU R                  S5      S:w  a  g[        U 5      S:H  $ )Nr   rx   r   -8r   rt   s    ro   rV   rV      r   rp   c                 l    [        U 5      (       d  gU R                  S5      S:X  d  g[        U 5      S:H  $ )Nr   rx   r   r   r   rt   s    ro   r'   r'      s1    C==77:&(C=Crp   c                 l    [        U 5      (       d  gU R                  S5      S:X  d  g[        U 5      S:H  $ )Nr   rx   r   16r   rt   s    ro   r>   r>      s1    C==77:&(C=D  rp   c                 @    [        U 5      (       d  g[        U 5      S:H  $ )Nr   32)r"   r   rt   s    ro   r=   r=      s    S>>C=D  rp   c                 N    [        U 5      =(       a    U R                  S5      S;   $ r   )r   rj   rt   s    ro   r$   r$      s'    3< @77:"??@rp   c                 x    [        U 5      =(       a)    U R                  S5      S:H  =(       a    [        U 5      S:H  $ r   r   rj   r   rt   s    ro   r-   r-      s4    3< !CGGJ/9< !SMS !rp   c                 x    [        U 5      =(       a)    U R                  S5      S;   =(       a    [        U 5      S:H  $ )Nrx   r   r   r   rt   s    ro   rU   rU      5    3< "CGGJ/3II "SMT!"rp   c                 x    [        U 5      =(       a)    U R                  S5      S;   =(       a    [        U 5      S:H  $ )Nrx   r   r   r   rt   s    ro   rY   rY      r   rp   c                 x    [        U 5      =(       a)    U R                  S5      S;   =(       a    [        U 5      S:H  $ )Nrx   r   r   r   rt   s    ro   isunsignedarrayr      r   rp   c                 x    [        U 5      =(       a)    U R                  S5      S;   =(       a    [        U 5      S:H  $ )Nrx   r   r   r   rt   s    ro   rW   rW      r   rp   c                 x    [        U 5      =(       a)    U R                  S5      S;   =(       a    [        U 5      S:H  $ )Nrx   r   r   r   rt   s    ro   issigned_chararrayr      5    3< !CGGJ/3II !SMS !rp   c                 x    [        U 5      =(       a)    U R                  S5      S;   =(       a    [        U 5      S:H  $ )Nrx   r   2r   rt   s    ro   issigned_shortarrayr      r   rp   c                 x    [        U 5      =(       a)    U R                  S5      S;   =(       a    [        U 5      S:H  $ )Nrx   r   4r   rt   s    ro   issigned_arrayr      r   rp   c                 x    [        U 5      =(       a)    U R                  S5      S;   =(       a    [        U 5      S:H  $ )Nrx   r   r   r   rt   s    ro   rJ   rJ      r   rp   c                 *    SU ;   =(       a    SU S   ;   $ )Nattrspecallocatable rt   s    ro   r   r     s    A#j/!AArp   c                 :    SU ;  =(       d    [        U 5      (       + $ r   )rK   rt   s    ro   	ismutabler     s    3&7(3-88rp   c                     SU ;   $ )N
modulenamer   routs    ro   rC   rC     s    4rp   c                 *    SU ;   =(       a    SU S   :H  $ )Nblockmoduler   r   s    ro   rB   rB     s    d?8x4=88rp   c                 *    SU ;   =(       a    SU S   :H  $ )Nr   functionr   r   s    ro   r*   r*     s    d?:zT']::rp   c                     [        U 5      (       a  g[        =(       a"    [        U 5      =(       a    [        U 5      (       + $ Nr   )r0   	wrapfuncsr*   r)   r   s    ro   r+   r+     s-    $DD)D:d3C/CDrp   c                 *    SU ;   =(       a    SU S   :H  $ )Nr   
subroutiner   r   s    ro   rO   rO     s    d?<|tG}<<rp   c                 ^    [        U 5      (       a  g[        U 5      =(       a    [        U 5      $ r   )r0   rO   hasassumedshaper   s    ro   rQ   rQ   "  s%    $7/$"77rp   c                 ,    SU R                  S/ 5      ;   $ )Nvaluer   rj   rt   s    ro   rb   rb   '  s    cggj"---rp   c                     U R                  S5      (       a  gU S    H=  nU S   R                  U0 5      R                  S/ 5       H  nUS:X  d  M  SU S'       g   M?     g)Nr   Targsvarsr   :Fr   )r   ads      ro   r   r   +  se    xx!""&\f!!!R(,,["=ACx*.&' > 
 rp   c                 <    [        U 5      =(       d    [        U 5      $ r   )rC   r   r   s    ro   requiresf90wrapperr   6  s    4 9OD$99rp   c                 <    [        U 5      =(       d    [        U 5      $ r   )r*   rO   r   s    ro   rH   rH   :  s    d1|D11rp   c                 z    [        U 5      (       d  gSU ;   a  U S   nOU S   nXS   ;   a  [        U S   U   5      $ gNr   resultnamer   )r*   r;   r   r   s     ro   r<   r<   >  J    d4NLLfa))rp   c                 z    [        U 5      (       d  gSU ;   a  U S   nOU S   nXS   ;   a  [        U S   U   5      $ gr   )r*   r@   r   s     ro   rA   rA   J  sJ    d4NLL4<?++rp   c                 z    [        U 5      (       d  gSU ;   a  U S   nOU S   nXS   ;   a  [        U S   U   5      $ gr   )r*   r>   r   s     ro   r?   r?   V  sJ    d4NLLT&\!_--rp   c                 z    [        U 5      (       d  gSU ;   a  U S   nOU S   nXS   ;   a  [        U S   U   5      $ gr   )r*   r"   r   s     ro   r%   r%   b  r   rp   c                 <    [        U 5      (       a  [        S5        gg)Na      **************************************************************
        Warning: code with a function returning complex value
        may not work correctly with your Fortran compiler.
        When using GNU gcc/g77 compilers, codes should work
        correctly for callbacks with:
        f2py -c -DF2PY_CB_RETURNCOMPLEX
    **************************************************************
r   r   )r%   r]   r   s    ro   r&   r&   n  s$     H 	I rp   c                 z    [        U 5      (       d  gSU ;   a  U S   nOU S   nXS   ;   a  [        U S   U   5      $ gr   )r*   rK   r   s     ro   rN   rN   |  sJ    d4NLLVQ((rp   c                 $    SU ;   =(       a    U S   $ )N	externalsr   r   s    ro   r   r     s    $44#44rp   c                 *    SU ;   =(       a    SU S   ;   $ )Nf2pyenhancements
threadsafer   r   s    ro   rR   rR     s"    % 44 2334rp   c                 $    SU ;   =(       a    U S   $ )Nr   r   r   s    ro   hasvariablesr     s    T>*d6l*rp   c                 l    SU ;   =(       a    SU S   ;   =(       a    SU S   ;  =(       a    [        U 5      $ )Nr   optionalrequired)r8   rt   s    ro   rD   rD     s?    # .*J"? .c*o-I3CC3HIrp   c                 *    SU ;   =(       a    SU S   ;   $ )Nr   externalr   rt   s    ro   r)   r)     s    >s:!>>rp   c                    ^ SmSU R                  5       ;   a3  [        S U S    5       5      (       a  [        U4S jU S    5       5      $ g g )Nz	\((.*?)\)r   c              3   ,   #    U  H
  nS U;   v   M     g7f)r   Nr   ).0ss     ro   	<genexpr>getdimension.<locals>.<genexpr>  s     9A{as   c              3   R   >#    U  H  n[         R                  " TU5      v   M     g 7fr   )refindall)r  v
dimpatterns     ro   r	  r
    s     K?a

:q11?s   $')keysanynext)ru   r  s    @ro   r   r     sJ    JSXXZ9Z999K3z?KKK :  rp   c                 F    [        U 5      (       + =(       a    [        U 5      $ r   )rD   r8   rt   s    ro   rG   rG     s    #8#3C#88rp   c                 6   ^  1 Skn[        U 4S jU 5       5      $ )N>   pymethoddefcallstatementcallprotoargumentc              3   H   >#    U  H  oTR                  5       ;   v   M     g 7fr   )lower)r  	directive	f2py_lines     ro   r	  $iscstyledirective.<locals>.<genexpr>  s     Jz)IOO--zs   ")r  )r  
directivess   ` ro   r#   r#     s    FJJzJJJrp   c                     SU ;  a  gSU S   ;   a  gSU S   ;   a  gSU S   ;   a  gSU S   ;   a  gSU S   ;   a  gS	U S   ;   a  gg)
Nintentr   hider   inplaceinoutinoutoutinr   rt   s    ro   r5   r5     sj    sXCM!s8}H#h-#h-rp   c                     SU ;   =(       aD    SU S   ;   =(       d    SU S   ;   =(       a&    SU S   ;  =(       a    SU S   ;  =(       a    SU S   ;  $ )Nr  r$  r%  r"  r   r!  r   rt   s    ro   r6   r6     sg    O KCM!9 "%s8}$K*.c(m*CK#h-'K,5S],JLrp   c                 ,    SU R                  S/ 5      ;   $ )Nr#  r  r   rt   s    ro   r9   r9         CGGHb)))rp   c                     SU ;   =(       aL    SU S   ;   =(       d=    SU S   ;   =(       a.    SU S   ;  =(       a    [        [        [        5      " U 5      (       + $ )Nr  r   r#  r"  )r\   r6   r7   rt   s    ro   r4   r4     s\    O D3x=!8 "Cc(m# BCM(A B.*:;C@@Erp   c                 "    [        U 5      (       + $ r   )r4   rt   s    ro   r8   r8     s    S!!!rp   c                 ,    SU R                  S/ 5      ;   $ )Ncr  r   rt   s    ro   r0   r0     s    #''(B'''rp   c                 ,    SU R                  S/ 5      ;   $ )Ncacher  r   rt   s    ro   isintent_cacher/    s    cggh+++rp   c                 ,    SU R                  S/ 5      ;   $ )Ncopyr  r   rt   s    ro   r2   r2     s    SWWXr***rp   c                 ,    SU R                  S/ 5      ;   $ )N	overwriter  r   rt   s    ro   r:   r:         #''(B///rp   c                 ,    SU R                  S/ 5      ;   $ )Ncallbackr  r   rt   s    ro   r1   r1         2...rp   c                 ,    SU R                  S/ 5      ;   $ )Nr!  r  r   rt   s    ro   r7   r7     s    "---rp   c                 ,    SU R                  S/ 5      ;   $ )Nauxr  r   rt   s    ro   r/   r/     r(  rp   c                 ,    SU R                  S/ 5      ;   $ )Naligned4r  r   rt   s    ro   isintent_aligned4r=    r7  rp   c                 ,    SU R                  S/ 5      ;   $ )Naligned8r  r   rt   s    ro   isintent_aligned8r@    r7  rp   c                 ,    SU R                  S/ 5      ;   $ )N	aligned16r  r   rt   s    ro   isintent_aligned16rC    r4  rp   	INTENT_ININTENT_INOUT
INTENT_OUTINTENT_HIDEINTENT_CACHEINTENT_COPTIONALINTENT_INPLACEINTENT_ALIGNED4INTENT_ALIGNED8INTENT_ALIGNED16c                 *    SU ;   =(       a    SU S   ;   $ )Nr   privater   rt   s    ro   rE   rE     s    =c*o!==rp   c                 T    [        U 5      S:X  a  SU ;   a  U S   S   S;   a  SnU$ SnU$ )Nr   r   r   )publicrP  FTlen)ru   is_vars     ro   rF   rF     s>    
3x1}s*
OA"77 M Mrp   c                     SU ;   $ )N=r   rt   s    ro   r   r     s    #:rp   c                 :    [        U 5      (       d  gU S   S   S;   $ )Nr   rW  )"')r   rt   s    ro   hasinitvalueasstringr[    s#    s8A;*$$rp   c                     SU ;   $ )Nnoter   rt   s    ro   r   r     s    S=rp   c                 z    [        U 5      (       d  gSU ;   a  U S   nOU S   nXS   ;   a  [        U S   U   5      $ gr   )r*   r   r   s     ro   r   r   "  sJ    d4NLLtF|A''rp   c                     SU ;   $ )Ncommonr   r   s    ro   r   r   .  s    trp   c                     [        U 5      (       a  g[        U 5      (       a  U S    H  n[        U5      (       d  M    g   gNr   bodyr   )r   r   re   r   bs     ro   re   re   2  s8    t}}fAa    rp   c                 *    SU ;   =(       a    U S   S:H  $ )Nr   typer   r   s    ro   hasderivedtypesrh  <  s    tO8g&!88rp   c                     [        U 5      (       a  g[        U 5      (       a  U S    H  n[        U5      (       d  M    g   grb  )rh  r   rd  s     ro   rf   rf   @  s:    tt}}fAq!!  rp   c                     [        U 5      (       a  g[        U 5      (       d  gU S    H  n[        U5      (       d  M    g   g)Nr   r   rc  )rB   r   containsmodule)r   re  s     ro   rk  rk  J  s;    5>>6]!  rp   c                     SU ;   $ )Nrc  r   r   s    ro   r   r   U  s    T>rp   c                     [        U 5      S L$ r   )r   r   s    ro   r   r   Y  s    D!--rp   c                     g)Nr   r   rt   s    ro   istruero  ]      rp   c                     gr   r   rt   s    ro   isfalserr  a  rp  rp   c                       \ rS rSrSrg)	F2PYErrorie  r   N)__name__
__module____qualname____firstlineno____static_attributes__r   rp   ro   rt  rt  e  s    rp   rt  c                        \ rS rSrS rS rSrg)ra   ii  c                     Xl         g r   mess)selfr}  s     ro   __init__throw_error.__init__k  s    	rp   c                 >    SU SU R                    S3n[        U5      e)Nz


  var = z
  Message: 
)r}  rt  )r~  ru   r}  s      ro   __call__throw_error.__call__n  s$    cU-		{"=orp   r|  N)ru  rv  rw  rx  r  r  ry  r   rp   ro   ra   ra   i  s    rp   ra   c                      S/ p![        [        U 5      5       H  nSXU4-  nUR                  SU-  5        M      [        U SSR	                  U5       35      $ )Nlambda v%s,f%d=f[%d]f%d(v)r   z and rangerT  appendevaljoinfl1l2is       ro   rZ   rZ   s  s[    3q6]raj(
		(a.!  2$aR()*++rp   c                      S/ p![        [        U 5      5       H  nSXU4-  nUR                  SU-  5        M      [        U SSR	                  U5       35      $ )Nr  r  r  r   z or r  r  s       ro   r\   r\   {  sZ    3q6]raj(
		(a.!  2$aB()**rp   c                     [        S5      $ )Nzlambda v,f=f:not f(v))r  )r  s    ro   r[   r[     s    '((rp   c                 :     U S   S   S:H  $ ! [          a     gf = f)Nr   fortranname r   r   r   s    ro   r(   r(     s/    &'6"<< s   
 
c                      U S   S   nUS:X  a  [         eU(       d  [        SU S    S35        [         e U$ ! [          a	    U S   n U$ f = f)Nr   r  r  zFailed to use fortranname from r  r   )r   r   )r   r   s     ro   r   r     so    &'62:N5d;M6N5OrRSN 
 K  F|Ks   38 A
Ac                     U S   R                  U5      nU(       d  g US:  a  [        U[        5      (       a  g [        U[        5      (       a  U[        U5      :  a  g XC   nUS S S:X  au  U(       a  SU-   S-   [        U5      -   S-   USS  -   nOUSS  nUSS  S:X  a(  U(       a  US S S	-   [        U5      -   S
-   nU$ US S n U$ [        U S[        U5       S35        U$ ! [         a     g f = f)Nr   r      z'''z
	/* start z multiline (z) */
z
	/* end multiline (z)*/z( multiline block should end with `'''`: r  )rj   r   
isinstancestrlistrT  reprr   )r   	blocknamecommentcounterrs        ro   getmultilineblockr    s0   #$((3 {z!S))!Tc!fJ!u~	)!%g/19:<=abEBA !"ARS6U?crF55WEM
 H crF H yk!I$q'RTUVH/  s   C# #
C0/C0c                     [        U S5      $ )Nr  r  r   s    ro   r   r     s    T?33rp   c                    [        U SSS9nU(       a  U$ [        U 5      (       a  [        S5        g SSKJn  / / pT[        [        [        [        5      5      " U 5      (       a  UR                  SS/5        U S	    H  nU S
   U   n[        U5      (       a  M  Xa;   a  X   S-   nOU" U5      n[        [        [        [        [        5      5      " U5      (       a  O&[        U5      (       a  O[!        U5      (       d  US-   n[        U5      (       d   [#        U5      (       d  [%        U5      (       a  UR'                  S5        UR'                  U5        M     SR)                  XE-   5      n	U	(       d  Sn	U	$ )Nr  r   )r  z<warning: callstatement is defined without callprotoargument
r   )getctypezchar*size_tr   r   _typedefr   ,void)r  r   r]   	capi_mapsr  rZ   rN   r[   r+   extendr1   r0   r\   rI   r"   rK   rb   r   rL   r  r  )
r   cb_mapr  r  	arg_types
arg_types2nru   ctype
proto_argss
             ro   r   r     sC   $ 3Q?AK	M#zu_56t<<'8,-&\6l1oS!!;I
*ESMEZh	!:;C@@#!#&&$S))!#&&!!(+% ( )01J
rp   c                     [        U S5      $ )Nusercoder  r   s    ro   r   r     s    T:..rp   c                     [        U SSS9$ )Nr  r   )r  r  r   s    ro   r   r     s    T:q99rp   c                     [        U S5      $ )Nr  r  r   s    ro   r   r     s    T=11rp   c                     / / p!SU ;   aX  U S   nSU ;   aH  U S    H  nX2;   d  M
  UR                  U5        M     U H  nX1;  d  M
  UR                  U5        M     X!4$ U S   nX!4$ )Nr   sortvars)r  )r   sortargsr   r   s       ro   getargsr    s|    d~F|*%9OOA& & $OOA& 
 > F|H>rp   c                 n   / U R                  S/ 5      p!U S   R                  5        Vs/ s H$  n[        U S   U   5      (       d  M  X2;  d  M"  UPM&     nnXB-   nSU ;   aH  U S    H  nX2;   d  M
  UR                  U5        M     U H  nX1;  d  M
  UR                  U5        M     X!4$ X@S   -   nX!4$ s  snf )Nr   r   r  )rj   r  r/   r  )r   r  r   r   auxvarss        ro   r   r     s    &"-dv,++- "-Qd6l1o1Nq= -G ">DTj!Ay" " A " 
 > &\)>"s   B2B2B2c                 d    SU ;  a  g S nU S   S:X  a
  U S   U S   4nU S   R                  US 5      $ )Nf2pymultilinesr   zpython moduler   r   )r   ks     ro   r   r     sI    t#AG}'M4<' !%%a..rp   c                 N    S[        U 5      -
  S-
  S-  nSUS-   SU  SUS-   S3$ )NP         z/*r    z*/rS  )r   lns     ro   r   r     s<    
s4y.1
	"BSz4&"s(2..rp   c                 \    [        U [        5      (       a  [        [        4S jU / 5      $ U /$ )Nc                     X" U5      -   $ r   r   )xyr  s      ro   <lambda>flatlist.<locals>.<lambda>  s    q1Q4xrp   )r  r  r   flatlist)lsts    ro   r  r    s(    #tX7bAA5Lrp   c                 0    U (       a  U S   S:X  a  U S S $ U $ )Nr   r  r   )r  s    ro   r`   r`   #  s    QrUc\"vHrp   c           
      ,   [        U[        5      (       a  U Vs/ s H  n[        XU5      PM     sn$ [        U [        5      (       a  U  Vs/ s H  n[        X1U5      PM     sn$ S[        UR                  5       5      -   H  nUS:X  a  M  SU;   a  XAS   ;   a	  US   U   nOUn[        X   [        5      (       a2  U R                  SU S3UR	                  [        X   5      5      5      n Mm  U R                  SU S3X   5      n M     U $ s  snf s  snf )Nr  separatorsfor#)r  r  r^   r  r  r  )r  r   
defaultsep_mr  seps         ro   r^   r^   )  s    !T789q,q99#t589Srz*S99affhaA?);$;O$Q'CCadD!!++!Ah!$(@AC++!Ah-C   J :9s   DDc                    [        U[        5      (       a  U H  n[        X5      n M     U $ UR                  5        GH  nUS   S:X  a  M  X0;   a  [        X   [        5      (       a  X   /X'   [        X   [        5      (       a;  [        X   [        5      (       a  X   X   -   X'   Mm  X   R                  X   5        M  [        X   [        5      (       ad  [        X   [        5      (       aK  US:X  a1  X   R                  5        H  nX@U   ;  d  M  X   U   X   U'   M     M  [        X   X   5      X'   M  M  GM  X   X'   GM     U $ )Nr   _r  )r  r  r
   r  r  r  dict)rdarr   r  k1s        ro   r
   r
   <  s$   "dAB"B 	WWYQ43;7"%%%"%&&beT**EBEMBEELL'BE4((beT**O+"$%**,B!A,.E"Ib	 #/ !+25"% 8 + ) EBE) * Irp   c           	         0 n[        U [        5      (       a+  U  H#  n[        XAU5      n[        X55      nSU;   d  M"    U$    U$ SU ;   a  U S   " U5      (       d  U$ SU ;   a0  [        SU S   0X5      nSU;   a  [        R
                  " US   5        U R                  5        GH-  nUS:X  a  X   X7'   M  [        X   [        5      (       a  [        X   U5      X7'   GO[        X   [        5      (       a:  / X7'   X    H,  n[        Xx0X5      n	Xy;   d  M  X7   R                  X   5        M.     GO`US   S:X  a  M  [        X   [        5      (       Ga#  / X7'   X   R                  5        GH  n
[        U
[        R                  5      (       d  M%  U
" U5      (       d  M4  [        X   U
   [        5      (       aa  X   U
    HT  n[        U[        5      (       a   [        SU0X5      nUR                  SS	5      nX7   R                  [        X5      5        MV     M  X   U
   n[        U[        5      (       a   [        SU0U5      nUR                  SS	5      nX7   R                  [        X5      5        GM
     O[        S
[        X   5       S35        [        X7   [        5      (       d  GM  [!        X7   5      S:X  a	  X7   S   X7'   X7   / :X  d  GM+  X7	 GM0     U$ )N_break_checkneedneedsr  r   r  	supertextr  zapplyrules: ignoring rule z.
r   )r  r  r   r
   r   append_needsr  r  r^   r  r  typesFunctionTyperj   r   r  rT  )rulesr   ru   retr  rrresr  r  r  r  s              ro   r   r   Y  s   
C%AA#&BS%C2~
 
 
5%/#"6"6
'5=11:c>G-ZZ\XCFeh$$UXq)CF$''CFX/7FMM"%(  qTS[$''CFhmmob%"4"455"S''!%(2,55!&"A)!T22&0+q1A1&J$'GGK$<FMM'!-8	 ". "HRL%a..",k1-=q"AC #R 8Agam4 & 0eh0@DEcfd##36{av|FI J Jrp   z%\s*python\s*module\s*(?P<name>[\w_]+)z4\s*python\s*module\s*(?P<name>[\w_]*?__user__[\w_]*)c                     S n[        U 5       nU H:  n[        U5      nU(       d  M  [        U5      (       a  M)  UR                  S5      n  O   S S S 5        U$ ! , (       d  f       U$ = f)Nr   )open_f2py_module_name_match_f2py_user_module_name_matchgroup)sourcer   r  linems        ro   rP   rP     sb    D	fD'-Aq/55wwv  
 K 
 Ks   A'A
A(c           	         / nU S    Hn  nUS    Hb  nUR                  S5      (       d  M  UR                  UR                  S5      R                  5        Vs/ s H  nSU;  d  M  UPM     sn5        Md     Mp     U$ s  snf )Nrc  use__)rj   r  r  )pymodall_usesinnermodblockr  s        ro   rc   rc     su    HvfH||E""HLL,?,D,D,F X,Fq$VW-,F XY &  O !Ys   
A<%A<c                    / n0 nUR                  5        HJ  u  pgUR                  5        VV	s0 s H  u  pUR                  5       U	_M     n
nn	XUR                  5       '   ML     UR                  5        H  u  pgX`;  a  0 X'   UR                  5        H  u  pX;   a_  XU   ;   a!  [        SU< SU< SX   U   < SU	< S3	5        XU   U'   U(       a  [        SU SU SU	 S	35        UR                  U	5        Mi  U(       d  Mr  [	        S
U< SU< SU	< SU	< S[        UR                  5       5      < S35        M     M     X4$ s  sn	nf )ar  
Update the Fortran-to-C type mapping dictionary with new mappings and
return a list of successfully mapped C types.

This function integrates a new mapping dictionary into an existing
Fortran-to-C type mapping dictionary. It ensures that all keys are in
lowercase and validates new entries against a given C-to-Python mapping
dictionary. Redefinitions and invalid entries are reported with a warning.

Parameters
----------
f2cmap_all : dict
    The existing Fortran-to-C type mapping dictionary that will be updated.
    It should be a dictionary of dictionaries where the main keys represent
    Fortran types and the nested dictionaries map Fortran type specifiers
    to corresponding C types.

new_map : dict
    A dictionary containing new type mappings to be added to `f2cmap_all`.
    The structure should be similar to `f2cmap_all`, with keys representing
    Fortran types and values being dictionaries of type specifiers and their
    C type equivalents.

c2py_map : dict
    A dictionary used for validating the C types in `new_map`. It maps C
    types to corresponding Python types and is used to ensure that the C
    types specified in `new_map` are valid.

verbose : boolean
    A flag used to provide information about the types mapped

Returns
-------
tuple of (dict, list)
    The updated Fortran-to-C type mapping dictionary and a list of
    successfully mapped C types.
z	Warning: redefinition of {'z':{'z':'z'->'z'}}
z
	Mapping "z(kind=z)" to "z"
z	Ignoring map {'z'}}: 'z' must be in r  )itemsr  r]   r  r   r  r  )
f2cmap_allnew_mapc2py_maprh   f2cmap_mappednew_map_lowerr  d1r  v1d1_lowers              ro   rd   rd     s+   L MM13<vrBHHJN<#+aggi  ! $$&JMhhjFB~A&b*-"3R9 %'1b!k!F2$gbTFG$$R("b"d8==?&;= !	 '* $$1 =s   E)r   r   )r  )F)__doc__pprintr  rk   r  	functoolsr   r  r   r   r   __all__versionf2py_versionr_   ri   rs   r   r]   r	   r{   r~   r!   r   r    rM   rK   rL   r   r   rI   r"   r;   r.   r   r   r,   r@   rT   rX   rS   rV   r'   r>   r=   r$   r-   rU   rY   r   rW   r   r   r   rJ   r   r   rC   rB   r*   r+   rO   rQ   rb   r   r   rH   r<   rA   r?   r%   r&   rN   r   rR   r   rD   r)   r   rG   r#   r5   r6   r9   r4   r8   r0   r/  r2   r:   r1   r7   r/   r=  r@  rC  r3   rE   rF   r   r[  r   r   r   re   rh  rf   rk  r   r   ro  rr  	Exceptionrt  ra   rZ   r\   r[   r(   r   r  r   r   r   r   r   r  r   r   r   r  r`   r^   r
   r   compileImatchr  r  rP   rc   rd   r   rp   ro   <module>r     sH  	  	 
   ! : "" }}
	
"

;C?7=9@6B@
>>;6
 !!!! !!@
!
"
"
"
"
!
!
!
!
B9 9;E=8
.:2					54
+I
?L9K
$L*E"(,+0/.*//0 k>>|]MZZ!#3"$5"$5#%7>%	9.		 	 ,+)
:4 ') #L/:2 "//
&:   5p **%M%'TT++05 !zz +=>@dd DDIE 
B%rp   