
V]c        !   @@  s  d  d l  m Z d  d l Z e j 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 y d  d l Z Wn e k
 r=d  d l Z n Xd 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 y d  d! l  m! Z! Wn! e k
 rd  d" l" m# Z! n Xe j$ d d# f k  Z% i d$ d% f d& 6d' d% f d( 6d' d% f d 6d' d) f d* 6d' d+ f d, 6Z& i d- d. 6d/ d0 6d1 d2 6d3 d4 6Z' i d5 d6 6Z( d7 d8 d9 d: d; d< d= d> d? d@ dA dB dC dD dE dF dG dH dI dJ dK dL dM dN dO dP g Z) e* dQ dR dS dT dU dV dW dX dY dZ d[ d\ d] g  Z+ i d^ d_ 6j, Z- d` e f da     YZ. db   Z/ dc e f dd     YZ0 de e0 f df     YZ1 e2 e2 dg  Z3 dh e1 f di     YZ4 dj e0 f dk     YZ5 dl e f dm     YZ6 dn e f do     YZ7 dp e f dq     YZ8 e j dr e ds e dt e du e  e j9 dv j: dM  e j;  j< Z= e j9 dv j> dw   j< Z? e j9 dx  j@ ZA e j9 dy  jB ZC dz e f d{     YZD d| e f d}     YZE d~ e f d     YZF d   ZG d e f d     YZH d e f d     YZI d e f d     YZJ d e f d     YZK d e f d     YZL d S(   i    (   t   absolute_importNt   ost   ret   operatort   textwrapt   Templatet   Namingt   Optionst   StringEncodingt   Utilst   SourceDescriptort   StringIOTreet
   DebugFlagst
   basestringt   defaultdictt   closingt   partial(   R   (   R   (   R   (   R   i   (   R   (   R   (   R   (   R   (   t   Versioni   (   R	   (   R
   (   R   (   R   (   t   stri   s   PY_MAJOR_VERSION < 3R   t   bytess   PY_MAJOR_VERSION >= 3t   unicodet   ranget   xranget   inputt	   raw_inputs   &PyInt_Typet   py_ints   &PyLong_Typet   py_longs   &PyFloat_Typet   py_floats   &PyWrapperDescr_Typet   wrapper_descriptort   PyHeapTypeObjectt   PyTypeObjectt
   breakpointt
   __loader__t   __spec__t   BlockingIOErrort   BrokenPipeErrort   ChildProcessErrort   ConnectionAbortedErrort   ConnectionErrort   ConnectionRefusedErrort   ConnectionResetErrort   FileExistsErrort   FileNotFoundErrort   InterruptedErrort   IsADirectoryErrort   ModuleNotFoundErrort   NotADirectoryErrort   PermissionErrort   ProcessLookupErrort   RecursionErrort   ResourceWarningt   TimeoutErrort   __build_class__t   asciit
   memoryviewt   WindowsErrort   _t	   __cinit__t   __dealloc__t   __richcmp__t   __next__t	   __await__t	   __aiter__t	   __anext__t   __getreadbuffer__t   __getwritebuffer__t   __getsegcount__t   __getcharbuffer__t   __getbuffer__t   __releasebuffer__t   CYTHON_INLINEt   inlinet   IncludeCodec           B@  s_   e  Z d  Z d Z d Z d Z d Z d	 d	 e e	 d  Z
 d   Z d   Z d   Z d   Z RS(
   s]   
    An include file and/or verbatim C code to be included in the
    generated sources.
    i    i   i   c         C@  s   |  j  |  _ t |   j  d 7_  i  |  _ | r | d d k ro | d d k ro d j |  |  j d <t } q d j |  |  j d <n  | r | |  j |  j <n  | r |  j |  _ n! | r |  j |  _ n |  j	 |  _ d  S(   Ni   i    t   <it   >u   #include {0}u   #include "{0}"(
   t   countert   ordert   typet   piecest   formatt   Falset   INITIALt   locationt   LATEt   EARLY(   t   selft   includet   verbatimt   latet   initial(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   __init__   s    	 	c         C@  sR   | | k rD | | } t  |  j | j  | _ | j j |  j  n
 |  | | <d S(   s   
        Insert `self` in dict `d` with key `key`. If that key already
        exists, update the attributes of the existing value with `self`.
        N(   t   minRR   RN   t   update(   RU   t   dt   keyt   other(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   dict_update   s
    
c         C@  s   |  j  S(   N(   RL   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   sortkey   s    c         C@  s   |  j  j d  S(   s   
        Return the main piece of C code, corresponding to the include
        file. If there was no include file, return None.
        i    (   RN   t   get(   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt	   mainpiece   s    c         C@  s2   x+ t  |  j  D] } | j |  j |  q Wd  S(   N(   t   sortedRN   t   putln(   RU   t   codet   k(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   write   s    N(   t   __name__t
   __module__t   __doc__RQ   RT   RS   RK   t   Nonet   TrueRP   RZ   R`   Ra   Rc   Rh   (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRH   |   s   			c          C@  s=   t  j j t  j j t  j j t    }  t  j j |  d  S(   Nt   Utility(   R   t   patht   dirnamet   abspatht   __file__t   join(   t
   Cython_dir(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_utility_dir   s    *t   UtilityCodeBasec           B@  s   e  Z d  Z e Z i  Z e d d   Z e d    Z	 e d d   Z
 e d i  d   Z e d d   Z e j d  j d  Z d   Z d	   Z d d
  Z RS(   s  
    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.
    c         C@  s|  | d  k r d  Sd j |  } | r d | k r | d t d g  k r | d =y t |  j t t   } Wq t t f k
 r } t	 d | | | f   q Xn  d | | } | d k r | | d <nE | d k r | | d <n, | d	 } t
 r
| j d
  } n  | | | <| rx| d	 } xQ | j   D]@ \ }	 }
 t
 rU|	 j d
  }	 n  | j |	 t    j |
  q1Wn  d  S(   Ns   
t
   substitutet   namings@   Error parsing templated utility code of type '%s' at line %d: %st   protoi    t   impli   i   t   ASCII(   Rl   Rs   t   setR   Rw   t   varsR   t   KeyErrort
   ValueErrort   RuntimeErrort   KEYWORDS_MUST_BE_BYTESt   encodet   itemst
   setdefaultR\   (   t   clst   utilityRM   t   linest   begin_linenot   tagsRf   t   et   all_tagst   namet   values(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   _add_utility   s2    +


c         C@  s  |  j  j |  } | r | St j j t   |  } t j j |  \ } } | d k r d } t t j	 d  j
 d  } t j j } n< d } t t j	 d	  j
 d  } t t j	 d
  j
 d  } t j	 d i | d 6 j }	 t j	 d  j }
 t t j | d d   } | j   } Wd  QXt d    } g  } t t  } d  } } d } xt |  D] \ } } |	 |  } | r;| j d  r|  j | | | | |  | d } | 2| j   | j d  } |
 |  } | r| j   \ } } n d } | | } qT| | j d  j | j d   | j d  qa| j | | |    qaW| d  k rst d   n  |  j | | | | |  t |  } | |  j  | <| S(   Ns   .pyxs   .pys   .pxds   .pxit   #s   ^\s*#.*t    t   /s   ^\s*//.*|/\*[^*]*\*/s	   \s+(\\?)$s   \1sd   ^%(C)s{5,30}\s*(?P<name>(?:\w|\.)+)\s*%(C)s{5,30}|^%(C)s+@(?P<tag>\w+)\s*:\s*(?P<value>(?:\w|[.:])+)t   Cs,   (.+)[.](proto(?:[.]\S+)?|impl|init|cleanup)$t   encodings   UTF-8c           S@  s   d  d  i  g S(   N(   Rl   (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   <lambda>*  R   i    R   i   Rz   t   tagt   values   Empty utility code file(   s   .pyxs   .pys   .pxds   .pxi(   t   _utility_cacheRb   R   Ro   Rs   Ru   t   splitextR   R   t   compilet   subR   t   _unicodet   rstript   matchR   R	   t   open_source_filet	   readlinesR   R|   Rl   t	   enumeratet   groupR   t   cleart   groupst   addt   appendR   t   dict(   R   Ro   t	   utilitiest   filenameR8   t   extt   commentt   strip_commentsR   t   match_specialt
   match_typet   ft	   all_linesR   R   R   RM   R   t   linenot   linet   mR   t   mtype(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   load_utilities_from_file  s\    


#c      	   K@  s  d | k r' | j  d d  \ } } n  | s\t   } | d } y t j |  } Wn t k
 r d d l } t } | j }	 t | j	 |	   P }
 g  |
 j
   D]6 } t j j |	 |  j |  r t j j |  ^ q } Wd QXn Xg  | D] } | j |  r | ^ q } | s*t d |   n  t |  d k rOt d |   n  | d } n  |  j |  } | | \ } } } | rq| j   } x | j   D] \ } } | | k rqn  | d k r,| rg  t |  D] } |  j | | |  ^ q} q`g  t |  D] } |  j | |  ^ q} n4 | s;d } n% t |  d k r`t |  d } n  | | | <qWn  | d k	 r| | d	 <n  | d k	 r| | d
 <n  d | k r| | d <n  d | k r| r| | d <n  |  |   S(   s  
        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.
        s   ::i   t   .i    Ns    No match found for utility code s4   More than one filename match found for utility code t   requiresRy   Rz   R   t   file(   t   rsplitRu   R   t   listdirt   OSErrort   zipfileR    t   archiveR   t   ZipFilet   namelistRo   Rs   t
   startswitht   basenameR   t   lenR   t   copyR   Rd   t   loadt   load_cachedRl   t   list(   R   t   util_code_namet	   from_filet   kwargst   utility_dirt   prefixt   listingR   t   loaderR   t   fileobjR   R   t   filesR   Ry   Rz   R   t   orig_kwargsR   t   dep(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR   Q  sb    	
	@.+	c         C@  sM   |  | | f } y | | SWn t  k
 r. n X|  j | |  } | | <| S(   s`   
        Calls .load(), but using a per-type cache based on utility name and file name.
        (   R~   R   (   R   t   utility_code_nameR   t   _UtilityCodeBase__cacheR^   Rf   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR     s    c         K@  sD   |  j  | | |  } | j | j } } | j |  | j |  f S(   sR   
        Load a utility code as a string. Returns (proto, implementation)
        (   R   Ry   Rz   t   format_code(   R   R   R   R   t   utilRy   Rz   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   load_as_string  s    s   \n\n+c         C@  s&   | r" | d | j     d } n  | S(   s3   
        Format a code section for output.
        s   
s   

(   t   strip(   RU   t   code_stringt   replace_empty_lines(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR     s    c         C@  s   d t  |   j |  j f S(   Ns   <%s(%s)>(   RM   Ri   R   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   __str__  s    c         K@  s   d  S(   N(    (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_tree  s    c         C@  s   |  S(   N(    (   RU   t   memodict(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   __deepcopy__  s    N(   Ri   Rj   Rk   RP   t   is_cython_utilityR   t   classmethodRl   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRv      s    !@D		t   UtilityCodec        	   B@  sz   e  Z d  Z d d d d d d d d d  Z d   Z d   Z d   Z d d  Z d   Z	 d   Z
 d	   Z d
   Z RS(   sF  
    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)
    t   utility_code_protoc	   	      C@  s^   | |  _  | |  _ | |  _ | |  _ | |  _ i  |  _ g  |  _ | |  _ | |  _ | |  _	 d  S(   N(
   Ry   Rz   t   initt   cleanupR   t   _cachet   specialize_listt   proto_blockR   R   (	   RU   Ry   Rz   R   R   R   R   R   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ     s    									c         C@  s   t  |  j |  j f  S(   N(   t   hashRy   Rz   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   __hash__  s    c         C@  s   |  | k r t  St |   t |  } } | | k	 rX t | |  pP t |  |  rX t St |  d d   } t | d d   } | |  j f | | j f k S(   NRy   (   Rm   RM   t
   isinstanceRP   t   getattrRl   Rz   (   RU   R_   t	   self_typet
   other_typet
   self_protot   other_proto(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   __eq__  s    +c         C@  s   | d k r d S| | S(   sY   
        Format a string in this utility code with context. If None, do nothing.
        N(   Rl   (   RU   t   st   context(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   none_or_sub  s    c         K@  s!  | d  k	 r/ | j   | d <| j   | d <n  t t | j     } y |  j | SWn t k
 r|  j d  k r~ d  } n% g  |  j D] } | j	 |  ^ q } t
 |  j |  j |  |  j |  j |  |  j |  j |  |  j |  j |  | |  j  } |  j | <|  j j |  | SXd  S(   NRM   t	   type_name(   Rl   t   empty_declaration_codet   specialization_namet   tupleRd   R   R   R~   R   t
   specializeR   R   Ry   Rz   R   R   R   R   R   (   RU   t
   pyrex_typet   dataR^   R   t   rR   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR     s&    	%c         @  s}   d | k r" d | k r" t  | f Si      f d   } t j d | |  } d | k rg d | k sm t  t   | f S(   sH   Replace 'PYIDENT("xyz")' by a constant Python identifier cname.
        s   PYIDENT(s
   PYUNICODE(c         @  sm   |  j    } y  | } WnL t k
 rh | \ } }   j t j |  d | d k j }  | <n X| S(   Nt
   identifiert   IDENT(   R   R~   t   get_py_string_constR   t   EncodedStringt   cname(   t   matchobjR^   R   t   str_typeR   (   t   outputt   replacements(    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   externalise  s    -s   PY(IDENT|UNICODE)\("([^"]+)"\)(   RP   R   R   t   AssertionErrort   bool(   RU   Rz   R  R  (    (   R  R  s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   inject_string_constants  s    

c         @  s   d | k r t  | f St   }   f d   } t j d | |  } d | k sU t  x- t |  D] }   j t j | d   qb Wt	 |  | f S(   sV   Replace 'UNBOUND_METHOD(type, "name")' by a constant Python identifier cname.
        s   CALL_UNBOUND_METHOD(c         @  s   |  j    \ } } } } | rJ g  | d j d  D] } | j   ^ q2 n g  } t |  d k  sx t d t |      j | | | |  S(   Ni   t   ,i   s8   CALL_UNBOUND_METHOD() does not support %d call arguments(   R   t   splitR   R   R  t   cached_unbound_method_call_code(   R   t
   type_cnamet   method_namet	   obj_cnamet   argst   arg(   R  (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  +  s    8(sM   CALL_UNBOUND_METHOD\(([a-zA-Z_]+),\s*"([^"]+)",\s*([^),]+)((?:,\s*[^),]+)*)\)s   ObjectHandling.c(
   RP   R|   R   R   R  Rd   t   use_utility_codeR   R   R  (   RU   Rz   R  t   utility_codeR  t   helper(    (   R  s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   inject_unbound_methods$  s    
	c         C@  sD   d | k r | Sd   } t  j d | |  } d | k s@ t  | S(   s<   Replace CSTRING('''xyz''') by a C compatible string
        s   CSTRING(c         S@  s8   |  j  d  j d d  } d j d   | j   D  S(   Ni   t   "R   c         s@  sF   |  ]< } | j  d   s( | j  d  r2 d | n d | d  Vq d S(   s   \s   \\s   "%s\n"
s   "%s"
iN(   t   endswith(   t   .0R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pys	   <genexpr>G  s   (   R   t   replaceRs   t
   splitlines(   R   t   content(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   split_stringD  s    s)   CSTRING\(\s*"""([^"]*(?:"[^"]+)*)"""\s*\)(   R   R   R  (   RU   Rz   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   wrap_c_strings>  s    	c         C@  s5  |  j  r- x! |  j  D] } | j |  q Wn  |  j r} | |  j } | j d |  j  | j |  j |  j  d |  j  n  |  j r%|  j |  j	 |  j   } |  j
 | |  \ } } |  j | |  \ } } | d } | j d |  j  | p | s| j | d |  j  q%| j |  n  |  j r| d } | j d |  j  t |  j t  rz| j |  j |  j   n |  j | | j  | j | j | j   | j   n  |  j r1t j r1| d } | j d	 |  j  t |  j t  r| j |  j |  j  d
 |  j  q1|  j | | j  n  d  S(   Ns   /* %s.proto */s   %s_protot   utility_code_defs   /* %s */s   %s_implt   init_globalss   /* %s.init */t   cleanup_globalss   /* %s.cleanup */s
   %s_cleanup(   R   R  Ry   R   Re   R   t   put_or_includeR   Rz   R  R  R  t   putR   R   R   t
   module_post   error_goto_if_PyErrR   R   t   generate_cleanup_code(   RU   R  t
   dependencyt   writerRz   t   is_specialised1t   is_specialised2(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_codeN  sB    		 	
	

N(   Ri   Rj   Rk   Rl   RZ   R   R   R   R   R  R  R  R'  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR     s   						c         C@  sW   |  s
 d S| r' d | | f | d <n | r: | | d <n  d d l m } | |  |  S(   s+   Run tempita on string s with given context.s   %s:%st   __namei   (   R   N(   Rl   t   TempitaR   (   R   R   R   R   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   sub_tempitav  s    t   TempitaUtilityCodec           B@  sD   e  Z d d d d d d d   Z e d d i  d   Z d   Z RS(   c      
   K@  s   | d  k r i  } n  t | | | |  } t | | | |  } t | | | |  } t t |   j | | d | d | d | | d  S(   NR   R   R   (   Rl   R*  t   superR+  RZ   (   RU   R   Ry   Rz   R   R   R   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ     s    	c         C@  s   | r t  t | j     n d  } t |  d  k	 s< t  |  | | | f } y | | SWn t k
 rm n X|  j | | d | } | | <| S(   NR   (   R   Rd   R   Rl   R   R  R~   R   (   R   R   R   R   t   _TempitaUtilityCode__cachet   context_keyR^   Rf   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR     s    $ c         C@  s)   | d k r d St | | |  j |  j  S(   sY   
        Format a string in this utility code with context. If None, do nothing.
        N(   Rl   R*  R   R   (   RU   R   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR     s    N(   Ri   Rj   Rl   RZ   R   R   R   (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR+    s   	t   LazyUtilityCodec           B@  s,   e  Z d  Z d Z  d Z d   Z d   Z RS(   s   
    Utility code that calls a callback with the root code writer when
    available. Useful when you only have 'env' but not 'code'.
    s   <lazy>c         C@  s   | |  _  d  S(   N(   t   callback(   RU   R0  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ     s    c         C@  s#   |  j  | j  } | j |  d  S(   N(   R0  t
   rootwriterR  (   RU   t   globalstateR   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR'    s    N(   Ri   Rj   Rk   Rl   R   RZ   R'  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR/    s
   	t   FunctionStatec           B@  s   e  Z e   d 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 e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   c         C@  s   | |  _  | |  _ | |  _ d  |  _ d |  _ t   |  _ |  j   |  _	 |  j
   d  |  _ d  |  _ g  |  _ d |  _ d  |  _ d  |  _ t |  _ t |  _ g  |  _ i  |  _ i  |  _ d |  _ d  |  _ g  |  _ t |  _ t |  _ d  S(   Ni    (   t   names_takent   ownert   scopeRl   t   error_labelt   label_counterR|   t   labels_usedt	   new_labelt   return_labelt   new_error_labelt   continue_labelt   break_labelt   yield_labelst   in_try_finallyt   exc_varst   current_exceptRP   t	   can_traceRm   t	   gil_ownedt   temps_allocatedt
   temps_freet   temps_used_typet   temp_countert   closure_tempst   collect_temps_stackt   should_declare_error_indicatort   uses_error_indicator(   RU   R5  R4  R6  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ     s0    					
															c         C@  sJ   |  j  } | d |  _  d t j | f } | d  k	 rF | d | 7} n  | S(   Ni   s   %s%dR8   (   R8  R   t   label_prefixRl   (   RU   R   t   nt   label(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR:    s    	t   yieldc         C@  s@   |  j  d |  } t |  j  d | f } |  j j |  | S(   Ns   resume_from_%si   (   R:  R   R?  R   (   RU   t	   expr_typeRO  t   num_and_label(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   new_yield_label  s    c         C@  s   |  j  } |  j d  |  _  | S(   Nt   error(   R7  R:  (   RU   t   old_err_lbl(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR<    s    	c         C@  s   |  j  |  j f S(   N(   R=  R>  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_loop_labels  s    c         C@  s   | \ |  _  |  _ d  S(   N(   R=  R>  (   RU   t   labels(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   set_loop_labels  s    c         C@  s5   |  j    } |  j |  j d  |  j d  f  | S(   Nt   continuet   break(   RV  RX  R:  (   RU   t
   old_labels(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   new_loop_labels  s
    c         C@  s   |  j  |  j |  j |  j f S(   N(   R=  R>  R;  R7  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_all_labels
  s    c         C@  s"   | \ |  _  |  _ |  _ |  _ d  S(   N(   R=  R>  R;  R7  (   RU   RW  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   set_all_labels  s    c         C@  s{   |  j    } g  } xU t | d d d d g  D]8 \ } } | rY | j |  j |   q. | j |  q. W|  j |  | S(   NRY  RZ  t   returnRT  (   R]  t   zipR   R:  R^  (   RU   R[  t
   new_labelst	   old_labelR   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   all_new_labels  s    (c         C@  s   |  j  j |  d  S(   N(   R9  R   (   RU   t   lbl(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt	   use_label"  s    c         C@  s   | |  j  k S(   N(   R9  (   RU   Rd  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt
   label_used%  s    c         C@  sq  | j  r | j r | j } n | j r> | j r> | j } n  | j r[ | j r[ t } n  |  j j	 | | f  } | d k	 r | d r | d j   } | d j |  na xB t r |  j d 7_ d t j |  j f } | |  j k r Pq q W|  j j | | | | f  | | f |  j | <t j rG|  j j d | | f  n  |  j rm|  j d j | | f  n  | S(   s  
        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.

        A C string referring to the variable is returned.
        i    i   s   %s%ds   /* %s allocated (%s) */iN(   t   is_constt   is_referencet   const_base_typet   is_fake_referencet   ref_base_typet   is_pyobjectt   is_memoryviewsliceRP   RF  Rb   Rl   t   popt   removeRm   RH  R   t   codewriter_temp_prefixR4  RE  R   RG  R   t   debug_temp_code_commentsR5  Re   RJ  R   (   RU   RM   t
   manage_reft   statict   freelistt   result(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   allocate_temp*  s,    		 		c         C@  s   |  j  | \ } } |  j j | | f  } | d k r\ g  t   f } | |  j | | f <n  | | d k r t d |   n  | d j |  | d j |  t j	 r |  j
 j d |  n  d S(   sv   
        Releases a temporary so that it can be reused by other code needing
        a temp of the same type.
        i   s   Temp %s freed twice!i    s   /* %s released */N(   RG  RF  Rb   Rl   R|   R   R   R   R   Rq  R5  Re   (   RU   R   RM   Rr  Rt  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   release_temp[  s    	c         C@  s   g  } xs |  j  D]h \ } } } } |  j j | | f  } | d k sV | | d k r | j | | | on | j f  q q W| S(   sx   Return a list of (cname,type,manage_ref) tuples of temp names and their type
        that are currently in use.
        i   N(   RE  RF  Rb   Rl   R   Rl  (   RU   t   usedR   RM   Rr  Rs  Rt  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   temps_in_usel  s    &c         C@  s;   g  |  j    D]* \ } } } | r | j r | | f ^ q S(   s   Return 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.
        (   Ry  Rl  (   RU   R   RM   Rr  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   temps_holding_referencew  s    c         C@  s2   g  |  j  D]$ \ } } } } | r
 | | f ^ q
 S(   sR   Return a list of (cname, type) tuples of refcount-managed Python objects.
        (   RE  (   RU   R   RM   Rr  Rs  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   all_managed_temps  s    c         C@  sO   t  g  |  j j   D]5 \ \ } } } | r | d D] } | | f ^ q3 q  S(   s   Return 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.
        i    (   Rd   RF  R   (   RU   RM   Rr  Rt  R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   all_free_managed_temps  s    %c         C@  s   |  j  j t    d S(   sJ   
        Useful to find out which temps were used in a code block
        N(   RJ  R   R|   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   start_collecting_temps  s    c         C@  s   |  j  j   S(   N(   RJ  Rn  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   stop_collecting_temps  s    c         C@  s   t  |  |  _ d  S(   N(   t   ClosureTempAllocatorRI  (   RU   R6  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   init_closure_temps  s    N(   Ri   Rj   R|   Rl   RZ   R:  RS  R<  RV  RX  R\  R]  R^  Rc  Re  Rf  RP   Rv  Rw  Ry  Rz  R{  R|  R}  R~  R  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR3    s*   '									1								t   NumConstc           B@  s   e  Z d  Z d d  Z RS(   s   Global 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
    c         C@  s.   | |  _  | |  _ | |  _ | p$ | |  _ d  S(   N(   R   R   t   py_typet
   value_code(   RU   R   R   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ     s    			N(   Ri   Rj   Rk   Rl   RZ   (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s   t   PyObjectConstc           B@  s   e  Z d  Z d   Z RS(   s>   Global info about a generic constant held by GlobalState.
    c         C@  s   | |  _  | |  _ d  S(   N(   R   RM   (   RU   R   RM   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ     s    	(   Ri   Rj   Rk   RZ   (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s   t   possible_unicode_identifiert   possible_bytes_identifiert   replace_identifiert   find_alphanumss   (?![0-9])\w+$R{   s   [^a-zA-Z0-9_]+s   ([a-zA-Z0-9]+)t   StringConstc           B@  s2   e  Z d  Z d   Z d   Z d e d d  Z RS(   s?   Global info about a C string constant held by GlobalState.
    c         C@  s:   | |  _  | |  _ t j |  |  _ d  |  _ g  |  _ d  S(   N(   R   t   textR   t   escape_byte_stringt   escaped_valueRl   t
   py_stringst   py_versions(   RU   R   R  t   byte_string(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ     s
    			c         C@  s>   | s d d g |  _  n" | |  j  k r: |  j  j |  n  d  S(   Ni   i   (   R  R   (   RU   t   version(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   add_py_version  s    c         C@  s  |  j  } |  j } t | p |  } | d  k o4 | } | d  k rL d  } n< | j   } | d k rs d  } d  } n d j t |   } | | | | f }	 | d  k	 r y | |	 SWq t k
 r q Xn	 i  |  _  | r t }
 nK | d  k r&t	 | t
  rt t |   }
 q,t t |   }
 n t }
 |
 rBt j d } n	 t j } | r^d | } n d } d	 | | rvd
 p| rd pd | |  j t t j  f } t | | | | | |
  } | |  j  |	 <| S(   Nt   utf8s   utf-8R5   t   usasciis   us-asciiR   R   s   _%ss	   %s%s%s_%sR   t   ut   b(   R  s   utf-8R5   R  s   us-ascii(   R  R  R  Rl   t   lowerRs   R  R~   Rm   R   R   R  R  RP   R   t   interned_prefixest   py_const_prefixR   R   t   const_prefixt   PyStringConst(   RU   R   R   t   is_strt   py3str_cstringR  R  t
   is_unicodet   encoding_keyR^   t   internR   t   encoding_prefixt   pystring_cnamet	   py_string(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR     sP    							N(   Ri   Rj   Rk   RZ   R  Rl   RP   R   (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s
   		R  c           B@  s)   e  Z d  Z e d e d  Z d   Z RS(   sD   Global info about a Python string constant held by GlobalState.
    c         C@  s:   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ d  S(   N(   R   R  R   R  R  R  (   RU   R   R   R  R  R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ     s    					c         C@  s   |  j  | j  k  S(   N(   R   (   RU   R_   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   __lt__$  s    N(   Ri   Rj   Rk   RP   Rl   RZ   R  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s   t   GlobalStatec           B@  s  e  Z i  Z d  d d d d d d d d d	 d
 d d d d d d d d d d d d d d g Z d< d  Z d   Z d   Z d   Z d   Z	 d   Z
 d< d  Z e d   Z d!   Z d" d< d< d#  Z d< d$  Z d%   Z d< e d< d&  Z d'   Z d(   Z d< d)  Z d" d*  Z d+   Z d,   Z d" d" d-  Z d.   Z d/   Z d0   Z d1   Z d2   Z d3   Z d4   Z  d5   Z! d6   Z" d7   Z# d8   Z$ d9   Z% d:   Z& d;   Z' RS(=   t   h_codet   filename_tablet   utility_code_proto_before_typest   numeric_typedefst   complex_type_declarationst   type_declarationsR   t   module_declarationst   typeinfot   before_global_vart
   global_vart   string_declst   declst   late_includest   all_the_restt   pystring_tablet   cached_builtinst   cached_constantsR  t   init_moduleR  t   cleanup_modulet   main_methodR  t   endc         C@  s   i  |  _  g  |  _ i  |  _ t   |  _ i  |  _ t |  _ | |  _ | |  _	 i  |  _
 | |  _ i  |  _ i  |  _ i  |  _ i  |  _ i  |  _ g  |  _ i  |  _ t   |  _ | j |   | |  _ d  S(   N(   R  t   filename_listt   input_file_contentsR|   t   utility_codest   declared_cnamesRP   t   in_utility_code_generationt   code_configt   common_utility_include_dirt   partst   module_nodet   const_cnames_usedt   string_const_indext   dedup_const_indext   pyunicode_ptr_const_indext   num_const_indext   py_constantst   cached_cmethodst   initialised_constantst   set_global_stateR1  (   RU   R$  R  R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ   d  s(    																c         C@  s  |  j  } x$ |  j D] } | j   |  j | <q Wt j sF |  j d =n$ |  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	 =n1 |  j d	 } | j   | j d  | j d
  |  j d } | j d  | j d  |  j d } |  j j rz| j d  n  | j d  | j d  d  S(   NR  s=   static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {R  R   s>   static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {t   __Pyx_InitCachedConstantsR  s6   static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {R  s:   static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) {R   s)   /* --- Runtime support code (head) --- */R  s   
#line 1 "cython_utility"
s"   /* --- Runtime support code --- */(   R1  t   code_layoutt   insertion_pointR  R   t   cache_builtinst   enter_cfunc_scopeRe   t   put_declare_refcount_contextt   put_setup_refcount_contextR"  R  t   emit_linenumsRh   (   RU   R1  t   partt   wRf   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   initialize_main_c_code}  s@    		



	
c         C@  sS   |  j    |  j d } t j d d  } | j | j | j   | j d  d  S(   NR  t   TypeConversionss   TypeConversion.cR   (   t   close_global_declsR  R+  R   R  R   Rz   Re   (   RU   Rf   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   finalize_main_c_code  s
    
c         C@  s   |  j  | S(   N(   R  (   RU   R^   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   __getitem__  s    c         C@  s  |  j    t j ry |  j d } | j d  | j | j  r_ | j | j  | j d  n  | j d  | j   n  |  j d } | j	   | j d  | j | j  r | j | j  | j	   | j d  n  | j d  | j   |  j d } | j d  | j | j  r<| j | j  | j d  n  | j d  | j   t j
 r|  j d } | j d  | j   n  t j
 r|  j d } | j d  | j   n  d  S(	   NR  s	   return 0;s
   return -1;t   }R  R  R  R  (   t   generate_const_declarationsR   R  R  Re   Rf  R7  t	   put_labelt   exit_cfunc_scopet   put_finish_refcount_contextR"  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    sB    
	



		c         C@  s   |  d j  d | j  d  S(   NR  s   static PyObject *%s;(   Re   R   (   RU   t   entry(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_pyobject_decl  s    c         C@  s=   | d  k	 r2 | |  j k r d  S|  j j |  n  |  j d S(   NR  (   Rl   R  R   R  (   RU   t   target(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_cached_constants_writer  s
    c         C@  sS   | r d p d } y |  j  | | f } Wn# t k
 rN |  j | |  } n X| S(   Nt   longt   int(   R  R~   t   new_num_const(   RU   t	   str_valuet   longnessR  t   c(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_int_const  s    c         C@  sD   y |  j  | d f } Wn& t k
 r? |  j | d |  } n X| S(   Nt   float(   R  R~   R  (   RU   R  R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_float_const  s
    R   c         C@  s   | d  k	 r1 |  j j |  } | d  k	 r1 | Sn  |  j | |  } | d  k	 r | t j k r |  j d } | j d | j  n  | d  k	 r | |  j | <n  | S(   NR  s   Py_CLEAR(%s);(	   Rl   R  Rb   t   new_py_constR   R"  R  Re   R   (   RU   RM   R   t   cleanup_levelt	   dedup_keyt   constt   cleanup_writer(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_py_const  s    c         C@  sl   | j  r | j   } n | j   } y |  j | } Wn# t k
 rZ |  j | |  } n X| j |  | S(   N(   R  t
   utf8encodet
   byteencodeR  R~   t   new_string_constR  (   RU   R  t
   py_versionR  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_string_const  s    	c         C@  sO   | j  s t  y |  j | } Wn( t k
 rJ |  j   } |  j | <n X| S(   N(   R  R  R  R~   t   new_const_cname(   RU   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_pyunicode_ptr_const  s    c         C@  s   d  } | r] | d  k	 r] | j   | j   k r] |  j | d d } |  j | d d } n |  j |  } | j | j | | |  } | S(   NR  i   i   (   Rl   R  R  R  R   R   (   RU   R  R   R  t   unicode_valueR  t   c_stringR  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR   "  s    c         C@  s   |  j  | d t S(   NR   (   R   Rm   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_interned_identifier0  s    c         C@  s2   |  j  |  } t | | |  } | |  j | <| S(   N(   t   new_string_const_cnameR  R  (   RU   R  R  R   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  3  s    c         C@  s>   |  j  | |  } t | | | |  } | |  j | | f <| S(   N(   t   new_num_const_cnameR  R  (   RU   R   R  R  R   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  9  s    c         C@  s2   |  j  |  } t | |  } |  j j |  | S(   N(   R  R  R  R   (   RU   RM   R   R   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  ?  s    c         C@  s"   | j  d d  } |  j d |  S(   NR{   t   ignoreR   (   t   decodeR  (   RU   t   bytes_valueR   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  E  s    c         C@  sj   | d k r | d 7} d } n  t  j | } d | | f } | j d d  j d d  j d	 d  } | S(
   NR  t   LR  s   %s%st   +R8   t   -t   neg_R   (   R   R  R  (   RU   R   R  R   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  J  s    
	*c         C@  s   t  d |  d  j d  } |  j } | } x6 | | k rc | | d } | | <d | | f } q. Wd | | <| r t j | } n	 t j } d | | f S(   NR8   i    i   s   %s_%ds   %s%s(   R  R   R  R   R  R  (   RU   R   R   Rx  t   name_suffixRK   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  S  s    	
	c         C@  s\   | | f } y |  j  | } Wn8 t k
 rW |  j d d | | f  } |  j  | <n X| S(   Nt   umethods   %s_%s(   R  R~   R  (   RU   R
  R  R^   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_cached_unbound_methoda  s    %c         C@  sb   d t  |  } |  j t j | d   |  j | |  } | g | } d | | d j |  f S(   Ns   CallUnboundCMethod%ds   ObjectHandling.cs   __Pyx_%s(&%s, %s)s   , (   R   R  R   R   R  Rs   (   RU   R  R
  R  t
   arg_cnamesR   t   cache_cnameR  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR	  j  s    c         C@  s   | j  r | j r |  j | j |  r |  j |  |  j d } d  } | j t k r t | j \ } } | j	 d |  |  j
 | j t j |  | j  | j	 d  n  |  j
 | j t j | j  | j  | r | j	 d  q q n  d  S(   NR  s   #if %ss   #elses   #endif(   t
   is_builtinRg  t   should_declareR   R  R  Rl   R   t   non_portable_builtins_mapRe   t   put_cached_builtin_initt   posR   R   (   RU   R  R  t	   conditiont   replacement(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   add_cached_builtin_declv  s"    

c         C@  sb   |  j  d } |  j |  j } |  j t j d d   | j d | | | | j |  f  d  S(   NR  t   GetBuiltinNames   ObjectHandling.cs*   %s = __Pyx_GetBuiltinName(%s); if (!%s) %s(   R  R  R   R  R   R   Re   t
   error_goto(   RU   R  R   R   R  t   interned_cname(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    	c         C@  s,   |  j    |  j   |  j   |  j   d  S(   N(   t   generate_cached_methods_declst   generate_string_constantst   generate_num_constantst   generate_object_constant_decls(   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    


c         C@  s   g  |  j  D]! } t | j  | j | f ^ q
 } | j   |  j d } x4 | D], \ } } } | j d | j j |   qO Wd  S(   NR  s
   static %s;(   R  R   R   t   sortR  Re   RM   t   declaration_code(   RU   R  t   constst   decls_writerR8   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    .
c   	      C@  s   |  j  s d  S|  j d } |  j d } g  } x t |  j  j    D]h \ \ } } } | j |  |  j t j |   j } | j	 d | | f  | j	 d | | f  qC Wt
 j r |  j d } x" | D] } | j	 d |  q Wn  d  S(   NR  R  s4   static __Pyx_CachedCFunction %s = {0, &%s, 0, 0, 0};s   %s.type = (PyObject*)&%s;R  s   Py_CLEAR(%s.method);(   R  R  Rd   R   R   R  R   R   R   Re   R   R"  (	   RU   t   declR   t   cnamesR
  R  R   t   method_name_cnameR   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s     	(			c      
   C@  s  g  |  j  j   D]! } t | j  | j | f ^ q } | j   g  } |  j d } x | D] \ } } } t } | j r d | j k s d | j k r t } | j	 d d | j k r d p d  n  | j	 d | t
 j | j  f  | r | j	 d  n  | j d  k	 r[ x< | j j   D]( } | j | j t | j  | f  qWq[ q[ Wx t |  j j    D] \ } } t
 j |  \ }	 }
 |	 r| j	 d	  n  | j	 d
 | |
 f  |	 rg| j	 d  | j	 d
 | |	 f  | j	 d  qgqgW| r|  j t j d d   | j   |  j d } | j	 d  | j	 d t j  x| D]\ } } } | j s| j s| j d! k rd } n d | j j   } | j	 d | j  | j r| j	 d  | j	 d | j | j j | j j d d d | j f  | j	 d  n  | j	 d | j | | | | j | j | j f  | j rQ| j	 d  qQqQW| j	 d  | j	 d  |  j d } | j	 d  t j | j |  j   f  n  d  S("   NR  i   i   s   #if PY_MAJOR_VERSION %s 3RI   s   >=s   static const char %s[] = "%s";s   #endifs   #ifdef Py_UNICODE_WIDEs    static Py_UNICODE %s[] = { %s };s   #elset   InitStringss   StringTools.cR  R   s$   static __Pyx_StringTabEntry %s[] = {R{   t   USASCIIs   US-ASCIIt   UTF8s   UTF-8t   0s   "%s"s   static PyObject *%s;s   #if PY_MAJOR_VERSION >= 3s&   {&%s, %s, sizeof(%s), %s, %d, %d, %d},i   i    s   {0, 0, 0, 0, 0, 0, 0}s   };R  s"   if (__Pyx_InitStrings(%s) < 0) %s;(   R{   R"  s   US-ASCIIR#  s   UTF-8(!   R  R   R   R   R  R  RP   R  Rm   Re   R   t   split_string_literalR  R  Rl   R   Rd   R  R   t   encode_pyunicode_stringR  R   R   R   t   stringtab_cnameR  R   R  R  R  R  R  R   (   RU   R  t   c_constsR  R  R8   R   t   conditionalR  t   utf16_arrayt   utf32_arrayR  t   c_cnameR   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    7
'	 	-"
									c         C@  sQ  g  |  j  j   D]= } | j | j d d k t | j  | j | j | f ^ q } | j   |  j d } |  j d } x | D] \ } } } } } } | j }	 | j	 d |	  | d k r d }
 nW | d k r d	 }
 nB t
 j |  r d
 }
 n* t | j d   d k rd }
 n d }
 | j	 d |	 |
 | | j |	 |  j  f  q~ Wd  S(   Ni    R  R  R  s   static PyObject *%s;R  s   PyFloat_FromDouble(%s)R  s%   PyLong_FromString((char *)"%s", 0, 0)s$   PyInt_FromString((char *)"%s", 0, 0)i   s   PyInt_FromLong(%sL)s   PyInt_FromLong(%s)s   %s = %s; %s(   R  R   R  R   R   R  R  R  R   Re   R	   t   long_literalt   lstript   error_goto_if_nullR   (   RU   R  R  R  R  R  R8   R   R  R   t   function(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s(    P
						
c         C@  sq   | |  j  k r\ |  j  | } t | j  t | j  k s@ t  | j | j k sX t  t S| |  j  | <t Sd  S(   N(   R  R   RM   R  R   RP   Rm   (   RU   R   R  R_   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  !  s    $c         C@  sa   | j    } y |  j | } Wn= t k
 r\ t |  j  } |  j j |  | |  j | <n X| S(   N(   t   get_filenametable_entryR  R~   R   R  R   (   RU   t   source_descR  t   index(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   lookup_filename/  s    c         C@  s   y |  j  | SWn t k
 r" n X| j d d d d  } z? g  | D]. } d | j   j d d  j d d	  ^ qE } Wd  t | d
  r | j   n  X| s | j d  n  | |  j  | <| S(   NR   R{   t   error_handlingR  u    * u   */u.   *[inserted by cython to avoid comment closer]/u   /*u-   /[inserted by cython to avoid comment start]*t   closeu    (   R  R~   t	   get_linesR   R  t   hasattrR6  R   (   RU   R2  t   source_fileR   t   F(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   commented_file_contents9  s    	< c         C@  s9   | r5 | |  j  k r5 |  j  j |  | j |   n  d S(   s  
        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(   R  R   R'  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  R  s    	c         C@  sL   | d  k r d  S| j r, |  j | j  n  | j rH |  j | j  n  d  S(   N(   Rl   R  R  t   utility_code_definition(   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   use_entry_utility_code_  s    		N((   Ri   Rj   t
   directivesR  Rl   RZ   R  R  R  R  R  R  RP   R  R  R  R  R  R   R  R  R  R  R  R  R  R  R	  R  R  R  R  R  R  R  R  R4  R;  R  R=  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  (  sz   		*			)																			M			
		c         @  sC   |  j   t j       f d   }  f d   } t | |  S(   Nc         @  s     |  j   S(   N(   t	   funcstate(   RU   (   t   attribute_of(    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRb   k  s    c         @  s   t  |  j   |  d  S(   N(   t   setattrR?  (   RU   R   (   R   (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR|   m  s    (   Ri   R   t
   attrgettert   property(   t   funcRb   R|   (    (   R@  R   s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   funccontext_propertyh  s
    	t   CCodeConfigc           B@  s   e  Z e e e d   Z RS(   c         C@  s   | |  _  | |  _ | |  _ d  S(   N(   t   emit_code_commentsR  t   c_line_in_traceback(   RU   R  RG  RH  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ   w  s    		(   Ri   Rj   Rm   RZ   (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRF  r  s   t   CCodeWriterc           B@  sZ  e  Z d  Z e j d d  d d e d   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 d d  Z 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# d d d$  Z( d%   Z) d&   Z* d e d d'  Z+ d(   Z, d)   Z- d*   Z. d d+  Z/ d# e d,  Z0 e1 d-  Z2 d.   Z3 d/   Z4 d0   Z5 d1   Z6 d2   Z7 d3   Z8 d4   Z9 d5   Z: d6   Z; d7   Z< d8   Z= d9   Z> d:   Z? d;   Z@ d<   ZA d# d e1 d=  ZB d>   ZC d?   ZD d@   ZE dA   ZF eG dB  ZH dC   ZI dD   ZJ dE   ZK dF   ZL dG   ZM dH   ZN e1 dI  ZO e1 dJ  ZP dK   ZQ dL   ZR dM   ZS dN   ZT e1 dO  ZU dP   ZV e1 e dQ  ZW e1 e1 dR  ZX e1 e dS  ZY e1 e e1 e e dT  ZZ dU   Z[ dV   Z\ dW   Z] e1 dX  Z^ dY   Z_ dZ   Z` d[   Za d\ d]  Zb d^   Zc d_   Zd e d`  Ze e da  Zf db   Zg e1 dc  Zh dd e1 de  Zi e1 d df  Zj dg   Zk e1 d dh  Zl d di  Zm d dj  Zn d dk  Zo dl   Zp dm   Zq e dn  Zr e do  Zs dp   Zt dq   Zu dr   Zv ds   Zw dt   Zx du   Zy dv   Zz e dw  Z{ dx   Z| e1 dy  Z} e dz  Z~ d{   Z d d|  Z e d}  Z d~   Z e d  Z d   Z d   Z d   Z RS(   s  
    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.
    t   create_fromRI  c         C@  s   | d  k r t   } n  | |  _ d  |  _ d  |  _ g  |  _ d  |  _ d  |  _ d  |  _ d |  _	 d |  _
 d |  _ | d  k	 r |  j | j  | j |  _ | r | j	 |  _	 | j |  _ | j
 |  _
 n  | j |  _ | j |  _ n  d  S(   Ni    i   (   Rl   R   t   buffert   last_post   last_marked_post   pyclass_stackR?  R2  R  t   levelt
   call_levelt   bolR  (   RU   RJ  RK  t   copy_formatting(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ     s*     										c         C@  s   t  | | |  } | S(   N(   RI  (   RU   RJ  RK  RR  Ru  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt
   create_new  s    c         C@  s.   |  j  d  k s t  | |  _  | j |  _ d  S(   N(   R2  Rl   R  R  (   RU   t   global_state(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    	c         C@  s   |  j  j |  d  S(   N(   RK  t   copyto(   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRU    s    c         C@  s   |  j  j   S(   N(   RK  t   getvalue(   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRV    s    c         C@  sS   |  j  r |  j  d n d } |  j j j | g | j d   |  j j |  d  S(   Ni   i    s   
(   RM  RK  t   markerst   extendt   countRh   (   RU   R   t   cython_lineno(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRh     s    #c         C@  s+   |  j  d |  d |  j j   d t  } | S(   NRJ  RK  RR  (   RS  RK  R  Rm   (   RU   R_   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    'c         C@  s   t  d |   S(   s   
        Creates a new CCodeWriter connected to the same global state, which
        can later be inserted using insert.
        RJ  (   RI  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt
   new_writer  s    c         C@  s/   | j  |  j  k s t  |  j j | j  d S(   s   
        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(   R2  R  RK  t   insert(   RU   R$  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR\    s    c         C@  s   d  S(   N(    (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR8    s    c         C@  s   d  S(   N(    (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR;    s    c         C@  s   d  S(   N(    (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR7    s    c         C@  s   d  S(   N(    (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR9    s    c         C@  s   d  S(   N(    (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR=    s    c         C@  s   d  S(   N(    (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR>    s    c         C@  s   d  S(   N(    (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   return_from_error_cleanup_label  s    c         C@  s   d  S(   N(    (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR?    s    c         C@  s   |  j  j |  S(   N(   R?  R:  (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR:    R   c         C@  s   |  j  j   S(   N(   R?  R<  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR<    R   c         G@  s   |  j  j |   S(   N(   R?  RS  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRS    R   c         C@  s   |  j  j   S(   N(   R?  RV  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRV    R   c         C@  s   |  j  j |  S(   N(   R?  RX  (   RU   RW  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRX    R   c         C@  s   |  j  j   S(   N(   R?  R\  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR\    R   c         C@  s   |  j  j   S(   N(   R?  R]  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR]    R   c         C@  s   |  j  j |  S(   N(   R?  R^  (   RU   RW  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR^    R   c         C@  s   |  j  j   S(   N(   R?  Rc  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRc    R   c         C@  s   |  j  j |  S(   N(   R?  Re  (   RU   Rd  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRe     R   c         C@  s   |  j  j |  S(   N(   R?  Rf  (   RU   Rd  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRf    R   c         C@  s   t  |  d | |  _ d  S(   NR6  (   R3  R?  (   RU   R6  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    c         C@  s   d  |  _ d  S(   N(   Rl   R?  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    c         C@  s   |  j  j | |  j S(   N(   R2  R  R   (   RU   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt
   get_py_int  s    c         C@  s   |  j  j | |  j S(   N(   R2  R  R   (   RU   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_py_float  s    R   c         C@  s   |  j  j | | | |  j S(   N(   R2  R  R   (   RU   RM   R   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    c         C@  s   |  j  j |  j S(   N(   R2  R  R   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    c         C@  s   |  j  j |  S(   N(   R2  R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    c         C@  s   |  j  j | | | |  j S(   N(   R2  R   R   (   RU   R  R   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR     s    	c         C@  s   |  j  j |  j S(   N(   R2  R  R   (   RU   RM   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_argument_default_const   s    c         C@  s   |  j  |  S(   N(   R   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  #  s    c         C@  s   |  j  | d t S(   NR   (   R   Rm   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   intern_identifier&  s    c         C@  s   |  j  j |  S(   N(   R2  R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  )  s    c         C@  s   |  j  r |  j r |  j   n  |  j j rf |  j rf |  j \ } } } |  j d | | j   f  n  | r | r |  j |  q |  j	 |  n  |  j d  d |  _ d  S(   Ns   
#line %s "%s"
s   
i   (
   RL  RQ  t   emit_markerR  R  RM  Rh   t   get_escaped_descriptiont   put_safeR  (   RU   Rf   t   safeR2  R   R8   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRe   .  s     c         C@  sG   | d  k r d  S|  j r4 |  j d  | d  k r4 d  S| | f |  _ d  S(   Ni   (   Rl   RM  RL  (   RU   R  t   trace(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   mark_pos<  s
     c         C@  s   |  j  \ } } | |  _ d  |  _  |  j d  |  j j ra |  j   |  j d |  j |   n  | r |  j r |  j j	 r |  j
 j d r |  j   |  j d | d |  j j |  j |  f  n  d  S(   Ns   
s	   /* %s */
t	   linetraces   __Pyx_TraceLine(%d,%d,%s)
i   (   RL  RM  Rl   Rh   R  RG  t   indentt   _build_markerR?  RC  R2  R>  RD  R  (   RU   R  Rf  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRb  C  s    		
+
	c         C@  s   | \ } } } t  | t  s$ t  |  j j |  } | t d | d  | !} | d c d 7<| | | | d !7} d | j   | d j |  f S(   Ni    i   iu                # <<<<<<<<<<<<<<i   u   "%s":%d
%s
u   
(   R   R
   R  R2  R;  t   maxRc  Rs   (   RU   R  R2  R   t   colt   contentsR   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRj  P  s    c         C@  s   |  j  |  d |  _ d  S(   Ni    (   Rh   RQ  (   RU   Rf   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRd  Y  s    c         C@  s   |  j  j } | r t |  d k r d | t j | j d   j   f } t j j	 | |  } t j j
 |  s d | t j   f } t t j |    } | j |  Wd  QXt j | |  n  d | } n  |  j |  d  S(   Ni   s   %s_%s.hR  s   %s.tmp%ss   #include "%s"
(   R2  R  R   t   hashlibt   md5R   t	   hexdigestR   Ro   Rs   t   existst   getpidR   R	   t   open_new_fileRh   t   shutilt   moveR  (   RU   Rf   R   t   include_dirt   include_fileRo   t   tmp_pathR   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  ^  s    %c         C@  s  t  } d | k r$ | j d  } n d } d | k r | | j d  8} | d k  rg |  j | 7_ q | d k r | d d k r t } |  j d 8_ q n  |  j r |  j   n  |  j |  d |  _ | d k r |  j | 7_ n | r |  j d 7_ n  d  S(   Nt   {i    R  i   (   RP   RY  RO  Rm   RQ  Ri  Rh   (   RU   Rf   t
   fix_indentt   dl(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  l  s&    		c         K@  s*   d d l  m } |  j | | |   d  S(   Ni   (   R   (   R)  R   Re   (   RU   Rf   R   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   putln_tempita  s    c         K@  s*   d d l  m } |  j | | |   d  S(   Ni   (   R   (   R)  R   R  (   RU   Rf   R   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_tempita  s    c         C@  s   |  j  d 7_  d  S(   Ni   (   RO  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   increase_indent  s    c         C@  s   |  j  d 8_  d  S(   Ni   (   RO  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   decrease_indent  s    c         C@  s   |  j  d  |  j   d  S(   NRy  (   Re   R~  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   begin_block  s    c         C@  s   |  j    |  j d  d  S(   NR  (   R  Re   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt	   end_block  s    
c         C@  s   |  j  d |  j  d  S(   Ns     (   Rh   RO  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRi    s    c         C@  s   d t  |  d d  S(   Ns   0x%02X%02X%02X%02Xi    i   (   i    i    i    i    (   R   (   RU   t	   pyversion(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   get_py_version_hex  s    c         C@  s*   | |  j  j k r& |  j d |  n  d  S(   Ns   %s:;(   R?  R9  Re   (   RU   Rd  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    c         C@  s%   |  j  j |  |  j d |  d  S(   Ns   goto %s;(   R?  Re  Re   (   RU   Rd  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_goto  s    c         C@  s   | j  d k r# | p | j r# d  S| j  d k r@ | j r@ d  S| rZ |  j d |  n  | j ss |  j d  n  |  j | j j | j d |  | j d  k	 r |  j
 d | j j | j   n | j j r |  j d  n  |  j d  d  S(   Nt   privates   %s s   CYTHON_UNUSED t   dll_linkages    = %ss    = NULLt   ;(   t
   visibilityt   defined_in_pxdRx  R  t   cf_usedRM   R  R   R   Rl   Rd  t   literal_codeRl  Re   (   RU   R  t   storage_classR  t
   definition(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_declaration  s    	#c   	      C@  s  x | j  D] \ } } } } | j |  } | j rH |  j d |  q
 | j r~ d d l m } |  j d | | j f  q
 |  j d | r d p d | f  q
 W| j r|  j	 j
 r d } n d } |  j d	 | t j f  |  j d
 | t j f  |  j d	 | t j f  n  d  S(   Ns
   %s = NULL;i   (   t
   MemoryViews   %s = %s;s   %s%s;s   static R   s   CYTHON_UNUSED s   %sint %s = 0;s   %sconst char *%s = NULL;(   RE  R  Rl  Re   Rm  R   R  t   memslice_entry_initRK  R?  RL  R   t   lineno_cnamet   filename_cnamet   clineno_cname(	   RU   t   func_contextR   RM   Rr  Rs  R  R  t   unused(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_temp_declarations  s    		'		c         C@  s%   |  j  d t j  |  j  d  d  S(   Ns   /* Generated by Cython %s */R   (   Re   R   t	   watermark(   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_generated_by  s    c         C@  s&   |  j  d |  |  j  d |  d  S(   Ns
   #ifndef %ss
   #define %s(   Re   (   RU   t   guard(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_h_guard  s    c         C@  s   t  j r d | S| Sd  S(   Ns   unlikely(%s)(   R   t   gcc_branch_hints(   RU   t   cond(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   unlikely  s    	c         C@  s7   | s
 d Sd d j  g  | D] } | | |  ^ q  S(   NR   s   %s t    (   Rs   (   RU   t	   modifierst   mapperR   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   build_function_modifiers  s    c         C@  sE   | j  } | j r# | j  j   s/ | j  j r: d | j S| j Sd  S(   Ns   (PyObject *)(   RM   t   is_self_argt   is_completet   is_extension_typeR   (   RU   R  RM   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   entry_as_pyobject  s
    	c         C@  s&   d d l  m } m } | | | |  S(   Ni   (   t   py_object_typet   typecast(   t
   PyrexTypesR  R  (   RU   R   RM   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   as_pyobject  s    c         C@  s   |  j  d |  d  S(   Ns   __Pyx_GOTREF(%s);(   Re   (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt
   put_gotref  s    c         C@  s   |  j  d |  d  S(   Ns   __Pyx_GIVEREF(%s);(   Re   (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_giveref  s    c         C@  s   |  j  d |  d  S(   Ns   __Pyx_XGIVEREF(%s);(   Re   (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_xgiveref  s    c         C@  s   |  j  d |  d  S(   Ns   __Pyx_XGOTREF(%s);(   Re   (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_xgotref  s    c         C@  sG   | r& |  j  d |  j | |   n |  j  d |  j | |   d  S(   Ns   __Pyx_INCREF(%s);s   Py_INCREF(%s);(   Re   R  (   RU   R   RM   t   nanny(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt
   put_incref  s     c         C@  s#   |  j  | | | d t d t d  S(   Nt
   null_checkR   (   t   _put_decrefRP   (   RU   R   RM   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt
   put_decref  s    c         C@  s-   | j  j r) |  j d |  j |   n  d  S(   Ns   __Pyx_GOTREF(%s);(   RM   Rl  Re   R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_gotref  s    c         C@  s-   | j  j r) |  j d |  j |   n  d  S(   Ns   __Pyx_GIVEREF(%s);(   RM   Rl  Re   R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_giveref  s    c         C@  s-   | j  j r) |  j d |  j |   n  d  S(   Ns   __Pyx_XGOTREF(%s);(   RM   Rl  Re   R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_xgotref  s    c         C@  s-   | j  j r) |  j d |  j |   n  d  S(   Ns   __Pyx_XGIVEREF(%s);(   RM   Rl  Re   R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_xgiveref  s    c         C@  sP   | j  j rL | r/ |  j d |  j |   qL |  j d |  j |   n  d  S(   Ns   __Pyx_INCREF(%s);s   Py_INCREF(%s);(   RM   Rl  Re   R  (   RU   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_incref  s    c         C@  s-   | j  j r) |  j d |  j |   n  d  S(   Ns   __Pyx_XINCREF(%s);(   RM   Rl  Re   R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_xincref  s    c      
   C@  s)   |  j  | | | d t d t d | d  S(   NR  R   t   clear_before_decref(   R  RP   Rm   (   RU   R   RM   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_decref_clear"  s    c      
   C@  s)   |  j  | | | d t d | d t d  S(   NR  t   have_gilR   (   R  Rm   RP   (   RU   R   RM   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_xdecref&  s    c      
   C@  s)   |  j  | | | d t d t d | d  S(   NR  R   R  (   R  Rm   (   RU   R   RM   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_xdecref_clear*  s    c   
      C@  s   | j  r  |  j | d | d  S| r, d n d } | r> d n d }	 | r | r| | s_ d }	 n  |  j d | |	 | f  q |  j d | |	 |  j | |  | f  n& |  j d | |	 |  j | |  f  d  S(	   NR  t   __Pyxt   Pyt   XR   s   %s_%sCLEAR(%s);s   %s_%sDECREF(%s); %s = 0;s   %s_%sDECREF(%s);(   Rm  t   put_xdecref_memoryviewsliceRe   R  (
   RU   R   RM   R  R  R  R   R  R   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  .  s    			#	c         C@  s   |  j  d | | f  d  S(   Ns   __Pyx_DECREF_SET(%s, %s);(   Re   (   RU   R   t	   rhs_cname(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_decref_setC  s    c         C@  s   |  j  d | | f  d  S(   Ns   __Pyx_XDECREF_SET(%s, %s);(   Re   (   RU   R   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_xdecref_setF  s    c         C@  s-   | j  j r) |  j d |  j |   n  d  S(   Ns   __Pyx_XDECREF(%s);(   RM   Rl  Re   R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_decrefI  s    c         C@  sP   | j  j rL | r/ |  j d |  j |   qL |  j d |  j |   n  d  S(   Ns   __Pyx_XDECREF(%s);s   Py_XDECREF(%s);(   RM   Rl  Re   R  (   RU   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_xdecrefM  s    c         C@  s   |  j  | d t d  S(   NR  (   t   _put_var_decref_clearRP   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_decref_clearT  s    c         C@  s   |  j  | d t d  S(   NR  (   R  Rm   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_xdecref_clearW  s    c         C@  sw   | j  j rs | j r> |  j d | r* d p- d | j f  qs |  j d | rS d pV d |  j |  | j f  n  d  S(   Ns   __Pyx_%sCLEAR(%s);R  R   s   __Pyx_%sDECREF(%s); %s = 0;(   RM   Rl  t
   in_closureRe   R   R  (   RU   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  Z  s    			i    c         C@  sN   xG | D]? } | s | j  r | j r6 |  j |  qF |  j |  q q Wd  S(   N(   Rx  t   xdecref_cleanupR  R  (   RU   t   entriest	   used_onlyR  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_decrefsh  s
    	c         C@  s"   x | D] } |  j  |  q Wd  S(   N(   R  (   RU   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_xdecrefsp  s    c         C@  s"   x | D] } |  j  |  q Wd  S(   N(   R  (   RU   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_var_xdecrefs_cleart  s    c         C@  sD   d d l  m } |  j j | j  |  j d | t |  f  d  S(   Ni   (   R  s   __PYX_INC_MEMVIEW(&%s, %d);(   R   R  R2  R  t   memviewslice_init_codeRe   R  (   RU   t   slice_cnameR  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_incref_memoryviewslicex  s    c         C@  sD   d d l  m } |  j j | j  |  j d | t |  f  d  S(   Ni   (   R  s   __PYX_XDEC_MEMVIEW(&%s, %d);(   R   R  R2  R  R  Re   R  (   RU   R  R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  }  s    c         C@  s   |  j  d |  d  S(   Ns
   %s.memview(   R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_xgiveref_memoryviewslice  s    c         C@  sc   d d l  m } m } | | | d  } | rH |  j d | | f  n |  j d | | f  d  S(   Ni   (   R  R  t   Py_Nones   %s = %s; __Pyx_INCREF(Py_None);s   %s = %s; Py_INCREF(Py_None);(   R  R  R  Re   (   RU   R   RM   R  R  R  t   py_none(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_init_to_py_none  s
    s   %sc         C@  s@   | | j  } |  j | | j |  | j r< |  j d  n  d  S(   NR  (   R   R  RM   R  R  (   RU   R  t   templateR  Rf   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_init_var_to_py_none  s    	c   	      C@  sO  | j  s | j d k rZ | j t k rZ | j d k rJ |  j j d rJ qW | rW d  SqZ n  | j j   } | ss d  S| j  r d d l m } | | j	 g 7} n  | r | j
 |  n | j } d | k r d n d } d	 | k r | d
 7} n  | d k rd | | f } n  |  j d | j | d j |  | j r=| j n d | f  d  S(   Nt   __getattribute__t   __getattr__t   fast_getattri   (   t	   TypeSlotst   METH_FASTCALLt   __Pyx_PyCFunctionFastt   PyCFunctiont   METH_KEYWORDSt   WithKeywordss   (void*)(%s)%ss!   {"%s", (PyCFunction)%s, %s, %s}%st   |R$  (   t
   is_specialR   t   special_py_methodsR2  R>  t	   signaturet   method_flagsR   R  t   method_coexistt   put_pymethoddef_wrappert
   func_cnameRe   Rs   t   doct	   doc_cname(	   RU   R  t   termt
   allow_skipt   wrapper_code_writerR  R  t   func_ptrt   cast(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_pymethoddef  s2     
	c         C@  sd   | j  } | j r` | j j   } | r` d | k r` t j | } |  j d | | j  f  q` n  | S(   Nt   METH_NOARGSsS   static PyObject *%s(PyObject *self, CYTHON_UNUSED PyObject *arg) {return %s(self);}(   R  R  R  R  R   t   method_wrapper_prefixRe   (   RU   R  R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR    s    			c         C@  s   |  j  j t j d d   |  j  j d rK |  j  j t j d d   n |  j  j t j d d   |  j d  | s d } | r |  j d  q n  |  j d	 |  |  j d
  d S(   s  
        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.
        t   ForceInitThreadss   ModuleSetupCode.ct   fast_gilt   FastGilt	   NoFastGils   #ifdef WITH_THREADt   __pyx_gilstate_saves   PyGILState_STATE s   %s = __Pyx_PyGILState_Ensure();s   #endifN(   R2  R  R   R   R>  Re   R  (   RU   t   declare_gilstatet   variable(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_ensure_gil  s    	c         C@  s   |  j  j d r/ |  j  j t j d d   n |  j  j t j d d   | sZ d } n  |  j d  |  j d |  |  j d  d	 S(
   sD   
        Releases the GIL, corresponds to `put_ensure_gil`.
        R  R  s   ModuleSetupCode.cR  R  s   #ifdef WITH_THREADs   __Pyx_PyGILState_Release(%s);s   #endifN(   R2  R>  R  R   R   Re   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_release_ensured_gil  s    	c         C@  s   |  j  j d r/ |  j  j t j d d   n |  j  j t j d d   |  j d  |  j d  | r |  j d |  n  |  j d  |  j d	  d
 S(   s   
        Acquire the GIL. The thread's thread state must have been initialized
        by a previous `put_release_gil`
        R  R  s   ModuleSetupCode.cR  s   #ifdef WITH_THREADs   __Pyx_FastGIL_Forget();s   _save = %s;t   Py_BLOCK_THREADSs   #endifN(   R2  R>  R  R   R   Re   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_acquire_gil  s    c         C@  s   |  j  j d r/ |  j  j t j d d   n |  j  j t j d d   |  j d  |  j d  |  j d  | r |  j d |  n  |  j d	  |  j d
  d S(   s2   Release the GIL, corresponds to `put_acquire_gil`.R  R  s   ModuleSetupCode.cR  s   #ifdef WITH_THREADs   PyThreadState *_save;t   Py_UNBLOCK_THREADSs   %s = _save;s   __Pyx_FastGIL_Remember();s   #endifN(   R2  R>  R  R   R   Re   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_release_gil  s    c         C@  s+   |  j  d  |  j  d  |  j  d  d  S(   Ns   #ifdef WITH_THREADs%   PyGILState_STATE __pyx_gilstate_save;s   #endif(   Re   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  	  s    c         C@  s    |  j  d | |  j |  f  S(   Ns   if (%s < 0) %s(   Re   R  (   RU   R  R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_error_if_neg
	  s    c         C@  s   d d l  m } | j r5 d } |  j j | j  nG | j j rc | rc d } |  j j | j  n d } |  j j | j	  |  j
 d | j j | j  | | j |  j |  f  d  S(   Ni   (   t	   ExprNodest   __Pyx_RaiseClosureNameErrort&   __Pyx_RaiseUnboundMemoryviewSliceNogilt   __Pyx_RaiseUnboundLocalErrors#   if (unlikely(!%s)) { %s("%s"); %s }(   R   R  t   from_closureR2  R  t%   raise_closure_name_error_utility_codeRM   Rm  t+   raise_unbound_memoryview_utility_code_nogilt&   raise_unbound_local_error_utility_codeRe   t   check_for_null_codeR   R   R  (   RU   R  R  t   in_nogil_contextR  RD  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_error_if_unbound	  s"    				
	c         C@  s   t  |  j _ | r! t  |  j _ n  |  j j rF d t j t j f } n d } d t j	 t j
 |  j | d  t j | d | f S(   Ns	    %s = %s;R   s   %s = %s[%s]; %s = %s;%si    i   (   Rm   R?  RK  RL  R  RH  R   R  t   line_c_macroR  t   filetable_cnameR4  R  (   RU   R  Rx  t   cinfo(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   set_error_info$	  s    c         C@  sR   |  j  j } |  j  j |  | d  k r0 d | Sd |  j | d  | d | f S(   Ns   goto %s;s   __PYX_ERR(%s, %s, %s)i    i   (   R?  R7  Re  Rl   R4  (   RU   R  Rd  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  5	  s    c         C@  s    d |  j  |  |  j |  f S(   Ns
   if (%s) %s(   R  R  (   RU   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   error_goto_if?	  s    c         C@  s   |  j  d | |  S(   Ns   !%s(   R  (   RU   R   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR/  B	  s    c         C@  s   |  j  d | |  S(   Ns   %s < 0(   R  (   RU   R   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   error_goto_if_negE	  s    c         C@  s   |  j  d |  S(   Ns   PyErr_Occurred()(   R  (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR!  H	  s    c         C@  s   |  j  j |  S(   N(   R2  R4  (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR4  K	  s    c         C@  s   |  j  d  d  S(   Nt   __Pyx_RefNannyDeclarations(   Re   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  N	  s    c         C@  sL   | r% |  j  j t j d d   n  |  j d | | r= d p@ d f  d  S(   NR  s   ModuleSetupCode.cs%   __Pyx_RefNannySetupContext("%s", %d);i   i    (   R2  R  R   R   Re   (   RU   R   t   acquire_gil(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  Q	  s    	c         C@  s   |  j  d  d  S(   Ns   __Pyx_RefNannyFinishContext();(   Re   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  W	  s    c         C@  sH   | | r t  j n d t  j t  j f } t |  j _ |  j d |  d S(   s   
        Build a Python traceback for propagating exceptions.

        qualified_name should be the qualified name of the function.
        i    s%   __Pyx_AddTraceback("%s", %s, %s, %s);N(   R   R  R  R  Rm   R?  RL  Re   (   RU   t   qualified_namet   include_clinet   format_tuple(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_add_tracebackZ	  s    c         C@  sh   | t  j t  j t  j |  j j d | f } t |  j _ |  j	 d |  |  j j
 t j d d   d S(   s   
        Generate code to print a Python warning for an unraisable exception.

        qualified_name should be the qualified name of the function.
        t   unraisable_tracebackss0   __Pyx_WriteUnraisable("%s", %s, %s, %s, %d, %d);t   WriteUnraisableExceptions   Exceptions.cN(   R   R  R  R  R2  R>  Rm   R?  RL  Re   R  R   R   (   RU   R  t   nogilR  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_unraisablei	  s    		c         C@  s   |  j  d  d  S(   Nt   __Pyx_TraceDeclarations(   Re   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_trace_declarations|	  s    c         C@  s   | r |  j  d |  n  d  S(   Ns   __Pyx_TraceFrameInit(%s)(   Re   (   RU   t   codeobj(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_trace_frame_init	  s    c      	   C@  sD   |  j  d | t j |  j | d  | d | |  j |  f  d  S(   Ns*   __Pyx_TraceCall("%s", %s[%s], %s, %d, %s);i    i   (   Re   R   R  R4  R  (   RU   R   R  R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_trace_call	  s    	c         C@  s   |  j  d  d  S(   Ns   __Pyx_TraceException();(   Re   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_trace_exception	  s    c         C@  s   |  j  d | | f  d  S(   Ns   __Pyx_TraceReturn(%s, %d);(   Re   (   RU   t   retvalue_cnameR  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   put_trace_return	  s    c         C@  s+   |  j  d  |  j  |  |  j  d  d  S(   Ns   #ifdef _OPENMPs   #endif /* _OPENMP */(   Re   (   RU   t   string(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   putln_openmp	  s    c         C@  sV   |  j  d |  |  j  d  |  j  d  |  j  d  |  j  d  |  j  d  d S(   sl   
        Redefine the macros likely() and unlikely to no-ops, depending on
        condition 'cond'
        s   #if %ss       #undef likelys       #undef unlikelys       #define likely(x)   (x)s       #define unlikely(x) (x)s   #endifN(   Re   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   undef_builtin_expect	  s    c         C@  sV   |  j  d |  |  j  d  |  j  d  |  j  d  |  j  d  |  j  d  d  S(   Ns   #if %ss       #undef likelys       #undef unlikelys2       #define likely(x)   __builtin_expect(!!(x), 1)s2       #define unlikely(x) __builtin_expect(!!(x), 0)s   #endif(   Re   (   RU   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   redef_builtin_expect	  s    N(   Ri   Rj   Rk   t   cythont   localsRl   RP   RZ   RS  R  RU  RV  Rh   R  R[  R\  RE  R8  R;  R7  R9  R=  R>  R]  R?  R:  R<  RS  RV  RX  R\  R]  R^  Rc  Re  Rf  R  R  R^  R_  R  R  R  R   R`  R  Ra  R  Re   Rm   Rg  Rb  Rj  Rd  R  R  R|  R}  R~  R  R  R  Ri  R  R  R  R  R  R  R  R  t   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  R  R  R  R  R  R  R  R  R  R  R  R/  R  R!  R4  R  R  R  R  R  R  R!  R"  R#  R%  R'  R(  R)  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRI  }  s  																																																																		 				
											t   PyrexCodeWriterc           B@  s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C@  s   t  j |  |  _ d |  _ d  S(   Ni    (   R	   Rs  R   RO  (   RU   t   outfile_name(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ   	  s    c         C@  s%   |  j  j d d |  j | f  d  S(   Ns   %s%s
R  (   R   Rh   RO  (   RU   Rf   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRe   	  s    c         C@  s   |  j  d 7_  d  S(   Ni   (   RO  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRi  	  s    c         C@  s   |  j  d 8_  d  S(   Ni   (   RO  (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   dedent	  s    (   Ri   Rj   RZ   Re   Ri  R/  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR-  	  s   			t   PyxCodeWriterc           B@  s   e  Z d  Z d d d 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 RS(   s   
    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
    i    R5   c         C@  s1   | p t    |  _ | |  _ | |  _ | |  _ d  S(   N(   R   RK  RO  R   R   (   RU   RK  t   indent_levelR   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ   	  s    		i   c         C@  s   |  j  | 7_  t S(   N(   RO  Rm   (   RU   t   levels(    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRi  	  s    c         C@  s   |  j  | 8_  d  S(   N(   RO  (   RU   R2  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR/  	  s    c         C@  s   |  j  |  |  j   t S(   s  
        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()
        (   Re   Ri  Rm   (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   indenter	  s    
c         C@  s7   |  j  j   } t | t  r3 | j |  j  } n  | S(   N(   RK  RV  R   R   R   R   (   RU   Ru  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRV  	  s    c         C@  s8   | p |  j  } | r' t | |  } n  |  j |  d  S(   N(   R   R*  t   _putln(   RU   R   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRe   	  s    c         C@  s%   |  j  j d |  j d | f  d  S(   Ns   %s%s
s       (   RK  Rh   RO  (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR4  	  s    c         C@  s^   | p |  j  } | r' t | |  } n  t j |  } x! | j   D] } |  j |  qC Wd  S(   N(   R   R*  R   R/  R  R4  (   RU   t   chunkR   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt	   put_chunk	  s    c         C@  s   t  |  j j   |  j |  j  S(   N(   R0  RK  R  RO  R   (   RU   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  	  s    c         C@  s   t  |  | |  j    d  S(   N(   RA  R  (   RU   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   named_insertion_point	  s    N(   Ri   Rj   Rk   Rl   RZ   Ri  R/  R3  RV  Re   R4  R6  R  R7  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR0  	  s   					R  c           B@  s#   e  Z d    Z d   Z d   Z RS(   c         C@  s(   | |  _  i  |  _ i  |  _ d |  _ d  S(   Ni    (   t   klassRE  RF  t   temps_count(   RU   R8  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRZ   	  s    			c         C@  s7   x0 |  j  j   D] \ } } t |  |  j | <q Wd  S(   N(   RE  R   R   RF  (   RU   RM   R  (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   reset
  s    c         C@  s   | |  j  k r, g  |  j  | <g  |  j | <n! |  j | rM |  j | j d  Sd t j |  j f } |  j j d d  d | d | d | d t	  |  j  | j
 |  |  j d 7_ | S(	   Ni    s   %s%dR  R   R   RM   t   is_cdefi   (   RE  RF  Rn  R   Rp  R9  R8  t   declare_varRl   Rm   R   (   RU   RM   R   (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyRv  
  s    +(   Ri   Rj   RZ   R:  Rv  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyR  	  s   		(M   t
   __future__R    R*  t   declaret   objectR   R   Rt  t   sysR   R   R&  R   t	   functoolsR   t
   contextlibR   t   collectionsR   Rn  t   ImportErrorRo  R   R   R   R   R   R   R	   t   ScanningR
   R   t   __builtin__R   t   builtinsR   t   version_infoR   R  t   ctypedef_builtins_mapt   basicsize_builtins_mapt   uncachable_builtinsR|   R  Rb   R,  RH   Ru   Rv   R   Rl   R*  R+  R/  R3  R  R  R   R   t   UR   R  R   R  R   R  t   findallR  R  R  R  RE  RF  RI  R-  R0  R  (    (    (    s3   lib/python2.7/site-packages/Cython/Compiler/Code.pyt   <module>   s   !

			L	!O  B	
   -E