
    Ae{                       d dl mZ d dlZ ej                  d^i dedededededed	ed
edededededededede d dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlmZ d dlmZ d dlmZ d dlmZ 	 d dlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ 	 d d!l m!Z! ejH                  d#k  Z%d$d%d%d&d'd(Z&d)d*d+d,d-Z'd.d/iZ(g d0Z) e*g d1      Z+d2d3ijX                  Z- G d4 d5e      Z.d6 Z/ G d7 d8e      Z0 G d9 d:e0      Z1d_d;Z2 G d< d=e1      Z3 G d> d?e0      Z4 G d@ dAe      Z5 G dB dCe      Z6 G dD dEe      Z7 ej                  eeeeF        ejp                  dGjs                  dH      ejt                        jv                  Z< ejp                  dIj{                  dJ            jv                  Z> ejp                  dK      j~                  Z@ ejp                  dL      j                  ZB G dM dNe      ZC G dO dPe      ZD G dQ dRe      ZEdS ZF G dT dUe      ZG G dV dWe      ZH G dX dYe      ZI G dZ d[e      ZJ G d\ d]e      ZKy# e$ r d dlZY w xY w# e$ r
 d d"l"m#Z! Y w xY w)`    )absolute_importNosreoperatortextwrapTemplateNamingOptionsStringEncodingUtilsSourceDescriptorStringIOTree
DebugFlags
basestringdefaultdictclosingpartial)r   )r   )r   )r      )r	   )r
   )r   )r   )Version   )r   )r   )r   )r   )str)r      )zPY_MAJOR_VERSION < 3r   )PY_MAJOR_VERSION >= 3r   )r   range)r   input)bytesunicoder   xrange	raw_inputz&PyInt_Typez&PyLong_Typez&PyFloat_Typez&PyWrapperDescr_Type)py_intpy_longpy_floatwrapper_descriptorPyTypeObjectPyHeapTypeObject)
breakpoint
__loader____spec__BlockingIOErrorBrokenPipeErrorChildProcessErrorConnectionAbortedErrorConnectionErrorConnectionRefusedErrorConnectionResetErrorFileExistsErrorFileNotFoundErrorInterruptedErrorIsADirectoryErrorModuleNotFoundErrorNotADirectoryErrorPermissionErrorProcessLookupErrorRecursionErrorResourceWarningTimeoutError__build_class__ascii
memoryviewWindowsError_)	__cinit____dealloc____richcmp____next__	__await__	__aiter__	__anext____getreadbuffer____getwritebuffer____getsegcount____getcharbuffer____getbuffer____releasebuffer__inlineCYTHON_INLINEc                   @    e Zd ZdZdZdZdZdZddZd Z	d Z
d	 Zd
 Zy)IncludeCodez]
    An include file and/or verbatim C code to be included in the
    generated sources.
    r   r   r   Nc                    | j                   | _        t        |       xj                   dz  c_         i | _        |rO|d   dk(  r)|d   dk(  r!dj	                  |      | j                  d<   d}ndj	                  |      | j                  d<   |r|| j                  | j                  <   |r| j
                  | _        y |r| j                  | _        y | j                  | _        y )	Nr   r   <>z#include {0}Fz#include "{0}")	counterordertypepiecesformatINITIALlocationLATEEARLY)selfincludeverbatimlateinitials        4lib/python3.12/site-packages/Cython/Compiler/Code.py__init__zIncludeCode.__init__   s    \\
T
aqzS WR[C%7!0!7!7!@A!2!9!9'!BA&.DKK

# LLDM IIDM JJDM    c                     ||v rP||   }t        | j                  |j                        |_        |j                  j                  | j                         y| ||<   y)z
        Insert `self` in dict `d` with key `key`. If that key already
        exists, update the attributes of the existing value with `self`.
        N)minr[   rX   update)r^   dkeyothers       rc   dict_updatezIncludeCode.dict_update   sI    
 !8cFE ?ENLL,AcFre   c                     | j                   S N)rV   r^   s    rc   sortkeyzIncludeCode.sortkey   s    zzre   c                 8    | j                   j                  d      S )z
        Return the main piece of C code, corresponding to the include
        file. If there was no include file, return None.
        r   )rX   getro   s    rc   	mainpiecezIncludeCode.mainpiece   s    
 {{q!!re   c                 t    t        | j                        D ]   }|j                  | j                  |          " y rn   )sortedrX   putln)r^   codeks      rc   writezIncludeCode.write   s.    $ 	'AJJt{{1~&	're   )NNTF)__name__
__module____qualname____doc__rZ   r]   r\   rU   rd   rl   rp   rs   ry    re   rc   rP   rP   |   s6    & GEDG',
"'re   rP   c                      t         j                  j                  t         j                  j                  t         j                  j                  t                          } t         j                  j                  | d      S )NUtility)r   pathdirnameabspath__file__join)
Cython_dirs    rc   get_utility_dirr      sE     1J!KLJ77<<
I..re   c                       e Zd ZdZdZi Zedd       Zed        Zedd       Z	edi fd       Z
edd       Z ej                  d	      j                  fd
Zd Zd ZddZy)UtilityCodeBasea  
    Support for loading utility code from a file.

    Code sections in the file can be specified as follows:

        ##### MyUtility.proto #####

        [proto declarations]

        ##### MyUtility.init #####

        [code run at module initialization]

        ##### MyUtility #####
        #@requires: MyOtherUtility
        #@substitute: naming

        [definitions]

    for prototypes and implementation respectively.  For non-python or
    -cython files backslashes should be used instead.  5 to 30 comment
    characters may be used on either side.

    If the @cname decorator is not used and this is a CythonUtilityCode,
    one should pass in the 'name' keyword argument to be used for name
    mangling of such entries.
    FNc                 @   |y dj                  |      }|rAd|v r=|d   t        dg      k(  r+|d= 	 t        |      j                  t	        t
                    }d|z  |z   }|dk(  r||d<   n,|dk(  r||d<   n!|d	   }t        r|j                  d
      }|||<   |r^|d	   }|j                         D ]E  \  }	}
t        r|	j                  d
      }	|j                  |	t                     j                  |
       G y y # t        t        f$ r}t        d|||fz        d }~ww xY w)N

substitutenamingz@Error parsing templated utility code of type '%s' at line %d: %sprotor   implr   r   ASCII)r   setr   r   varsr	   KeyError
ValueErrorRuntimeErrorKEYWORDS_MUST_BE_BYTESencodeitems
setdefaultrh   )clsutilityrW   linesbegin_linenotagsrw   eall_tagsnamevaluess              rc   _add_utilityzUtilityCodeBase._add_utility   s@   ?yyLD(T,-?3z?-R\",~00f> l"T)7?GAJV^GAJqzH%{{7+!HTNqzH $

 @f);;w/D##D#%077?@ # j) ,"#e,i+ $+ , ,,s   'C8 8DDDc                    | j                   j                  |      }|r|S t        j                  j	                  t               |      }t        j                  j                  |      \  }}|dv rFd}t        t        j                  d      j                  d      }t        j                  j                  }nTd}t        t        j                  d      j                  d      }t        t        j                  d      j                  d      }t        j                  d	d
|iz        j                  }	t        j                  d      j                  }
t        t!        j"                  |d            5 }|j%                         }d d d        t'        d       }g }t'        t(              }d x}}d}t+              D ]  \  }} |	|      }|r|j-                  d      rf| j/                  |||||       |dz   }|d d = |j1                          |j-                  d      } |
|      }|r|j3                         \  }}nd}||   }||j-                  d         j5                  |j-                  d             |j7                  d       |j7                   | ||                    |t9        d      | j/                  |||||       t;        |      }|| j                   |<   |S # 1 sw Y   `xY w)N)z.pyxz.pyz.pxdz.pxi#z^\s*#(?!\s*cython\s*:).* /z^\s*//.*|/\*[^*]*\*/z	\s+(\\?)$z\1zd^%(C)s{5,30}\s*(?P<name>(?:\w|\.)+)\s*%(C)s{5,30}|^%(C)s+@(?P<tag>\w+)\s*:\s*(?P<value>(?:\w|[.:])+)Cz,(.+)[.](proto(?:[.]\S+)?|impl|init|cleanup)$UTF-8)encodingc                      d d i gS rn   r~   r~   re   rc   <lambda>z:UtilityCodeBase.load_utilities_from_file.<locals>.<lambda>*  s    tR(8 re   r   r   r   r   tagvaluezEmpty utility code file)_utility_cacherr   r   r   r   r   splitextr   r   compilesubr   _unicoderstripmatchr   r   open_source_file	readlinesr   r   	enumerategroupr   cleargroupsaddappendr   dict)r   r   	utilitiesfilenamer?   extcommentstrip_commentsr   match_special
match_typef	all_linesr   r   r   rW   r   linenolinemr   mtypes                          rc   load_utilities_from_filez(UtilityCodeBase.load_utilities_from_file  s   &&**40	77<< 148!!$'311G$RZZ0K%L%P%PRTUN#,,33FG$RZZ0G%H%L%LbQNRZZ5995AF

C'N "E 	 ZZ OPVV
U++HwGH 	&AI	&   89	3$%i0 	;LFDd#A776?$$WdE<N#)A:LaJJL776?D&t,E%*\\^
d%'oG(,,QWWW-=>LL$VN4$89:+	;. ?677 	$|TBO	#,4 Q	& 	&s   +KK$c           	         d|v r|j                  dd      \  }}|svt               }|dz   }	 t        j                  |      }D cg c]  }|j                  |      r| }}|st        d|z         t!        |      dkD  rt        d|z         |d   }| j#                  |      }||   \  }}}|r|j%                         }|j'                         D ]  \  }}||v r|dk(  rV|r+t)        |      D cg c]  } | j*                  ||fi | }}nJt)        |      D cg c]  }| j-                  ||       }}n!|sd}nt!        |      dk(  rt/        |      d   }|||<    |||d	<   |||d
<   d|vr||d<   d|vr|r||d<    | di |S # t        $ r ddl}t        }|j                  }	t        |j                  |	            5 }
|
j                         D cg c]P  }t        j                  j                  |	|      j                  |      rt        j                  j                  |      R nc c}w }}ddd       n# 1 sw Y   nxY wY w xY wc c}w c c}w c c}w )a  
        Load utility code from a file specified by from_file (relative to
        Cython/Utility) and name util_code_name.  If from_file is not given,
        load it from the file util_code_name.*.  There should be only one
        file matched by this pattern.
        z::r   .r   Nz No match found for utility code z4More than one filename match found for utility code requiresr   r   r   filer~   )rsplitr   r   listdirOSErrorzipfiler'   archiver   ZipFilenamelistr   r   
startswithbasenamer   lenr   copyr   ru   loadload_cachedlist)r   util_code_name	from_filekwargsutility_dirprefixlistingr   loaderr   fileobjr   r   filesr   r   r   r   orig_kwargsr   deps                        rc   r   zUtilityCodeBase.loadQ  s    >!(6(=(=dA(F%I~)+K#c)FW**[1 /6 5( ++F3  5E 5 !Cn!TUU5zA~ !WZh!hiiaI00;	%n5tT ++-K $

 &f6>:%"-3F^"=&) #+#((3	"I["I "= "=
 .4F^"=&) #&//#y"A "= "=!F[A%!&\!_F%t!&$ #F7O!F6N+F6NI&F6N}V}i  
W # ..W__W56 W'+2+;+;+=W#'"$'',,w"="H"H"U  "ww//5 W WG WW W W
W5&"="=sH   F I-II9I?H8AH('H8/	I8I	=IIc                 h    | ||f}	 ||   S # t         $ r Y nw xY w| j                  ||      x}||<   |S )z`
        Calls .load(), but using a per-type cache based on utility name and file name.
        )r   r   )r   utility_code_namer   _UtilityCodeBase__cacherj   rw   s         rc   r   zUtilityCodeBase.load_cached  sQ    
 I01	3< 		!hh'8)DDws|s    	c                      | j                   ||fi |}|j                  |j                  }}|j                  |      |j                  |      fS )zR
        Load a utility code as a string. Returns (proto, implementation)
        )r   r   r   format_code)r   r   r   r   utilr   r   s          rc   load_as_stringzUtilityCodeBase.load_as_string  sM    
 sxx	<V<jj$))t&(8(8(>>>re   z\n\n+c                 >    |r |d|j                               dz   }|S )z3
        Format a code section for output.
        r   z

)strip)r^   code_stringreplace_empty_liness      rc   r   zUtilityCodeBase.format_code  s'     -dK4E4E4GH6QKre   c                 N    dt        |       j                  d| j                  dS )NrR   (z)>)rW   rz   r   ro   s    rc   __str__zUtilityCodeBase.__str__  s    !$Z00$))<<re   c                      y rn   r~   )r^   r   s     rc   get_treezUtilityCodeBase.get_tree  s    re   c                     | S rn   r~   )r^   memodicts     rc   __deepcopy__zUtilityCodeBase.__deepcopy__  s    re   rn   )rz   r{   r|   r}   is_cython_utilityr   classmethodr   r   r   r   r   r   r   r   r   r   r   r   r~   re   rc   r   r      s    8 N@ @B = =~ B BH 6:B 
 
 ? ? <F2::h;O;S;S =re   r   c                   N    e Zd ZdZ	 	 ddZd Zd Zd ZddZd Z	d	 Z
d
 Zd Zy)UtilityCodeaF  
    Stores utility code to add during code generation.

    See GlobalState.put_utility_code.

    hashes/equals by instance

    proto           C prototypes
    impl            implementation code
    init            code to call on module initialization
    requires        utility code dependencies
    proto_block     the place in the resulting file where the prototype should
                    end up
    name            name of the utility code (or None)
    file            filename of the utility code file this utility was loaded
                    from (or None)
    Nc	                     || _         || _        || _        || _        || _        i | _        g | _        || _        || _        || _	        y rn   )
r   r   initcleanupr   _cachespecialize_listproto_blockr   r   )	r^   r   r   r  r  r   r  r   r   s	            rc   rd   zUtilityCode.__init__  sL     
		 !&		re   c                 D    t        | j                  | j                  f      S rn   )hashr   r   ro   s    rc   __hash__zUtilityCode.__hash__  s    TZZ+,,re   c                     | |u ryt        |       t        |      }}||urt        ||      st        | |      syt        | dd       }t        |dd       }|| j                  f||j                  fk(  S )NTFr   )rW   
isinstancegetattrr   )r^   rk   	self_type
other_type
self_protoother_protos         rc   __eq__zUtilityCode.__eq__  sv    5= $T
DK:	J&
5)0LPZ[_akPlT7D1
eWd3DII&;

*CCCre   c                     |y||z  S zY
        Format a string in this utility code with context. If None, do nothing.
        Nr~   r^   scontexts      rc   none_or_subzUtilityCode.none_or_sub  s     97{re   c           
         | j                   }|1|j                         |d<   |j                         |d<   |d|d   d}t        t	        |j                                     }	 | j                  |   S # t        $ r | j                  d }n.| j                  D cg c]  }|j                  |       nc c}w }}t        | j                  | j                  |      | j                  | j                  |      | j                  | j                  |      | j                  | j                  |      || j                   |      x}| j                  |<   | j"                  j%                  |       |cY S w xY w)NrW   	type_name[])r   empty_declaration_codespecialization_nametupleru   r   r  r   r   
specializer   r  r   r   r  r  r  r  r   )r^   
pyrex_typedatar   rj   r   rr  s           rc   r  zUtilityCode.specialize  sC   yy!%<<>DL * > > @D#T+%67DF4::<()	;;s## 	}}$8<F1ALL.FFF#.  T2  D1  D1  t4  $ AC    ''*H#	s   #A2 2&E*B10B7E*)E*c                 x    d|vrd|vrd|fS i fd}t        j                  d||      }d|vrd|vsJ d|fS )zHReplace 'PYIDENT("xyz")' by a constant Python identifier cname.
        zPYIDENT(z
PYUNICODE(Fc                     | j                         }	 |   }|S # t        $ rA |\  }}j                  t        j                  |      |dk(        j
                  x}|<   Y |S w xY w)NIDENT
identifier)r   r   get_py_string_constr   EncodedStringcname)matchobjrj   r*  str_typer   outputreplacementss        rc   externalisez8UtilityCode.inject_string_constants.<locals>.externalise  s    //#Cb$S)
 L	  b!$$,2,F,F&44T:xSZGZ -G -\\a\abS)L	bs    AA$#A$zPY(IDENT|UNICODE)\("([^"]+)"\)Tr   r   )r^   r   r-  r/  r.  s     ` @rc   inject_string_constantsz#UtilityCode.inject_string_constants  sY     T!l$&>$;	 vv7dK%,d*BBTzre   c                 `    d|vrd|fS fd}t        j                  d||      }d|vsJ d|fS )zVReplace 'UNBOUND_METHOD(type, "name")' by a constant Python identifier cname.
        zCALL_UNBOUND_METHOD(Fc                 
   | j                         \  }}}}|r0|dd  j                  d      D cg c]  }|j                          c}ng }t        |      dk  sJ dt        |      z         j	                  ||||      S c c}w )Nr   ,   z8CALL_UNBOUND_METHOD() does not support %d call arguments)r   splitr   r   cached_unbound_method_call_code)r+  
type_cnamemethod_name	obj_cnameargsargr-  s         rc   r/  z7UtilityCode.inject_unbound_methods.<locals>.externalise.  s    7?7H4JYCG48>>#+>?CCIIK?RDt9q=h"\_bcg_h"hh99)ZQ\^bcc @s   B zMCALL_UNBOUND_METHOD\(([a-zA-Z_]+),\s*"([^"]+)",\s*([^),]+)((?:,\s*[^),]+)*)\)Tr0  )r^   r   r-  r/  s     ` rc   inject_unbound_methodsz"UtilityCode.inject_unbound_methods(  sP     "-$;	d vv
 & &T11Tzre   c                 R    d|vr|S d }t        j                  d||      }d|vsJ |S )z<Replace CSTRING('''xyz''') by a C compatible string
        zCSTRING(c                     | j                  d      j                  dd      }dj                  d |j                         D              S )Nr   "r   c              3   z   K   | ]3  }|j                  d       r|j                  d      rd|z  nd|dd z   5 yw)\z\\z"%s\n"
z"%s"
NrS   )endswith).0r   s     rc   	<genexpr>zCUtilityCode.wrap_c_strings.<locals>.split_string.<locals>.<genexpr>G  sH      2 +/--*=vAVd"\dgklomogp\pp2s   9;)r   replacer   
splitlines)r+  contents     rc   split_stringz0UtilityCode.wrap_c_strings.<locals>.split_stringE  sD    nnQ'//V<G77 2#..02 2 2re   z)CSTRING\(\s*"""([^"]*(?:"[^"]+)*)"""\s*\)r0  )r^   r   rI  s      rc   wrap_c_stringszUtilityCode.wrap_c_strings?  s<     T!K	2 vvBLRVW%%re   c                    | j                   r"| j                   D ]  }|j                  |        | j                  re|| j                     }|j	                  d| j
                  z         |j                  | j                  | j                        d| j
                  z         | j                  r| j                  | j                  | j                              }| j                  ||      \  }}| j                  ||      \  }}|d   }|j	                  d| j
                  z         |s"|s |j                  |d| j
                  z         n|j                  |       | j                  r|d   }|j	                  d| j
                  z         t        | j                  t              r+|j                  | j                  | j                               n| j                  ||j                          |j	                  |j#                  |j                                |j	                          | j$                  rt&        j(                  r|d   }|j	                  d	| j
                  z         t        | j$                  t              r9|j                  | j                  | j$                        d
| j
                  z         y | j%                  ||j                          y y y )Nz/* %s.proto */z%s_protoutility_code_defz/* %s */z%s_implinit_globalsz/* %s.init */cleanup_globalsz/* %s.cleanup */z
%s_cleanup)r   use_utility_coder   r  rv   r   put_or_includer   r   rJ  r1  r=  putr  r  r   
module_poserror_goto_if_PyErrr  r
   generate_cleanup_code)r^   r-  
dependencywriterr   is_specialised1is_specialised2s          rc   put_codezUtilityCode.put_codeO  s1   =="mm 4
''
34::D,,-FLL)DII56!!  ,j499.DF99##D$7$7		$BCD$($@$@v$N!OT$($?$?f$M!OT./FLLdii/0#%%dI		,AB

4 99N+FLL49945$))Z0

4++DII67		&&"3"34LL33F4E4EFGLLN<<G99-.FLL+dii78$,,
3%%$$T\\2 499,. VV%6%67 :<re   )NNNNNutility_code_protoNNrn   )rz   r{   r|   r}   rd   r	  r  r  r  r1  r=  rJ  rY  r~   re   rc   r   r     s?    $ QUCG-	D:*. %8re   r   c                 N    | sy|r|d||d<   n|r||d<   ddl m}  || fi |S )z+Run tempita on string s with given context.N:__namer   r   )Tempitar   )r  r  r   r   r   s        rc   sub_tempitar`  w  s:    '+T2	 qGre   c                   >     e Zd Zd fd	Zeddi fd       Zd Z xZS )TempitaUtilityCodeNc                     |i }t        ||||      }t        ||||      }t        ||||      }t        t        |   ||f|||d| y )N)r  r   r   )r`  superrb  rd   )	r^   r   r   r   r  r   r  r   	__class__s	           rc   rd   zTempitaUtilityCode.__init__  si    ?GE7D$74$54$5 $04	D"D	D<B	Dre   c                     |r"t        t        |j                                     nd }t        |      J | |||f}	 ||   S # t        $ r Y nw xY w| j                  |||      x}||<   |S )N)r  )r  ru   r   r  r   r   )r   r   r   r  _TempitaUtilityCode__cachecontext_keyrj   rw   s           rc   r   zTempitaUtilityCode.load_cached  s|    8?eF7==?34TK ,,I0+>	3< 		!hh'8)WhUUws|s   A   	AAc                 L    |yt        ||| j                  | j                        S r  )r`  r   r   r  s      rc   r  zTempitaUtilityCode.none_or_sub  s%     91gtyy$))<<re   )NNNNNN)rz   r{   r|   rd   r   r   r  __classcell__)re  s   @rc   rb  rb    s*    D 6:DRT 	 	=re   rb  c                   $    e Zd ZdZdZ dZd Zd Zy)LazyUtilityCodez
    Utility code that calls a callback with the root code writer when
    available. Useful when you only have 'env' but not 'code'.
    z<lazy>Nc                     || _         y rn   )callback)r^   rn  s     rc   rd   zLazyUtilityCode.__init__  s	     re   c                 \    | j                  |j                        }|j                  |       y rn   )rn  
rootwriterrO  )r^   globalstater   s      rc   rY  zLazyUtilityCode.put_code  s$    -- 6 67$$W-re   )rz   r{   r|   r}   r   rd   rY  r~   re   rc   rl  rl    s     HH!.re   rl  c                       e Zd Z e       dfdZd ZddZddZd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd ZddZd Zd Zd Zd Zd Zd Zd Zd Zy)FunctionStateNc                    || _         || _        || _        d | _        d| _        t               | _        | j                         | _        | j                          d | _
        d | _        g | _        d| _        d | _        d | _        d| _        d| _        g | _        i | _        i | _        t               | _        d| _        d | _        g | _        d| _        d| _        y )Nr   FT)names_takenownerscopeerror_labellabel_counterr   labels_used	new_labelreturn_labelnew_error_labelcontinue_labelbreak_labelyield_labelsin_try_finallyexc_varscurrent_except	can_trace	gil_ownedtemps_allocated
temps_freetemps_used_typezombie_tempstemp_counterclosure_tempscollect_temps_stackshould_declare_error_indicatoruses_error_indicator)r^   rv  ru  rw  s       rc   rd   zFunctionState.__init__  s    &

5 NN,""!!E! $&  /4+$)!re   c                    | j                   rn| j                         }|r[d| j                  j                  ddj	                  t        |      D cg c]  \  }}}|d|d c}}}      }t        |      y y c c}}}w )Nz&TEMPGUARD: Temps left over at end of 'z': , z [r  )r  temps_in_userw  r   r   ru   r   )r^   	leftoversr   ctype	is_pytempmsgs         rc   validate_exitzFunctionState.validate_exit  s    ))+IIMZ^ZcZc282CeE eE.eY "&u-eE [F 
 #3''   eEs   A<c                 p    | j                   }|dz   | _         dt        j                  |fz  }||d|z   z  }|S )Nr   %s%dr?   )ry  r	   label_prefix)r^   r   nlabels       rc   r{  zFunctionState.new_label  sG    U&--q11S4ZEre   c                     | j                  d|z        }t        | j                        dz   |f}| j                  j                  |       |S )Nzresume_from_%sr   )r{  r   r  r   )r^   	expr_typer  num_and_labels       rc   new_yield_labelzFunctionState.new_yield_label  sJ    /);<T../!3U;  /re   c                 J    | j                   }| j                  d      | _         |S )Nerror)rx  r{  )r^   old_err_lbls     rc   r}  zFunctionState.new_error_label  s$    &&>>'2re   c                 2    | j                   | j                  fS rn   r~  r  ro   s    rc   get_loop_labelszFunctionState.get_loop_labels
  s     	re   c                 "    |\  | _         | _        y rn   r  r^   labelss     rc   set_loop_labelszFunctionState.set_loop_labels  s    #				re   c                     | j                         }| j                  | j                  d      | j                  d      f       |S )Ncontinuebreak)r  r  r{  )r^   
old_labelss     rc   new_loop_labelszFunctionState.new_loop_labels  sC    ))+
^^J'^^G$&	' re   c                 ^    | j                   | j                  | j                  | j                  fS rn   r~  r  r|  rx  ro   s    rc   get_all_labelszFunctionState.get_all_labels  s0    	 	re   c                 :    |\  | _         | _        | _        | _        y rn   r  r  s     rc   set_all_labelszFunctionState.set_all_labels!  s#     $								re   c                     | j                         }g }t        |g d      D ]9  \  }}|r!|j                  | j                  |             )|j                  |       ; | j	                  |       |S )N)r  r  returnr  )r  zipr   r{  r  )r^   r  
new_labels	old_labelr   s        rc   all_new_labelszFunctionState.all_new_labels'  sn    ((*

":/WX 	-OIt!!$.."67!!),		-
 	J're   c                 :    | j                   j                  |       y rn   )rz  r   r^   lbls     rc   	use_labelzFunctionState.use_label2  s    S!re   c                     || j                   v S rn   )rz  r  s     rc   
label_usedzFunctionState.label_used5  s    d&&&&re   c           	         |j                   r|j                  s|j                  }nH|j                  r|j                  s|j                  }n#|j
                  rddlm} |j                  |      }|j                  s|j                  sd}| j                  j                  ||f      }|r/|-|d   r(|d   j                         }|d   j                  |       n	 | xj                  dz  c_        dt         j"                  | j                  fz  }|| j$                  vrnD| j&                  j)                  ||||f       |s| j*                  j-                  |       ||f| j.                  |<   t0        j2                  r)| j4                  j7                  d|d|d|rd	nd
d       | j8                  r | j8                  d   j-                  ||f       |S )a  
        Allocates a temporary (which may create a new one or get a previously
        allocated and released one of the same type). Type is simply registered
        and handed back, but will usually be a PyrexType.

        If type.is_pyobject, manage_ref comes into play. If manage_ref is set to
        True, the temp will be decref-ed on return statements and in exception
        handling clauses. Otherwise the caller has to deal with any reference
        counting of the variable.

        If not type.is_pyobject, then manage_ref will be ignored, but it
        still has to be passed. It is recommended to pass False by convention
        if it is known that type will never be a Python object.

        static=True marks the temporary declaration with "static".
        This is only used when allocating backing store for a module-level
        C array literals.

        if reusable=False, the temp will not be reused after release.

        A C string referring to the variable is returned.
        r   )
PyrexTypesFr   r  /* z allocated ()r   	 - zombiez */rS   )is_constis_referenceconst_base_typeis_fake_referenceref_base_typeis_cfunctionr   r  
c_ptr_typeis_pyobjectis_memoryviewslicer  rr   popremover  r	   codewriter_temp_prefixru  r  r   r  r   r  r   debug_temp_code_commentsrv  rv   r  )r^   rW   
manage_refstaticreusabler  freelistresults           rc   allocate_tempzFunctionState.allocate_temp:  s   . ==!2!2''Dt'='=%%D$((.D(?(? J??&&j'9:,!a[__&FQKv&!!Q&!6#@#@$BSBS"TT!1!115    ''z6(JK!!%%f-(,j'9V$..JJFDPX"^iJijk##$$R(,,fd^<re   c                    | j                   |   \  }}| j                  j                  ||f      }|g t               f}|| j                  ||f<   ||d   v rt	        d|z        || j
                  vr|d   j                  |       |d   j                  |       t        j                  r3| j                  j                  d|d|| j
                  v rdndd	       yy)
zv
        Releases a temporary so that it can be reused by other code needing
        a temp of the same type.
        Nr   zTemp %s freed twice!r   r  z
 released r  r   */)r  r  rr   r   r   r  r   r   r   r  rv  rv   )r^   r   rW   r  r  s        rc   release_tempzFunctionState.release_tempr  s    
  //5j??&&j'9:CE{H2:DOOT:./8A;5<==t(((QKt$..JJTT->->%>kBFH I /re   c                     g }| j                   D ]P  \  }}}}| j                  j                  ||f      }|||d   vs/|j                  |||xr |j                  f       R |S )zxReturn a list of (cname,type,manage_ref) tuples of temp names and their type
        that are currently in use.
        r   )r  r  rr   r   r  )r^   usedr   rW   r  r  r  s          rc   r  zFunctionState.temps_in_use  sx     .2.B.B 	K*D$
F**D*+=>H4x{#:T4)H8H8HIJ	K re   c                 |    | j                         D cg c]  \  }}}|r|j                  r||f c}}}S c c}}}w )zReturn a list of (cname,type) tuples of temp names and their type
        that are currently in use. This includes only temps of a
        Python object type which owns its reference.
        )r  r  )r^   r   rW   r  s       rc   temps_holding_referencez%FunctionState.temps_holding_reference  sG     /3.?.?.A5 5*D$
4#3#3 t 5 	5 5s   7c           
      d    | j                   D cg c]  \  }}}}|r||f c}}}}S c c}}}}w )zRReturn a list of (cname, type) tuples of refcount-managed Python objects.
        )r  )r^   r*  rW   r  r  s        rc   all_managed_tempszFunctionState.all_managed_temps  s>     8<7K7K 3E4V   	 s   *
c                     t        | j                  j                         D cg c]  \  \  }}}|r|d   D ]  }||f  c}}}}      S c c}}}}w )zReturn a list of (cname, type) tuples of refcount-managed Python
        objects that are not currently in use.  This is used by
        try-except and try-finally blocks to clean up temps in the
        error case.
        r   )ru   r  r   )r^   rW   r  r  r*  s        rc   all_free_managed_tempsz$FunctionState.all_free_managed_temps  sf     040E0E0G
 
,"zH:!!
  DM

  	 
s   Ac                 J    | j                   j                  t                      y)zJ
        Useful to find out which temps were used in a code block
        N)r  r   r   ro   s    rc   start_collecting_tempsz$FunctionState.start_collecting_temps  s     	  ''.re   c                 6    | j                   j                         S rn   )r  r  ro   s    rc   stop_collecting_tempsz#FunctionState.stop_collecting_temps  s    ''++--re   c                 $    t        |      | _        y rn   )ClosureTempAllocatorr  r^   rw  s     rc   init_closure_tempsz FunctionState.init_closure_temps  s    1%8re   rn   )yield)FT)rz   r{   r|   r   rd   r  r{  r  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r~   re   rc   rs  rs    s|     +.%t $*P
(

$$	"'
6pI&	5
/.9re   rs  c                       e Zd ZdZddZy)NumConstzGlobal info about a Python number constant held by GlobalState.

    cname       string
    value       string
    py_type     string     int, long, float
    value_code  string     evaluation code if different from value
    Nc                 D    || _         || _        || _        |xs || _        y rn   )r*  r   py_type
value_code)r^   r*  r   r  r  s        rc   rd   zNumConst.__init__  s#    

$-re   rn   rz   r{   r|   r}   rd   r~   re   rc   r  r    s    .re   r  c                       e Zd ZdZd Zy)PyObjectConstz>Global info about a generic constant held by GlobalState.
    c                      || _         || _        y rn   )r*  rW   )r^   r*  rW   s      rc   rd   zPyObjectConst.__init__  s    
	re   Nr  r~   re   rc   r  r    s    
re   r  )possible_unicode_identifierpossible_bytes_identifierreplace_identifierfind_alphanumss   (?![0-9])\w+$r<   z(?![0-9])\w+$r   z[^a-zA-Z0-9_]+z([a-zA-Z0-9]+)c                   (    e Zd ZdZd Zd Z	 	 ddZy)StringConstz?Global info about a C string constant held by GlobalState.
    c                 p    || _         || _        t        j                  |      | _        d | _        g | _        y rn   )r*  textr   escape_byte_stringescaped_value
py_stringspy_versions)r^   r*  r  byte_strings       rc   rd   zStringConst.__init__  s2    
	+>>{Kre   c                 p    |s
ddg| _         y || j                   vr| j                   j                  |       y y )Nr   r5  )r   r   )r^   versions     rc   add_py_versionzStringConst.add_py_version  s8     !1vDD,,,##G, -re   Nc                    | j                   }| j                  }t        |xs |      }|d u xr | }|d }n3|j                         }|dv rd }d }ndj	                  t        |            }||||f}	|	 ||	   S i | _         |rd}
n>|:t        |t              rt        t        |            }
nt        t        |            }
nd}
|
rt        j                  d   }nt        j                  }|rd|z  }nd}||xr dxs
 |xr dxs d	|d
| j                  t        t        j                         d  }t#        ||||||
      }|| j                   |	<   |S # t        $ r Y w xY w)N)utf8zutf-8r<   usasciizus-asciir   TFr   z_%sr  ubr?   )r  r  boollowerr   r  r   r  r   r  r  r	   interned_prefixespy_const_prefixr*  r   const_prefixPyStringConst)r^   r   r'  is_strpy3str_cstringr  r  
is_unicodeencoding_keyrj   internr   encoding_prefixpystring_cname	py_strings                  rc   r(  zStringConst.get_py_string_const  s   __
yyj*F+%4f*
L  ~~'HLL#!ww~h'?@z<@!!#& !DOF$&7=>9$?@F--e4F++F#l2O O ^;!3;;JJs6../01	3 "Hj&.&R	(C  s   2E 	EENFN)rz   r{   r|   r}   rd   r  r(  r~   re   rc   r  r    s    - 8<9=9re   r  c                   "    e Zd ZdZ	 	 ddZd Zy)r  zDGlobal info about a Python string constant held by GlobalState.
    Nc                 X    || _         || _        || _        || _        || _        || _        y rn   )r*  r  r   r  r  r  )r^   r*  r   r  r  r  r  s          rc   rd   zPyStringConst.__init__4  s-    
, $re   c                 4    | j                   |j                   k  S rn   )r*  r^   rk   s     rc   __lt__zPyStringConst.__lt__=  s    zzEKK''re   )FNF)rz   r{   r|   r}   rd   r  r~   re   rc   r  r  *  s     <A-2(re   r  c                       e Zd Zi Zg dZd%dZd Zd Zd Zd Z	d Z
d%d	Zd&d
Zd Zd'dZd%dZd Z	 	 d(dZd Zd Zd%dZd)dZd Zd Zd*dZd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&y)+GlobalState)h_codefilename_tableutility_code_proto_before_typesnumeric_typedefscomplex_type_declarationstype_declarationsrZ  module_declarationstypeinfobefore_global_var
global_varstring_declsdeclslate_includesall_the_restpystring_tablecached_builtinscached_constantsrM  init_modulerN  cleanup_modulemain_methodrL  endNc                 P   i | _         g | _        i | _        t               | _        i | _        d| _        || _        || _        i | _	        || _
        i | _        i | _        i | _        i | _        i | _        g | _        i | _        t               | _        |j'                  |        || _        y )NF)r!  filename_listinput_file_contentsr   utility_codesdeclared_cnamesin_utility_code_generationcode_configcommon_utility_include_dirpartsmodule_nodeconst_cnames_usedstring_const_indexdedup_const_indexpyunicode_ptr_const_indexnum_const_indexpy_constantscached_cmethodsinitialised_constantsset_global_staterp  )r^   rV  r>  r;  r<  s        rc   rd   zGlobalState.__init__}  s     #%  U!*/'&*D'
& "$"$!#)+&!!%(U"% re   c                 *   | j                   }| j                  D ]  }|j                         | j                  |<   ! t        j
                  s| j                  d= n0| j                  d   }|j                          |j                  d       | j                  d   }|j                          |j                  d       |j                  d       |j                          |j                  d       | j                  d   }|j                          |j                  d       |j                  d       t        j                  s| j                  d	= nA| j                  d	   }|j                          |j                  d       |j                  d
       | j                  d   }|j                  d       |j                  d       | j                  d   }| j                  j                  r|j                  d       |j                  d       |j                  d       y )Nr/  z=static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {r0  r   z>static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {__Pyx_InitCachedConstantsrM  z6static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {rN  z:static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) {rZ  z)/* --- Runtime support code (head) --- */rL  z
#line 1 "cython_utility"
z"/* --- Runtime support code --- */)rp  code_layoutinsertion_pointr=  r
   cache_builtinsenter_cfunc_scoperv   put_declare_refcount_contextput_setup_refcount_contextrT  r;  emit_linenumsry   )r^   rp  partwrw   s        rc   initialize_main_c_codez"GlobalState.initialize_main_c_code  s   __
$$ 	<D)99;DJJt	< %%

,-

,-A!GGSTJJ)*			PQ	&&(	$$%@AJJ~&			HI,,

,-

,-A!GGBKGGPQzz./

2

>?zz,-))JJ56

2

78re   c                     | j                          | j                  d   }t        j                  dd      }|j	                  |j                  |j                               |j                  d       y )NrL  TypeConversionszTypeConversion.cr   )close_global_declsr=  rb  r   rQ  r   r   rv   )r^   rw   r   s      rc   finalize_main_c_codez GlobalState.finalize_main_c_code  sY    !
 zz,-!--.?AST!!$)),-

2re   c                      | j                   |   S rn   )r=  )r^   rj   s     rc   __getitem__zGlobalState.__getitem__  s    zz#re   c                    | j                          t        j                  r| j                  d   }|j	                  d       |j                  |j                        r,|j                  |j                         |j	                  d       |j	                  d       |j                          | j                  d   }|j                          |j	                  d       |j                  |j                        r<|j                  |j                         |j                          |j	                  d       |j	                  d       |j                          | j                  d   }|j	                  d       |j                  |j                        r,|j                  |j                         |j	                  d       |j	                  d       |j                          t        j                  r0| j                  d   }|j	                  d       |j                          t        j                  r1| j                  d   }|j	                  d       |j                          y y )	Nr/  z	return 0;z
return -1;}r0  rM  rN  r2  )generate_const_declarationsr
   rL  r=  rv   r  rx  	put_labelexit_cfunc_scopeput_finish_refcount_contextrT  )r^   rR  s     rc   rV  zGlobalState.close_global_decls  s    	((*!!

,-AGGK ||AMM*AMM*%GGCL JJ)*	%%'	<<&KK&))+GGL!		JJ~&	<<&KK&GGL!		((

,-AGGCL ((

+,AGGCL  )re   c                 F    | d   j                  d|j                  z         y )Nr)  static PyObject *%s;)rv   r*  r^   entrys     rc   put_pyobject_declzGlobalState.put_pyobject_decl  s    \  !7%++!EFre   c                 x    |*|| j                   v ry | j                   j                  |       | j                  d   S )Nr0  )rF  r   r=  r^   targets     rc   get_cached_constants_writerz'GlobalState.get_cached_constants_writer  s=    333&&**62zz,--re   c                     |xr dxs d}	 | j                   ||f   }|S # t        $ r | j                  ||      }Y |S w xY w)NlongintrC  r   new_num_const)r^   	str_valuelongnessr  cs        rc   get_int_constzGlobalState.get_int_const  sZ    %v.	7$$i%9:A   	7""9g6A	7s    >>c                 p    	 | j                   |df   }|S # t        $ r | j                  |d|      }Y |S w xY w)Nfloatrl  )r^   rn  r  rp  s       rc   get_float_constzGlobalState.get_float_const  sP    	C$$i%9:A   	C""9gzBA	Cs    55c                    || j                   j                  |      }||S | j                  ||      }|@|t        j                  k  r-| j
                  d   }|j                  d|j                  z         ||| j                   |<   |S )NrN  zPy_CLEAR(%s);)rA  rr   new_py_constr
   rT  r=  rv   r*  )r^   rW   r   cleanup_level	dedup_keyconstcleanup_writers          rc   get_py_constzGlobalState.get_py_const  s     **..y9E !!$/$!W%B%BB!ZZ(9:N  5;;!>? 05D""9-re   c                     |j                   r|j                         }n|j                         }	 | j                  |   }|j                  |       |S # t        $ r | j                  ||      }Y 0w xY wrn   )r  
utf8encode
byteencoder@  r   new_string_constr  )r^   r  
py_versionr  rp  s        rc   get_string_constzGlobalState.get_string_const%  sn    ??//+K//+K	9''4A 	
$  	9%%dK8A	9s   A A/.A/c                     |j                   sJ 	 | j                  |   }|S # t        $ r# | j                         x}| j                  |<   Y |S w xY wrn   )r  rB  r   new_const_cname)r^   r  rp  s      rc   get_pyunicode_ptr_constz#GlobalState.get_pyunicode_ptr_const2  s_    	N..t4A   	N7;7K7K7MMA..t4	Ns   ! (AAc                     d }|rJ|H|j                         |j                         k7  r'| j                  |d      }| j                  |d      }n| j                  |      }|j                  |j                  |||      }|S )Nr5  )r  r   )r}  r~  r  r(  r   )r^   r  r'  r  unicode_valuer  c_stringr  s           rc   r(  zGlobalState.get_py_string_const;  s     m/ ++-1BB!22=Q2ON,,Ta,@H,,T2H00MM:v~?	re   c                 (    | j                  |d      S NTr&  r(  r^   r  s     rc   get_interned_identifierz#GlobalState.get_interned_identifierI      '''>>re   c                 `    | j                  |      }t        |||      }|| j                  |<   |S rn   )new_string_const_cnamer  r@  )r^   r  r  r*  rp  s        rc   r  zGlobalState.new_string_constL  s5    ++K8t[1/0,re   c                 h    | j                  ||      }t        ||||      }|| j                  ||f<   |S rn   )new_num_const_cnamer  rC  )r^   r   r  r  r*  rp  s         rc   rm  zGlobalState.new_num_constR  s>    ((8UE7J712eW-.re   c                 v    | j                  |      }t        ||      }| j                  j                  |       |S rn   )r  r  rD  r   )r^   rW   r   r*  rp  s        rc   rv  zGlobalState.new_py_constX  s7    $$V,%&  #re   c                 J    |j                  dd      }| j                  |      S )Nr   ignore)r   )decoder  )r^   bytes_valuer   s      rc   r  z"GlobalState.new_string_const_cname^  s(    ""7H5##%#00re   c                     |dk(  r|dz  }d}t         j                  |   }||}|j                  dd      j                  dd      j                  dd      }|S )	Nrj  Lrk  +r?   -neg_r   )r	   r  rF  )r^   r   r  r   r*  s        rc   r  zGlobalState.new_num_const_cnamec  sa    fSLEG))'2 %(c3'//V<DDS#Nre   c                     t        d|      d d j                  d      }| j                  }|}||v r||   dz   x}||<   d||fz  }||v rd||<   |rt        j                  |   }nt        j
                  }||S )Nr?       r   z%s_%d)r  r   r?  r	   r  r  )r^   r   r   r  name_suffixrU   s         rc   r  zGlobalState.new_const_cnamel  s    "3.s399#>%%T!$(K!O3Gd5k!UG$44K T! [--f5F((F--re   c                     ||f}	 | j                   |   }|S # t        $ r* | j                  d|d|      x}| j                   |<   Y |S w xY w)Numethodr?   )rE  r   r  )r^   r8  r9  rj   r*  s        rc   get_cached_unbound_methodz%GlobalState.get_cached_unbound_methodz  so    ;'	@((-E   	@040D0Dj+>1@ @ED((-	@s    /A
	A
c                     dt        |      z  }| j                  t        j                  |d             | j	                  ||      }|g|z   }d|d|ddj                  |      dS )NzCallUnboundCMethod%dObjectHandling.c__Pyx_z(&r  r  )r   rO  r   r   r  r   )r^   r:  r8  r9  
arg_cnamesr   cache_cnamer;  s           rc   r7  z+GlobalState.cached_unbound_method_call_code  sg    2S_Dk556GI[\]44ZM{Z'IIdO
 	
re   c                 z   |j                   r.|j                  r | j                  |j                  |      r| j	                  |       | j
                  d   }d }|j                  t        v rut        |j                     \  }}|j                  d|z         | j                  |j                  t        j                  |      |j                         |j                  d       | j                  |j                  t        j                  |j                        |j                         |r|j                  d       y y y y y )Nr/  #if %s#else#endif)
is_builtinr  should_declarer*  rd  r=  r   non_portable_builtins_maprv   put_cached_builtin_initposr   r)  )r^   rc  rR  	conditionreplacements        rc   add_cached_builtin_declz#GlobalState.add_cached_builtin_decl  s    ""5;;6&&u-JJ01 	::!::-Fuzz-R*I{GGHy0100		>#?#?#L% GGG$,,II~;;EJJGKK! GGH%  7 !/re   c                     | j                   d   }| j                  |      j                  }| j                  t        j                  dd             |j                  |d|d|d|j                  |             y )Nr/  GetBuiltinNamer  z = __Pyx_GetBuiltinName(z); if (!) )r=  r  r*  rO  r   r   rv   
error_goto)r^   r  r   r*  rR  interned_cnames         rc   r  z#GlobalState.put_cached_builtin_init  sn    JJ()55d;AA##$46HI	K	LL	 	 re   c                     | j                          | j                          | j                          | j                          y rn   )generate_cached_methods_declsgenerate_string_constantsgenerate_num_constantsgenerate_object_constant_declsro   s    rc   r\  z'GlobalState.generate_const_declarations  s2    **,&&(##%++-re   c                 .   | j                   D cg c]$  }t        |j                        |j                  |f& }}|j                          | j                  d   }|D ]3  \  }}}|j                  d|j                  j                  |      z         5 y c c}w )Nr+  z
static %s;)rD  r   r*  sortr=  rv   rW   declaration_code)r^   rp  constsdecls_writerr?   r*  s         rc   r  z*GlobalState.generate_object_constant_decls  s    ,,. qww<!, . .zz'*! 	?KAuaqvv66u==?	?	.s   )Bc                    | j                   sy | j                  d   }| j                  d   }g }t        | j                   j                               D ]v  \  \  }}}|j	                  |       | j                  t        j                  |            j                  }|j                  d|d|d       |j                  |d|d       x t        j                  r+| j                  d   }|D ]  }|j                  d	|z          y y )
Nr+  rM  zstatic __Pyx_CachedCFunction z = {0, &z, 0, 0, 0};z.type = (PyObject*)&;rN  zPy_CLEAR(%s.method);)rE  r=  ru   r   r   r  r   r)  r*  rv   r
   rT  )	r^   declr  cnamesr8  r9  r*  method_name_cnamer  s	            rc   r  z)GlobalState.generate_cached_methods_decls  s    ##zz'"zz.)06t7K7K7Q7Q7S0T 	$,%ZuMM%  $ < <^=Y=YZe=f g m mJJ(* + JJz# $	$ ((jj!23G >4u<=> )re   c                    | j                   j                         D cg c]$  }t        |j                        |j                  |f& }}|j	                          g }| j
                  d   }|D ]   \  }}}d}|j                  rFd|j                  vsd|j                  vr*d}|j                  dd|j                  v xr dxs dz         |j                  d	|d
t        j                  |j                        d       |r|j                  d       |j                  |j                  j                         D ]3  }|j                  |j                  t        |j                        |f       5  t        | j                  j                               D ]  \  }}t        j                   |      \  }	}
|	r|j                  d       |j                  d|d|
d       |	sL|j                  d       |j                  d|d|	d       |j                  d        |r?| j#                  t$        j'                  dd             |j	                          | j
                  d   }|j                  d       |j                  dt(        j*                  z         |D ]R  \  }}}|j,                  r|j.                  r|j.                  dv rd}nd|j.                  j1                         z  }|j                  d|j                  z         |j2                  ry|j                  d       |j                  d|j                  |j2                  j                  |j2                  j                  ddd|j4                  fz         |j                  d       |j                  d|j                  ||||j6                  |j,                  |j4                  fz         |j2                  sB|j                  d       U |j                  d       |j                  d        | j
                  d!   }|j                  d"t(        j*                  d#|j9                  | j:                               y y c c}w )$Nr*  Fr   r5  Tz#if PY_MAJOR_VERSION %s 3rR   z>=zstatic const char z[] = "z";r  z#ifdef Py_UNICODE_WIDEzstatic Py_UNICODE z[] = { z };r  InitStringszStringTools.cr.  r   z$static __Pyx_StringTabEntry %s[] = {)r   USASCIIzUS-ASCIIUTF8r   0z"%s"ra  z#if PY_MAJOR_VERSION >= 3z&{&%s, %s, sizeof(%s), %s, %d, %d, %d},r   r   z{0, 0, 0, 0, 0, 0, 0}z};rM  zif (__Pyx_InitStrings(z) < 0) )r@  r   r   r*  r  r=  r   rv   r   split_string_literalr  r  r   ru   rB  r   encode_pyunicode_stringrO  r   r   r	   stringtab_cnamer  r   r  r  r  r  r  rR  )r^   rp  c_constsr  r  r?   r*  conditionalr  utf16_arrayutf32_arrayrR  c_cnamer   rM  s                  rc   r  z%GlobalState.generate_string_constants  s   8<8O8O8V8V8XY1S\177A.YY
zz.1# 	RKAuaK}}!1=="8AQ]]<R"""#>!--'0S8D$: ;~::1??K M N""8,||'!"!4!4!6 RI%%qwwIOO0Di&PQR	R t==CCEF 		-HAu'5'M'Ma'P$K""#;<UKXY""7+""P[#\]""8,		- !!+"9"9-"YZOO

+,AGGBKGG:V=S=SST)3 &%I ''y/A/A!** /@ @"H%	(:(:(@(@(BBH""*Y__<>++GG78GGD!!0066!0066Q!((H   GGG$@OO(($$$$D   ++GGH%=&> GG+,GGDM::n5L** ++DOO<>?S = Zs   )Qc                    | j                   j                         D cg c]K  }|j                  |j                  d   dk(  t	        |j                        |j                  |j
                  |fM }}|j                          | j                  d   }| j                  d   }|D ]  \  }}}}}}|j                  }	|j                  d|	z         |dk(  rd}
nB|dk(  rd	}
n:t        j                  |      rd
}
n"t	        |j                  d            dkD  rd}
nd}
|j                  |	d|
|z  d|j                  |	| j                                y c c}w )Nr   r  r+  rM  ra  rs  zPyFloat_FromDouble(%s)rj  z%PyLong_FromString((char *)"%s", 0, 0)z$PyInt_FromString((char *)"%s", 0, 0)   zPyInt_FromLong(%sL)zPyInt_FromLong(%s) = z; )rC  r   r  r   r   r  r  r=  r*  rv   r   long_literallstriperror_goto_if_nullrR  )r^   rp  r  r  rM  r  r?   r   r  r*  functions              rc   r  z"GlobalState.generate_num_constants  sB   //668: 99aggajC/QWWqwwVWX : :zz'*zz.139 	J/GQ5*aGGE5=>'!3F"B##E*AU\\#&'!+0/x*,//tG I J	J:s   AEc                     || j                   v rX| j                   |   }t        |j                        t        |j                        k(  sJ |j                  |j                  k(  sJ y|| j                   |<   y)NFT)r9  r   rW   r  )r^   r*  rc  rk   s       rc   r  zGlobalState.should_declare:  sd    D(((((/Euzz?c%**o55::++*/D  're   c                     |j                         }	 | j                  |   }|S # t        $ rC t        | j                        }| j                  j                  |       || j                  |<   Y |S w xY wrn   )get_filenametable_entryr!  r   r   r6  r   )r^   source_descrc  indexs       rc   lookup_filenamezGlobalState.lookup_filenameH  sv    335	/''.E
 	  	/**+E%%k2).D&		/s   # AA/.A/c                    	 | j                   |   S # t        $ r Y nw xY w|j                  dd      }	 |D cg c]5  }d|j                         j	                  dd      j	                  dd      z   7 nc c}w }}t        |d	      r3|j                          n"# t        |d	      r|j                          w w xY w|s|j                  d
       || j                   |<   |S )Nr   r  )r   error_handlingz * r  z.*[inserted by cython to avoid comment closer]/z/*z-/[inserted by cython to avoid comment start]*closer   )r7  r   	get_linesr   rF  hasattrr  r   )r^   r  source_filer   Fs        rc   commented_file_contentsz#GlobalState.commented_file_contentsR  s    	++K88 		!++W;C , E		$ )*
  $++-//LgK * *A * {G,!!# {G,!!# -!((3-01  -s"    	B :A32B B6c                     |r<|| j                   vr-| j                   j                  |       |j                  |        yyy)a  
        Adds code to the C file. utility_code should
        a) implement __eq__/__hash__ for the purpose of knowing whether the same
           code has already been included
        b) implement put_code, which takes a globalstate instance

        See UtilityCode.
        N)r8  r   rY  )r^   utility_codes     rc   rO  zGlobalState.use_utility_codek  s>     L0B0BB""<0!!$' C<re   c                     |y |j                   r| j                  |j                          |j                  r| j                  |j                         y y rn   )r  rO  utility_code_definitionrb  s     rc   use_entry_utility_codez"GlobalState.use_entry_utility_codex  sI    =!!%"4"45((!!%"?"?@ )re   rn   Fr   NNr  )r   )r   r   )'rz   r{   r|   
directivesrJ  rd   rS  rW  rY  rV  rd  rh  rq  rt  r{  r  r  r(  r  r  rm  rv  r  r  r  r  r7  r  r  r\  r  r  r  r  r  r  r  rO  r  r~   re   rc   r  r  A  s    : JK:!2(9T	'!RG
. 488<?1
.

&&	 .?>*K?ZJ82(Are   r  c                 t    | j                   t        j                        fd}fd}t        ||      S )Nc                 (     | j                         S rn   	funcstate)r^   attribute_ofs    rc   rr   z!funccontext_property.<locals>.get  s    DNN++re   c                 4    t        | j                  |       y rn   )setattrr  )r^   r   r   s     rc   r   z!funccontext_property.<locals>.set  s    e,re   )rz   r   
attrgetterproperty)funcrr   r   r  r   s      @@rc   funccontext_propertyr    s3    ==D&&t,L,-Cre   c                       e Zd ZddZy)CCodeConfigc                 .    || _         || _        || _        y rn   )emit_code_commentsrP  c_line_in_traceback)r^   rP  r  r   s       rc   rd   zCCodeConfig.__init__  s    "4*#6 re   N)TTT)rz   r{   r|   rd   r~   re   rc   r  r    s    
7re   r  c                      e Zd ZdZ ej
                  d       dd       Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zed        Zed        Zed        Zed        Zed        Zed        Zed        Zed        ZddZd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"dd Z#d! Z$d" Z%d# Z&dd$Z'd% Z(d& Z)	 	 dd'Z*d( Z+d) Z,d* Z-dd+Z.dd,Z/dd-Z0d. Z1d/ Z2d0 Z3d1 Z4d2 Z5d3 Z6d4 Z7d5 Z8d6 Z9d7 Z:d8 Z;d9 Z<d: Z=d; Z>d< Z?	 	 dd=Z@d> ZAd? ZBd@ ZCdA ZDeEfdBZFdC ZGdD ZHdE ZIdF ZJdG ZKdH ZLddIZMddJZNdK ZOdL ZPdM ZQdN ZRddOZSdP ZTddQZUddRZVddSZW	 	 ddTZXdU ZYdV ZZdW Z[ddXZ\dY Z]dZ Z^d[ Z_dd\Z`d] Zad^ Zbdd_Zcdd`Zdda ZeddbZfddcZgdddZhde ZiddfZjddgZkddhZlddiZmdj Zndk ZoddlZpddmZqddnZrdo Zsdp Ztdq Zudr Zvds Zwdt ZxdduZydv ZzddwZ{ddxZ|dy Z}ddzZ~dd{Zd| Zdd}Zd~ Zd Zd Zy)CCodeWritera  
    Utility class to output C code.

    When creating an insertion point one must care about the state that is
    kept:
    - formatting state (level, bol) is cloned and used in insertion points
      as well
    - labels, temps, exc_vars: One must construct a scope in which these can
      exist by calling enter_cfunc_scope/exit_cfunc_scope (these are for
      sanity checking and forward compatibility). Created insertion points
      looses this scope and cannot access it.
    - marker: Not copied to insertion point
    - filename_table, filename_list, input_file_contents: All codewriters
      coming from the same root share the same instances simultaneously.
    create_fromNc                    |
t               }|| _        d | _        d | _        g | _        d | _        d | _        d | _        d| _        d| _	        d| _
        || j                  |j                         |j
                  | _        |r3|j                  | _        |j                  | _
        |j                  | _	        |j                  | _        |j                  | _        y y )Nr   r   )r   bufferlast_poslast_marked_pospyclass_stackr  rq  r;  level
call_levelbolrG  )r^   r  r  copy_formattings       rc   rd   zCCodeWriter.__init__  s    >LN6#
"!!+"9"9:(22DN(..
&??"-"8"8'00DM#.#>#>D  #re   c                      t        |||      }|S rn   r  )r^   r  r  r  r  s        rc   
create_newzCCodeWriter.create_new  s     [&/Bre   c                 P    | j                   J || _         |j                  | _        y rn   )rq  r;  )r^   global_states     rc   rG  zCCodeWriter.set_global_state  s'    ''''33re   c                 :    | j                   j                  |       y rn   )r  copyto)r^   r   s     rc   r  zCCodeWriter.copyto  s    1re   c                 6    | j                   j                         S rn   )r  getvaluero   s    rc   r  zCCodeWriter.getvalue  s    {{##%%re   c                     | j                   r| j                   d   nd}| j                  j                  j                  |g|j	                  d      z         | j                  j                  |       y )Nr   r   r   )r  r  markersextendcountry   )r^   r  cython_linenos      rc   ry   zCCodeWriter.write  sW     483G3G,,Q/Q""M?QWWT]#BC!re   c                 ^    | j                  | | j                  j                         d      }|S )NT)r  r  r  )r  r  rK  r  s     rc   rK  zCCodeWriter.insertion_point  s)    D9T9T9Vhlmre   c                     t        |       S )z
        Creates a new CCodeWriter connected to the same global state, which
        can later be inserted using insert.
        r  r  ro   s    rc   
new_writerzCCodeWriter.new_writer  s    
 t,,re   c                     |j                   | j                   u sJ | j                  j                  |j                         y)z
        Inserts the contents of another code writer (created with
        the same global state) in the current location.

        It is ok to write to the inserted writer also after insertion.
        N)rq  r  insert)r^   rV  s     rc   r   zCCodeWriter.insert  s1     !!T%5%5556==)re   c                      y rn   r~   ro   s    rc   ry  zCCodeWriter.label_counter  s    !re   c                      y rn   r~   ro   s    rc   r|  zCCodeWriter.return_label        re   c                      y rn   r~   ro   s    rc   rx  zCCodeWriter.error_label      re   c                      y rn   r~   ro   s    rc   rz  zCCodeWriter.labels_used  r%  re   c                      y rn   r~   ro   s    rc   r~  zCCodeWriter.continue_label  s    "re   c                      y rn   r~   ro   s    rc   r  zCCodeWriter.break_label  r%  re   c                      y rn   r~   ro   s    rc   return_from_error_cleanup_labelz+CCodeWriter.return_from_error_cleanup_label
  s    /3re   c                      y rn   r~   ro   s    rc   r  zCCodeWriter.yield_labels  r#  re   c                 8    | j                   j                  |      S rn   )r  r{  r^   r   s     rc   r{  zCCodeWriter.new_label  s    dnn.F.Ft.L'Lre   c                 6    | j                   j                         S rn   )r  r}  ro   s    rc   r}  zCCodeWriter.new_error_label      dnn.L.L.N'Nre   c                 4     | j                   j                  | S rn   )r  r  )r^   r;  s     rc   r  zCCodeWriter.new_yield_label  s    .Ldnn.L.Ld.S'Sre   c                 6    | j                   j                         S rn   )r  r  ro   s    rc   r  zCCodeWriter.get_loop_labels  r/  re   c                 8    | j                   j                  |      S rn   )r  r  r  s     rc   r  zCCodeWriter.set_loop_labels  s    dnn.L.LV.T'Tre   c                 6    | j                   j                         S rn   )r  r  ro   s    rc   r  zCCodeWriter.new_loop_labels  r/  re   c                 6    | j                   j                         S rn   )r  r  ro   s    rc   r  zCCodeWriter.get_all_labels      dnn.K.K.M'Mre   c                 8    | j                   j                  |      S rn   )r  r  r  s     rc   r  zCCodeWriter.set_all_labels  s    dnn.K.KF.S'Sre   c                 6    | j                   j                         S rn   )r  r  ro   s    rc   r  zCCodeWriter.all_new_labels  r5  re   c                 8    | j                   j                  |      S rn   )r  r  r  s     rc   r  zCCodeWriter.use_label  s    dnn.F.Fs.K'Kre   c                 8    | j                   j                  |      S rn   )r  r  r  s     rc   r  zCCodeWriter.label_used  s    dnn.G.G.L'Lre   c                 (    t        | |      | _        y )N)rw  )rs  r  r  s     rc   rM  zCCodeWriter.enter_cfunc_scope  s    &t59re   c                     d | _         y rn   r  ro   s    rc   r^  zCCodeWriter.exit_cfunc_scope   s	    re   c                 N    | j                   j                  ||      j                  S rn   )rq  rq  r*  )r^   rn  ro  s      rc   
get_py_intzCCodeWriter.get_py_int%  s!    --iBHHHre   c                 N    | j                   j                  ||      j                  S rn   )rq  rt  r*  )r^   rn  r  s      rc   get_py_floatzCCodeWriter.get_py_float(  s!    //	:FLLLre   c                 R    | j                   j                  ||||      j                  S rn   rq  r{  r*  )r^   rW   r   rw  rx  s        rc   r{  zCCodeWriter.get_py_const+  s%    ,,T6=)TZZZre   c                 L    | j                   j                  |      j                  S rn   )rq  r  r*  r  s     rc   r  zCCodeWriter.get_string_const.  s    006<<<re   c                 8    | j                   j                  |      S rn   )rq  r  r  s     rc   r  z#CCodeWriter.get_pyunicode_ptr_const1  s    77==re   c                 R    | j                   j                  ||||      j                  S rn   )rq  r(  r*  )r^   r  r'  r  r  s        rc   r(  zCCodeWriter.get_py_string_const4  s)    33*fm55:U	;re   c                 L    | j                   j                  |      j                  S rn   rA  )r^   rW   s     rc   get_argument_default_constz&CCodeWriter.get_argument_default_const9  s    ,,T2888re   c                 $    | j                  |      S rn   r  r  s     rc   r  zCCodeWriter.intern<  s    ''--re   c                 (    | j                  |d      S r  r  r  s     rc   intern_identifierzCCodeWriter.intern_identifier?  r  re   c                 8    | j                   j                  |      S rn   )rq  rh  rf  s     rc   rh  z'CCodeWriter.get_cached_constants_writerB  s    ;;FCCre   c                    | j                   r| j                  r| j                          | j                  j                  rB| j
                  r6| j
                  \  }}}| j                  d|d|j                         d       |r%|r| j                  |       n| j                  |       | j                  d       d| _        y )Nz
#line z "z"
r   r   )
r  r  emit_markerr;  rP  r  ry   get_escaped_descriptionput_saferQ  )r^   rw   safer  r   r?   s         rc   rv   zCCodeWriter.putlnG  s    ==TXX))d.B.B#'#7#7 KqJJdK4W4W4YZ[d#

4re   c                 `    |y | j                   r| j                   d d |d d k(  ry ||f| _        y )Nr   )r  r  r^   r  traces      rc   mark_poszCCodeWriter.mark_posU  s;    ;D$8$8!$<BQ$Gere   c                    | j                   \  }}|| _        d | _         | j                  d       | j                  j                  r3| j                          | j                  d| j                  |      z         |r| j                  r| j                  j                  ri| j                  j                  d   rO| j                          | j                  d|d   | j                  j                   | j                  |      fz         y y y y y )Nr   z	/* %s */
	linetracez__Pyx_TraceLine(%d,%d,%s)
r   )r  r  ry   r;  r  indent_build_markerr  r  rq  r  r  r  rQ  s      rc   rL  zCCodeWriter.emit_marker\  s    ]]
U"

4..KKMJJ|d&8&8&==>T^^(@(@TEUEUE`E`alEmKKMJJ4ADNN444dooc6J8L L M Fn(@^5re   c                    |\  }}}t        |t              sJ | j                  j                  |      }|t	        d|dz
        | }|dxx   dz  cc<   ||||dz    z  }d|j                         |dj                  |      fz  S )Nr   r5  rS   z             # <<<<<<<<<<<<<<r   z"%s":%d
%s
r   )r  r   rq  r  maxrM  r   )r^   r  r  r   colcontentsr   s          rc   rW  zCCodeWriter._build_markeri  s    !$T3+'788##;;KHQQ-b	55	$tAv&&;#F#F#H$PUPZPZ[`Pa"bbbre   c                 4    | j                  |       d| _        y Nr   )ry   r  r^   rw   s     rc   rN  zCCodeWriter.put_safer  s    

4re   c                 P   | j                   j                  }|rt        |      dkD  r|dt        j                  |j                  d            j                         d}t        j                  j                  ||      }t        j                  j                  |      sg|dt        j                         }t        t        j                  |            5 }|j                  |       d d d        t!        j"                  ||       d|z  }| j%                  |       y # 1 sw Y   6xY w)Ni   r?   r  z.hz.tmpz#include "%s"
)rq  r<  r   hashlibmd5r   	hexdigestr   r   r   existsgetpidr   r   open_new_filery   shutilmoverQ  )r^   rw   r   include_dirinclude_filer   tmp_pathr   s           rc   rP  zCCodeWriter.put_or_includew  s    &&AA3t9t+gkk$++f"56@@BDL77<<\:D77>>$')-ryy{;U00:; "qGGDM"Hd+$t+D	" "s   DD%c                    d}d|v r|j                  d      }nd}d|v rS||j                  d      z  }|dk  r| xj                  |z  c_        n$|dk(  r|d   dk(  rd}| xj                  dz  c_        | j                  r| j                          | j	                  |       d| _        |dkD  r| xj                  |z  c_        y |r| xj                  dz  c_        y y )NF{r   r[  Tr   )r  r
  r  rV  ry   )r^   rw   
fix_indentdls       rc   rQ  zCCodeWriter.put  s    
$;CBB$;$**S/!BAv

b 
qT!W^!


a
88KKM

46JJ"JJJ!OJ re   c                 @    ddl m} | j                   ||fi |       y Nr   r^  )r_  r   rv   r^   rw   r  r   s       rc   putln_tempitazCCodeWriter.putln_tempita  s    !

3t'w'(re   c                 @    ddl m} | j                   ||fi |       y rp  )r_  r   rQ  rq  s       rc   put_tempitazCCodeWriter.put_tempita  s    !T%W%&re   c                 .    | xj                   dz  c_         y Nr   r
  ro   s    rc   increase_indentzCCodeWriter.increase_indent      

a
re   c                 .    | xj                   dz  c_         y rv  rw  ro   s    rc   decrease_indentzCCodeWriter.decrease_indent  ry  re   c                 F    | j                  d       | j                          y )Nrl  )rv   rx  ro   s    rc   begin_blockzCCodeWriter.begin_block  s    

3re   c                 F    | j                          | j                  d       y )Nr[  )r{  rv   ro   s    rc   	end_blockzCCodeWriter.end_block  s    

3re   c                 @    | j                  d| j                  z         y )Nz  )ry   r
  ro   s    rc   rV  zCCodeWriter.indent  s    

4$**$%re   c                 *    dt        |      dz   d d z  S )Nz0x%02X%02X%02X%02X)r   r   r   r   r  )r  )r^   	pyversions     rc   get_py_version_hexzCCodeWriter.get_py_version_hex  s    #uY'7)'CRa&HHHre   c                 ^    || j                   j                  v r| j                  d|z         y y )Nz%s:;)r  rz  rv   r  s     rc   r]  zCCodeWriter.put_label  s)    $..,,,JJv|$ -re   c                 b    | j                   j                  |       | j                  d|z         y )Ngoto %s;)r  r  rv   r  s     rc   put_gotozCCodeWriter.put_goto  s%      %

:#$re   c                 B   |j                   dk(  r|s|j                  sy |j                   dk(  r|j                  sy |r| j                  d|z         |j                  s| j                  d       | j                  |j
                  j                  |j                  |             |j                  8| j                  d|j
                  j                  |j                        z         n'|j
                  j                  r| j                  d       | j                  d       y )Nprivate%s CYTHON_UNUSED )dll_linkagez = %sz = NULLr  )
visibilitydefined_in_pxdr  rQ  cf_usedrW   r  r*  r  rN  literal_coder  rv   )r^   rc  storage_classr  
definitions        rc   put_var_declarationzCCodeWriter.put_var_declaration  s     y(*@T@Ty(HHU]*+}}HH%&,,KK[ - 2 	3::!MM'EJJ$;$;EJJ$GGHZZ##HHY

3re   c                 f   |j                   D ]  \  }}}}|j                  |      }|j                  r| j                  d|z         :|j                  r(ddlm} | j                  |d|j                  d       n| j                  |xr dxs d|d        |j                  r| j                  j                  rd}nd}| j                  |d	t        j                  d
       | j                  |dt        j                  d       | j                  |d	t        j                  d
       y y )Nz
%s = NULL;r   
MemoryViewr  r  zstatic r   r  zint  = 0;zconst char *z = NULL;)r  r  r  rv   r  r   r  memslice_entry_initr  r  r  r	   lineno_cnamefilename_cnameclineno_cname)	r^   func_contextr   rW   r  r  r  r  unuseds	            rc   put_temp_declarationsz!CCodeWriter.put_temp_declarations  s    .:.J.J 	I*D$
F((.D

<$./(((

z/M/MNO

f&:&@b&@$GH	I 66~~22)JJ&&2E2EFGJJVV=R=RSTJJ&&2F2FGH 7re   c                 j    | j                  dt        j                  z         | j                  d       y )Nz/* Generated by Cython %s */r   )rv   r   	watermarkro   s    rc   put_generated_byzCCodeWriter.put_generated_by  s%    

1G4E4EEF

2re   c                 T    | j                  d|z         | j                  d|z         y )Nz
#ifndef %sz
#define %srv   )r^   guards     rc   put_h_guardzCCodeWriter.put_h_guard  s$    

<%'(

<%'(re   c                 0    t         j                  rd|z  S |S )Nzunlikely(%s))r
   gcc_branch_hintsr^   conds     rc   unlikelyzCCodeWriter.unlikely  s    ##!D((Kre   c           
      d    |syddj                  |D cg c]  } |||       c}      z  S c c}w )Nr   r   )r   )r^   	modifiersmapperr   s       rc   build_function_modifiersz$CCodeWriter.build_function_modifiers  s0    sxxi @! @AAA @s   -
c                     |j                   }|j                  s|j                   j                         r|j                   j                  rd|j                  z   S |j                  S )Nz(PyObject *))rW   is_self_argis_completeis_extension_typer*  )r^   rc  rW   s      rc   entry_as_pyobjectzCCodeWriter.entry_as_pyobject  sI    zz!!%***@*@*Bzz++!EKK//;;re   c                 &    ddl m}m}  ||||      S )Nr   py_object_typetypecast)r  r  r  )r^   r*  rW   r  r  s        rc   as_pyobjectzCCodeWriter.as_pyobject  s    8e44re   c                 ,    | j                  d|z         y Nz__Pyx_GOTREF(%s);r  r^   r*  s     rc   
put_gotrefzCCodeWriter.put_gotref  s    

&./re   c                 ,    | j                  d|z         y Nz__Pyx_GIVEREF(%s);r  r  s     rc   put_giverefzCCodeWriter.put_giveref      

'%/0re   c                 ,    | j                  d|z         y Nz__Pyx_XGIVEREF(%s);r  r  s     rc   put_xgiverefzCCodeWriter.put_xgiveref  s    

(501re   c                 ,    | j                  d|z         y Nz__Pyx_XGOTREF(%s);r  r  s     rc   put_xgotrefzCCodeWriter.put_xgotref  r  re   c                     |r%| j                  d| j                  ||      z         y | j                  d| j                  ||      z         y Nz__Pyx_INCREF(%s);zPy_INCREF(%s);)rv   r  r^   r*  rW   nannys       rc   
put_increfzCCodeWriter.put_incref  sC    JJ*T-=-=eT-JJKJJ'$*:*:5$*GGHre   c                 0    | j                  |||dd       y )NF)
null_checkr   _put_decrefr  s       rc   
put_decrefzCCodeWriter.put_decref  s    eUKre   c                 x    |j                   j                  r$| j                  d| j                  |      z         y y r  rW   r  rv   r  rb  s     rc   put_var_gotrefzCCodeWriter.put_var_gotref   s1    ::!!JJ*T-C-CE-JJK "re   c                 x    |j                   j                  r$| j                  d| j                  |      z         y y r  r  rb  s     rc   put_var_giverefzCCodeWriter.put_var_giveref$  1    ::!!JJ+d.D.DU.KKL "re   c                 x    |j                   j                  r$| j                  d| j                  |      z         y y r  r  rb  s     rc   put_var_xgotrefzCCodeWriter.put_var_xgotref(  r  re   c                 x    |j                   j                  r$| j                  d| j                  |      z         y y r  r  rb  s     rc   put_var_xgiverefzCCodeWriter.put_var_xgiveref,  s1    ::!!JJ,t/E/Ee/LLM "re   c                     |j                   j                  rJ|r$| j                  d| j                  |      z         y | j                  d| j                  |      z         y y r  r  r^   rc  r  s      rc   put_var_increfzCCodeWriter.put_var_incref0  sQ    ::!!

.1G1G1NNO

+d.D.DU.KKL	 "re   c                 x    |j                   j                  r$| j                  d| j                  |      z         y y )Nz__Pyx_XINCREF(%s);r  rb  s     rc   put_var_xincrefzCCodeWriter.put_var_xincref7  r  re   c                 2    | j                  |||dd|       y )NFTr  r   clear_before_decrefr  r^   r*  rW   r  r  s        rc   put_decref_clearzCCodeWriter.put_decref_clear;  s$    e#9L 	 	Nre   c                 2    | j                  |||d|d       y )NTF)r  have_gilr   r  )r^   r*  rW   r  r  s        rc   put_xdecrefzCCodeWriter.put_xdecref?  s"    e"*% 	 	9re   c                 2    | j                  |||dd|       y )NTr  r  r  s        rc   put_xdecref_clearzCCodeWriter.put_xdecref_clearC  s$    e#9L 	 	Nre   c           
      R   |j                   r| j                  ||       y |rdnd}|rdnd}	|rO|r|sd}	| j                  |d|	d|d       y | j                  |d|	d	| j                  ||      d
|d       y | j                  |d|	d	| j                  ||      d       y )N)r  __PyxPyXr   r?   CLEAR();DECREF(); r  )r  put_xdecref_memoryviewslicerv   r  )
r^   r*  rW   r  r  r  r   r  r   r  s
             rc   r  zCCodeWriter._put_decrefG  s    "",,UX,F!tC2"A

5AB

At//t<eE F JJ4++E48: ;re   c                 4    | j                  d|d|d       y )Nz__Pyx_DECREF_SET(r  r  r  r^   r*  	rhs_cnames      rc   put_decref_setzCCodeWriter.put_decref_set\  s    

%CDre   c                 4    | j                  d|d|d       y )Nz__Pyx_XDECREF_SET(r  r  r  r  s      rc   put_xdecref_setzCCodeWriter.put_xdecref_set_  s    

5)DEre   c                 x    |j                   j                  r$| j                  d| j                  |      z         y y )N__Pyx_XDECREF(%s);r  rb  s     rc   put_var_decrefzCCodeWriter.put_var_decrefb  r  re   c                     |j                   j                  rJ|r$| j                  d| j                  |      z         y | j                  d| j                  |      z         y y )Nr  zPy_XDECREF(%s);r  r  s      rc   put_var_xdecrefzCCodeWriter.put_var_xdecreff  sQ    ::!!

/$2H2H2OOP

,t/E/Ee/LLM	 "re   c                 *    | j                  |d       y )NFr  _put_var_decref_clearrb  s     rc   put_var_decref_clearz CCodeWriter.put_var_decref_clearm  s    ""5U";re   c                 *    | j                  |d       y )NTr   r  rb  s     rc   put_var_xdecref_clearz!CCodeWriter.put_var_xdecref_clearp  s    ""5T":re   c           	         |j                   j                  rt|j                  r+| j                  d|xr dxs dd|j                  d       y | j                  d|xr dxs dd| j                  |      d|j                  d       y y )	Nr  r  r   r  r  r  r  r  )rW   r  
in_closurerv   r*  r  )r^   rc  r  s      rc   r  z!CCodeWriter._put_var_decref_clears  s    ::!! 

&3,",KK! " 

&3,",**51KK! " "re   c                     |D ]@  }|r|j                   s|j                  r| j                  |       0| j                  |       B y rn   )r  xdecref_cleanupr  r  )r^   entries	used_onlyrc  s       rc   put_var_decrefszCCodeWriter.put_var_decrefs  s?     	/E

((((/''.	/re   c                 4    |D ]  }| j                  |        y rn   )r  r^   r
  rc  s      rc   put_var_xdecrefszCCodeWriter.put_var_xdecrefs  s     	(E  '	(re   c                 4    |D ]  }| j                  |        y rn   )r  r  s      rc   put_var_xdecrefs_clearz"CCodeWriter.put_var_xdecrefs_clear  s     	.E&&u-	.re   c                     ddl m} | j                  j                  |j                         | j                  d|t        |      fz         y )Nr   r  z__PYX_INC_MEMVIEW(&%s, %d);r   r  rq  rO  memviewslice_init_coderv   rk  r^   slice_cnamer  r  s       rc   put_incref_memoryviewslicez&CCodeWriter.put_incref_memoryviewslice  s:     ))**K*KL

0KX3OOPre   c                     ddl m} | j                  j                  |j                         | j                  d|t        |      fz         y )Nr   r  z__PYX_XDEC_MEMVIEW(&%s, %d);r  r  s       rc   r  z'CCodeWriter.put_xdecref_memoryviewslice  s:     ))**K*KL

1[#h-4PPQre   c                 ,    | j                  d|z         y )Nz
%s.memview)r  )r^   r  s     rc   put_xgiveref_memoryviewslicez(CCodeWriter.put_xgiveref_memoryviewslice  s    ,45re   c                     ddl m}m}  |||d      }|r| j                  |d|d       y | j                  |d|d       y )Nr   r  Py_Noner  z; __Pyx_INCREF(Py_None);z; Py_INCREF(Py_None);)r  r  r  rv   )r^   r*  rW   r  r  r  py_nones          rc   put_init_to_py_nonezCCodeWriter.put_init_to_py_none  s8    84;JJE7KLJJHIre   c                     ||j                   z  }| j                  ||j                  |       |j                  r| j	                  d       y y )Nr  )r*  r  rW   r  r  )r^   rc  templater  rw   s        rc   put_init_var_to_py_nonez#CCodeWriter.put_init_var_to_py_none  sD    %++% 	  uzz59Y' re   c                    |j                   s|j                  dk(  r>|j                  t        vr,|j                  dk(  r| j                  j                  d   sn|ry |j
                  j                         }|sy ddlm} |j                   s|j                  |j                        r||j                  gz  }|r|j                  |      n|j                  }d|v rdnd}d	|v r|d
z  }|dk7  rd|d|}| j                  d|j                  d|ddj                  |      d|j                  r|j                   ndd|
       y )N__getattribute____getattr__fast_getattrr   )	TypeSlotsMETH_FASTCALL__Pyx_PyCFunctionFastPyCFunctionMETH_KEYWORDSWithKeywordsz(void*)(r  z{"z", (PyCFunction)r  |r  r[  )
is_specialr   special_py_methodsrq  r  	signaturemethod_flagsr   r&  is_reverse_number_slotmethod_coexistput_pymethoddef_wrapper
func_cnamerv   r   doc	doc_cname)	r^   rc  term
allow_skipwrapper_code_writerr0  r&  func_ptrcasts	            rc   put_pymethoddefzCCodeWriter.put_pymethoddef  s"   uzz-??zz!33::.t7G7G7R7RSa7b  335y??

KY5566LI\&>>uEbgbrbr*9\*I&}l*N"D= *.9H



&#(99#5	re   c                     |j                   }|j                  rU|j                  j                         }|r9d|v r5t        j
                  |z   }| j                  d|d|j                   d       |S )NMETH_NOARGSzstatic PyObject *z6(PyObject *self, CYTHON_UNUSED PyObject *arg) {return z(self);})r4  r-  r/  r0  r	   method_wrapper_prefixrv   )r^   rc  r4  r0  s       rc   r3  z#CCodeWriter.put_pymethoddef_wrapper  sd    %%
 ??779L =#99JF


 0 02 3re   c                    | j                   j                  t        j                  dd             | j                   j                  d   r0| j                   j                  t        j                  dd             n/| j                   j                  t        j                  dd             | j                  d       |sd}|r| j                  d       | j                  d	|z         | j                  d
       y)a  
        Acquire the GIL. The generated code is safe even when no PyThreadState
        has been allocated for this thread (for threads not initialized by
        using the Python API). Additionally, the code generated by this method
        may be called recursively.
        ForceInitThreadsModuleSetupCode.cfast_gilFastGil	NoFastGil#ifdef WITH_THREAD__pyx_gilstate_savezPyGILState_STATE z%s = __Pyx_PyGILState_Ensure();r  N)rq  rO  r   r   r  rv   rQ  )r^   declare_gilstatevariables      rc   put_ensure_gilzCCodeWriter.put_ensure_gil  s     	))##$68KL	N&&z2



+
+K,C,CIOb,c
d



+
+K,C,CKQd,e
f

'(,H,-

4x?@

8re   c                 h   | j                   j                  d   r0| j                   j                  t        j	                  dd             n/| j                   j                  t        j	                  dd             |sd}| j                  d       | j                  d|z         | j                  d       y	)
zD
        Releases the GIL, corresponds to `put_ensure_gil`.
        rC  rD  rB  rE  rG  rF  z__Pyx_PyGILState_Release(%s);r  Nrq  r  rO  r   r   rv   r^   rI  s     rc   put_release_ensured_gilz#CCodeWriter.put_release_ensured_gil  s     &&z2



+
+K,C,CIOb,c
d



+
+K,C,CKQd,e
f,H

'(

2X=>

8re   c                    | j                   j                  d   r0| j                   j                  t        j	                  dd             n/| j                   j                  t        j	                  dd             | j                  d       | j                  d       |r| j                  d|z         | j                  d       | j                  d	       y
)z
        Acquire the GIL. The thread's thread state must have been initialized
        by a previous `put_release_gil`
        rC  rD  rB  rE  rF  z__Pyx_FastGIL_Forget();z_save = %s;Py_BLOCK_THREADSr  NrL  rM  s     rc   put_acquire_gilzCCodeWriter.put_acquire_gil  s    
 &&z2



+
+K,C,CIOb,c
d



+
+K,C,CKQd,e
f

'(

,-JJ}x/0

%&

8re   c                    | j                   j                  d   r0| j                   j                  t        j	                  dd             n/| j                   j                  t        j	                  dd             | j                  d       | j                  d       | j                  d       |r| j                  d|z         | j                  d	       | j                  d
       y)z2Release the GIL, corresponds to `put_acquire_gil`.rC  rD  rB  rE  rF  zPyThreadState *_save;Py_UNBLOCK_THREADSz%s = _save;z__Pyx_FastGIL_Remember();r  NrL  rM  s     rc   put_release_gilzCCodeWriter.put_release_gil	  s    &&z2



+
+K,C,CIOb,c
d



+
+K,C,CKQd,e
f

'(

*+

'(JJ}x/0

./

8re   c                 j    | j                  d       | j                  d       | j                  d       y )NrF  z%PyGILState_STATE __pyx_gilstate_save;r  r  ro   s    rc   rH  zCCodeWriter.declare_gilstate	  s(    

'(

:;

8re   c                 N    | j                  d|d| j                  |            S )Nif (z < 0) )rv   r  )r^   r  r   s      rc   put_error_if_negzCCodeWriter.put_error_if_neg#	  s!     zzeT__S5IJKKre   c                    ddl m} |j                  r(d}| j                  j	                  |j
                         ng|j                  j                  r*|r(d}| j                  j	                  |j                         n'd}| j                  j	                  |j                         | j                  d|j                  j                  |j                        d|d|j                  d	| j                  |      d
	       y )Nr   )	ExprNodes__Pyx_RaiseClosureNameError&__Pyx_RaiseUnboundMemoryviewSliceNogil__Pyx_RaiseUnboundLocalErrorzif (unlikely(!z)) { z("z"); z })r   rZ  from_closurerq  rO  %raise_closure_name_error_utility_coderW   r  +raise_unbound_memoryview_utility_code_nogil&raise_unbound_local_error_utility_coderv   check_for_null_coder*  r   r  )r^   r  rc  in_nogil_contextrZ  r  s         rc   put_error_if_unboundz CCodeWriter.put_error_if_unbound(	  s    0D--??AZZ**/?;D--EEG 2D--@@B 	

 %

 > >u{{ K $ %

 $ 4	6 	7re   c                     d| j                   _        |rd| j                   _        d| j                  |d         d|d   dS )NTz__PYX_MARK_ERR_POS(r   r  r   r  )r  r  r  r  )r^   r  r  s      rc   set_error_infozCCodeWriter.set_error_info=	  sA    8<526DNN/  Q(F 	re   c                     | j                   j                  }| j                   j                  |       |d|z  S d| j                   _        |rd| j                   _        d| j                  |d         d|d   d|dS )Nr  Tz
__PYX_ERR(r   r  r   r  )r  rx  r  r  r  r  )r^   r  r  r  s       rc   r  zCCodeWriter.error_gotoE	  su    nn((  %;##8<526DNN/  Q(F 	re   c                 N    d| j                  |      d| j                  |      S )NrW  r  )r  r  )r^   r  r  s      rc   error_goto_ifzCCodeWriter.error_goto_ifR	  s    #}}T2DOOC4HIIre   c                 ,    | j                  d|z  |      S )Nz!%sri  r^   r*  r  s      rc   r  zCCodeWriter.error_goto_if_nullU	  s    !!%%-55re   c                 ,    | j                  d|z  |      S )Nz%s < 0rk  rl  s      rc   error_goto_if_negzCCodeWriter.error_goto_if_negX	  s    !!(U"2C88re   c                 &    | j                  d|      S )NzPyErr_Occurred()rk  )r^   r  s     rc   rS  zCCodeWriter.error_goto_if_PyErr[	  s    !!"4c::re   c                 8    | j                   j                  |      S rn   )rq  r  )r^   r   s     rc   r  zCCodeWriter.lookup_filename^	  s    //99re   c                 &    | j                  d       y )N__Pyx_RefNannyDeclarationsr  ro   s    rc   rN  z(CCodeWriter.put_declare_refcount_contexta	  s    

/0re   c                     |r/| j                   j                  t        j                  dd             | j	                  d||xr dxs dfz         y )NrA  rB  z%__Pyx_RefNannySetupContext("%s", %d);r   r   )rq  rO  r   r   rv   )r^   r   acquire_gils      rc   rO  z&CCodeWriter.put_setup_refcount_contextd	  sO    --''(:<OPR

:dKDUTUDZYZ=[[\re   c                 &    | j                  d       y )Nz__Pyx_RefNannyFinishContext();r  ro   s    rc   r_  z'CCodeWriter.put_finish_refcount_contextj	  s    

34re   c                     ||rt         j                  ndt         j                  t         j                  f}d| j                  _        | j                  d|z         y)z
        Build a Python traceback for propagating exceptions.

        qualified_name should be the qualified name of the function.
        r   Tz%__Pyx_AddTraceback("%s", %s, %s, %s);N)r	   r  r  r  r  r  rv   )r^   qualified_nameinclude_clineformat_tuples       rc   put_add_tracebackzCCodeWriter.put_add_tracebackm	  sM     $1F  q!!	
 /3+

:\IJre   c                 >   |t         j                  t         j                  t         j                  | j                  j
                  d   |f}d| j                  _        | j                  d|z         | j                  j                  t        j                  dd             y)z
        Generate code to print a Python warning for an unraisable exception.

        qualified_name should be the qualified name of the function.
        unraisable_tracebacksTz0__Pyx_WriteUnraisable("%s", %s, %s, %s, %d, %d);WriteUnraisableExceptionzExceptions.cN)r	   r  r  r  rq  r  r  r  rv   rO  r   r   )r^   rw  nogilry  s       rc   put_unraisablezCCodeWriter.put_unraisable|	  s       !!''(?@
 /3+

ETU))##$>O	Qre   c                 &    | j                  d       y )N__Pyx_TraceDeclarationsr  ro   s    rc   put_trace_declarationsz"CCodeWriter.put_trace_declarations	      

,-re   c                 2    |r| j                  d|z         y y )Nz__Pyx_TraceFrameInit(%s)r  )r^   codeobjs     rc   put_trace_frame_initz CCodeWriter.put_trace_frame_init	  s    JJ1G;< re   c                     | j                  d|t        j                  | j                  |d         |d   || j	                  |      fz         y )Nz*__Pyx_TraceCall("%s", %s[%s], %s, %d, %s);r   r   )rv   r	   filetable_cnamer  r  )r^   r   r  r~  s       rc   put_trace_callzCCodeWriter.put_trace_call	  sS    

?&(($*>*>s1v*FAPUW[WfWfgjWkCm m 	nre   c                 &    | j                  d       y )Nz__Pyx_TraceException();r  ro   s    rc   put_trace_exceptionzCCodeWriter.put_trace_exception	  r  re   c                 0    | j                  d||fz         y )Nz__Pyx_TraceReturn(%s, %d);r  )r^   retvalue_cnamer~  s      rc   put_trace_returnzCCodeWriter.put_trace_return	  s    

/>52IIJre   c                 j    | j                  d       | j                  |       | j                  d       y )Nz#ifdef _OPENMPz#endif /* _OPENMP */r  )r^   strings     rc   putln_openmpzCCodeWriter.putln_openmp	  s(    

#$

6

)*re   c                     | j                  d|z         | j                  d       | j                  d       | j                  d       | j                  d       | j                  d       y)zl
        Redefine the macros likely() and unlikely to no-ops, depending on
        condition 'cond'
        r      #undef likely    #undef unlikelyz    #define likely(x)   (x)z    #define unlikely(x) (x)r  Nr  r  s     rc   undef_builtin_expectz CCodeWriter.undef_builtin_expect	  sT    
 	

8d?#

&'

()

01

01

8re   c                     | j                  d|z         | j                  d       | j                  d       | j                  d       | j                  d       | j                  d       y )Nr  r  r  z2    #define likely(x)   __builtin_expect(!!(x), 1)z2    #define unlikely(x) __builtin_expect(!!(x), 0)r  r  r  s     rc   redef_builtin_expectz CCodeWriter.redef_builtin_expect	  sR    

8d?#

&'

()

GH

GH

8re   )NNFrn   r  r  )r   F)T)r   NT)TF)TT)TFTFF)r   r  )z%sT)TN)rz   r{   r|   r}   cythonlocalsrd   r  rG  r  r  ry   rK  r  r   r  ry  r|  rx  rz  r~  r  r*  r  r{  r}  r  r  r  r  r  r  r  r  r  rM  r^  r=  r?  r{  r  r  r(  rF  r  rI  rh  rv   rS  rL  rW  rN  rP  rQ  rr  rt  rx  r{  r}  r  rV  r  r]  r  r  r  r  r  r  modifier_output_mapperr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r<  r3  rJ  rN  rQ  rT  rH  rX  rd  rf  r  ri  r  rn  rS  r  rN  rO  r_  rz  r  r  r  r  r  r  r  r  r  r~   re   rc   r  r    s
   < V]]}-? .?44
&-* ! !     " " 3 3    MNSNTNMSMKL:
IM[=> 488<;
9.?D
%Mc
.)'&I%% 8:9=*I*) :P B50121ILLMMNMMN9N ?DDI;*EFMN<;"/(.Q
R
6J(@	* L
7*J69;:1]5KQ&.=n.K+

re   r  c                   $    e Zd Zd Zd Zd Zd Zy)PyrexCodeWriterc                 F    t        j                  |      | _        d| _        y r]  )r   re  r   r
  )r^   outfile_names     rc   rd   zPyrexCodeWriter.__init__	  s    $$\2
re   c                 ^    | j                   j                  d| j                  z  |d       y )Nr  r   )r   ry   r
  r^  s     rc   rv   zPyrexCodeWriter.putln	  s     tzz!1489re   c                 .    | xj                   dz  c_         y rv  rw  ro   s    rc   rV  zPyrexCodeWriter.indent	  ry  re   c                 .    | xj                   dz  c_         y rv  rw  ro   s    rc   dedentzPyrexCodeWriter.dedent	  ry  re   N)rz   r{   r|   rd   rv   rV  r  r~   re   rc   r  r  	  s    :re   r  c                   V    e Zd ZdZddZddZddZd Zd ZddZ	d	 Z
dd
Zd Zd Zy)PyxCodeWriterz
    Can be used for writing out some Cython code. To use the indenter
    functionality, the Cython.Compiler.Importer module will have to be used
    to load the code to support python 2.4
    Nc                 T    |xs
 t               | _        || _        || _        || _        y rn   )r   r  r
  r  r   )r^   r  indent_levelr  r   s        rc   rd   zPyxCodeWriter.__init__	  s%    .!
 re   c                 .    | xj                   |z  c_         y)NTrw  r^   levelss     rc   rV  zPyxCodeWriter.indent	  s    

f
re   c                 .    | xj                   |z  c_         y rn   rw  r  s     rc   r  zPyxCodeWriter.dedent	  s    

f
re   c                 F    | j                  |       | j                          y)a  
        Instead of

            with pyx_code.indenter("for i in range(10):"):
                pyx_code.putln("print i")

        write

            if pyx_code.indenter("for i in range(10);"):
                pyx_code.putln("print i")
                pyx_code.dedent()
        T)rv   rV  r^   r   s     rc   indenterzPyxCodeWriter.indenter	  s     	

4re   c                     | j                   j                         }t        |t              r|j	                  | j
                        }|S rn   )r  r  r  r   r  r   )r^   r  s     rc   r  zPyxCodeWriter.getvalue	  s5    %%'fe$]]4==1Fre   c                 b    |xs | j                   }|rt        ||      }| j                  |       y rn   )r  r`  _putln)r^   r   r  s      rc   rv   zPyxCodeWriter.putln	  s+    )T\\tW-DDre   c                 ^    | j                   j                  | j                  dz  |d       y )Nz    r   )r  ry   r
  r  s     rc   r  zPyxCodeWriter._putln	  s"    djj6&94@Are   c                     |xs | j                   }|rt        ||      }t        j                  |      }|j	                         D ]  }| j                  |        y rn   )r  r`  r   r  rG  r  )r^   chunkr  r   s       rc   	put_chunkzPyxCodeWriter.put_chunk	  sQ    )T\\w/E&$$& 	DKK	re   c                 t    t        | j                  j                         | j                  | j                        S rn   )r  r  rK  r
  r  ro   s    rc   rK  zPyxCodeWriter.insertion_point
  s+    T[[88:DJJ!\\+ 	+re   c                 :    t        | || j                                y rn   )r  rK  r-  s     rc   named_insertion_pointz#PyxCodeWriter.named_insertion_point
  s    dD0023re   )Nr   Nr<   )r   rn   )rz   r{   r|   r}   rd   rV  r  r  r  rv   r  r  rK  r  r~   re   rc   r  r  	  s:    !"B+4re   r  c                       e Zd Zd Zd Zd Zy)r  c                 <    || _         i | _        i | _        d| _        y r]  )klassr  r  temps_count)r^   r  s     rc   rd   zClosureTempAllocator.__init__
  s     
!re   c                 x    | j                   j                         D ]  \  }}t        |      | j                  |<    y rn   )r  r   r   r  )r^   rW   r  s      rc   resetzClosureTempAllocator.reset
  s6     00668 	1LD&$(LDOOD!	1re   c                    || j                   vrg | j                   |<   g | j                  |<   n-| j                  |   r| j                  |   j                  d      S dt        j                  | j
                  fz  }| j                  j                  d |||d       | j                   |   j                  |       | xj
                  dz  c_        |S )Nr   r  T)r  r   r*  rW   is_cdefr   )	r  r  r  r	   r  r  r  declare_varr   )r^   rW   r*  s      rc   r  z"ClosureTempAllocator.allocate_temp
  s    t+++)+D  &$&DOOD!__T"??4(,,Q//&779I9IJJ

4e5tUYZT"))%0Are   N)rz   r{   r|   rd   r  r  r~   re   rc   r  r  
  s    1
re   r  r~   )NN)L
__future__r   r  declareobjectr   r   rf  sysr   r   r  r   	functoolsr   
contextlibr   collectionsr   r`  ImportErrorra  r   r	   r
   r   r   r   r   Scanningr   r   __builtin__r   builtinsr   version_infor   r  ctypedef_builtins_mapbasicsize_builtins_mapuncachable_builtinsr   r.  rr   r  rP   r   r   r   r`  rb  rl  rs  r  r  r   r  Ur   r  r   r  r   r  findallr  r  r  r  r  r  r  r  r  r  r~   re   rc   <module>r     s   '   /& /V /f /v //'-/7=/NT//.4/CI/ !/ .4/ BH/ 	/ (.	/ 
 	  
      #       & '+& ))F2 
 76688  ))*1  & 
% N     o# 
I'& I'X/mf m`u8/ u8p= =>.o . B9F B9J.v . F  6V"(A(bjj):)A)A')JBDDQWW &BJJ'7'>'>w'GHNN RZZ 1266 ,-55M& M^(F (.}A& }A@7& 7a& aHf "B4F B4J6 gO    +**+s$   <I 1I/ 	I,+I,/I>=I>