
[]c           @@ sT  d  d l  m Z m Z d  d l Z d d l m Z 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 Z d  d l Z d  d l Z d  d l Z d  d l m Z d  d l m Z d  d l m Z d  d l m Z d  d	 l m Z d  d l Z y d  d l Z e j Z d
 Z Wn e  k
 rDe Z d Z n Xy d  d l! Z! e j" Z# Wn e  k
 rze j$ Z# n Xy d  d l% Z% Wn d Z% n Xd d l m' Z' d d l' m( Z( m) Z) m* Z* m+ Z+ m, Z, m- Z- m. Z. d d l/ m0 Z0 m1 Z1 m2 Z2 e( e	 j3 j4  Z5 e( e,  Z6 e( e+  Z7 e j8 d  d k  rke j9   Z: e: d k r_e j;   Z: n  d   Z< n d   Z< e= Z> d d  Z? d   Z@ d d  ZA e( d    ZB d   ZC d   ZD eE   ZF eE   ZG eE   ZH i e= d 6eI d 6eI d 6eI d 6eG d 6eG d 6eG d 6eG d  6eI d! 6eG d" 6eG d# 6eI d$ 6eG d% 6eF d& 6eH d' 6ZJ e jK d( e jL d) e jL  d*    ZM d+ eE f d,     YZN e jK d( e jL d- e jL d. e jL d/ e jL d0 e jL d) e jL d1 e jL d2 e jL d3 e jL  	d4 d5   ZO e jP d6 e jQ  ZR e jP d7 e jQ  ZS d8   ZT e( d9    ZU d:   ZV e( d;    ZW e( d<    ZX e( d=    ZY e( d>    ZZ d? eE f d@     YZ[ d a\ d e] dA  Z^ dB   Z_ d d d e] d e] dC  Z` d d  d e] e] d e] dD  Za e	 jb jc dE  re	 jb dE Zd dF   Ze n	 dG   Ze ee d ef d d d dH   Zg dI   Zh dJ   Zi dK dL  Zj d S(M   i    (   t   absolute_importt   print_functionNi   (   t   __version__(   t   iglob(   t   open(   t   relpath(   t	   Extension(   t	   strtobools   .gzt    (   t   Utils(   t   cached_functiont   cached_methodt   path_existst   safe_makedirst   copy_file_to_dir_if_newert   is_package_dirt   replace_suffix(   t   Contextt   CompilationOptionst   default_optionsi   c         C@ s    t  |  t  s |  j t  S|  S(   N(   t
   isinstancet   bytest   encodet   _fs_encoding(   t   filename(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   encode_filename_in_py26   s    c         C@ s   |  S(   N(    (   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR   ;   s    c         C@ ss   | s t  j   } n  | d t  j j k r> | t  j j 7} n  g  |  D]* } | j |  ri t | |  n | ^ qE S(   Ni(   t   ost   getcwdt   patht   sept
   startswitht   _relpath(   t
   file_pathst   baseR   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   _make_relative@   s    c         c@ s  d |  k r~ t  j d |   } | r~ | j   \ } } } x; | j d  D]* } x! t | | |  D] } | Vqd WqI Wd  Sn  d |  k rjt   } |  j d d  \ } }	 | r t | d  } n	 d g } x | D] }
 x> t t |
 |	   D]' } | | k r | j |  | Vq q WxE t t |
 d d |	   D]' } | | k r8| j |  | Vq8q8Wq Wn x t |   D] } | VqwWd  S(	   Nt   {s   (.*){([^}]+)}(.*)t   ,s   **/i   t   /R   t   *(	   t   ret   matcht   groupst   splitt   extended_iglobt   setR   t	   join_patht   add(   t   patternt   mt   beforet   switcht   aftert   caseR   t   seent   firstt   restt   root(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR+   I   s2    		#s   expected non-empty iteratorc         c@ s;   t  } x |  D] } t } | Vq W| r7 t |   n  d  S(   N(   t   Truet   Falset
   ValueError(   t   itt	   error_msgt   emptyt   value(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   nonemptyg   s    	c         C@ s   t  j j |   } d t |  | f j d  } t j |  } t | d  ? } | j d  } x& | r | j	 |  | j d  } qd WWd  QX| j
   S(   Ns   %d:%ss   UTF-8t   rbi  (   R   R   t   normpatht   lenR   t   hashlibt   md5R   t   readt   updatet	   hexdigest(   R   R   t   prefixR0   t   ft   data(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt	   file_hashp   s    	c         C@ s/  t  d  k r t d   n  y t  j j d t  } Wn  t k
 rV t  j j   } n X|  j j | d  |  j	 j | d  |  j
 j | d  |  j j | d  |  j j | d  |  j j | d  |  j j | d	  d
 |  _ x< d d g D]. } y |  j	 j |  Wq t k
 r&q Xq Wd  S(   NsB   You first need to install Pythran to use the np_pythran directive.t   pythont   include_dirst   extra_compile_argst   extra_link_argst   define_macrost   undef_macrost   library_dirst	   librariess   c++s   -fwhole-programs   -fvisibility=hidden(   t   pythrant   Nonet   RuntimeErrort   configt   make_extensionR9   t	   TypeErrorRN   t   extendRO   RP   RQ   RR   RS   RT   t   languaget   removeR;   (   t   extt   pythran_extt
   bad_option(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   update_pythran_extension}   s&    	c         @ s   t  |   d k rH |  d d k rH |  d d k rH |  d d !}  d } n d } t |   \ }      f d	   } g  |  j |  D] } | j   r | |  ^ q S(
   s#  
    >>> parse_list("")
    []
    >>> parse_list("a")
    ['a']
    >>> parse_list("a b c")
    ['a', 'b', 'c']
    >>> parse_list("[a, b, c]")
    ['a', 'b', 'c']
    >>> parse_list('a " " b')
    ['a', ' ', 'b']
    >>> parse_list('[a, ",a", "a,", ",", ]')
    ['a', ',a', 'a,', ',']
    i   i    t   [it   ]i   R$   t    c         @ s3   |  j    }  |  d d k r+   |  d d !S|  Sd  S(   Ni    s   '"i   i(   t   strip(   t   literal(   t   literals(    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   unquote   s    (   RC   t   strip_string_literalsR*   Re   (   t   st	   delimiterRh   t   item(    (   Rg   si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt
   parse_list   s    2	t   namet   sourcesRQ   RR   RT   RS   t   runtime_library_dirsRN   t   extra_objectsRO   RP   t   export_symbolst   dependsR\   t
   np_pythrant   startt   endc         c@ s   t  |  t  rf d } xd t rb |  j d |  } | d k rI |  | Vd  S|  | | !V| d } q Wn x |  D] } | Vqm Wd  S(   Ni    s   
ii   (   R   t
   basestringR9   t   find(   t   sourceRu   Rv   t   line(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt	   line_iter   s    		t   DistutilsInfoc           B@ s2   e  Z d d d   Z d   Z d   Z d   Z RS(   c   
      @ s   i  |  _  | d  k	 rxt |  D]y    j       s@ q" n    d d k rT Pn    d j     t   f d   d D d   } | d  k	 r" g    t |  j d  D] } | j   ^ q \ } } } t j	 | d   }   j
 d  r | d  k r q" n  | t t f k rpt |  } | d k rpg  | D]6 }	 d |	 k rXt |	 j d d   n	 |	 d  f ^ q.} qpn  | t k rt |  } n  | |  j  | <q" q" WnZ | d  k	 rxK t D]@ } | d k rqn  t | | d   } | r| |  j  | <qqWn  d  S(   Ni    t   #i   c         3@ s$   |  ] }   j  |  r | Vq d  S(   N(   R   (   t   .0t   k(   Rz   (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pys	   <genexpr>   s    s
   distutils:s   cython:t   =RQ   Rn   Ro   Rt   (   s
   distutils:s   cython:(   s   names   sourcess
   np_pythran(   t   valuesRV   R{   t   lstript   nextRC   t	   partitionRe   t   distutils_settingst   getR   t   listt   transitive_listRm   t   tupleR*   t   bool_orR   t   getattr(
   t   selfRy   t   exnt   kindRj   t   keyt   _R?   t   typet   macro(    (   Rz   si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   __init__   s<    	; Fc         C@ s  | d  k r |  Sx | j j   D] \ } } t | } | t k ra | |  j k ra | |  j | <q  | t k r | |  j k r |  j | } x* | D]" } | | k r | j |  q q W| } n  | |  j | <q  | t k r  |  j j | t	  | B|  j | <q  q  W|  S(   N(
   RV   R   t   itemsR   t   transitive_strR   t   appendR   R   R:   (   R   t   otherR   R?   R   t   allt   v(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   merge   s"    
	'c         C@ s   | d  k r |  St   } x |  j j   D] \ } } t | } | t t g k r g  } xP | D]H } | | k r} | | } n  t | t  r | | 7} q^ | j |  q^ W| } n | | k r | | } n  | | j | <q) W| S(   N(	   RV   R|   R   R   R   R   R   R   R   (   R   t   aliasest   resolvedR   R?   R   t   new_value_listR   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   subs  s$    	
	c         C@ sl   xe |  j  j   D]T \ } } t | } | t t g k rT t | |  t |  } n  t | | |  q Wd  S(   N(   R   R   R   R   R   R   t   setattr(   R   t	   extensionR   R?   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   apply'  s
    
N(   t   __name__t
   __module__RV   R   R   R   R   (    (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR|      s    		t   qt   single_qt   double_qt	   hash_markR   t   countert	   quote_lent   __Pyx_Lc      
   C@ s  g  } i  } d } d } } t  } d } }	 }
 t |   } d } } xet r| | k  rp |  j d |  } n  |	 | k  r |  j d |  }	 n  |
 | k  r |  j d |  }
 n  t |	 |
  } | d k r t |	 |
  } n  | d k r| d k r| j |  |  PqI | re|  | d d k rd } x. | | k r\|  | | d k r\| d 7} q/W| d d k r| d 7} qI qn  |  | | k rX| d k s| | d k rX| |  | d k o|  | d k n rX| d 7} d	 | | f } |  | | | !| | <|  | | | !} | j |  | j |  | j |  | | 7} t  } | } q| d 7} qI d | k r'| | k  s| d k r'| j |  | | d ! |  j d
 |  } | d 7} d	 | | f } | d k rd } n | } |  | d | !| | <| j |  | d k rPn  | } } qI | | d k rp|  | |  | d k ob|  | d k n rpd } n d } t } |  | } | j |  | | ! | } | | 7} qI Wd j |  | f S(   s   
    Normalizes every string literal to be of the form '__Pyx_Lxxx',
    returning the normalized code and a mapping of labels to
    string literals.
    i    iR}   t   't   "i   u   \i   s   %s%s_s   
i   R   N(	   R:   RC   RV   R9   Rx   t   mint   maxR   t   join(   t   codeRI   t   new_codeRg   R   Ru   R   t   in_quoteR   R   R   t   code_lent
   quote_typeR   R   t   labelt
   full_quoteRv   t   end_or_none(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyRi   /  s    


	#
	H

	$
	@	
s   (?:^\s*from +([0-9a-zA-Z_.]+) +cimport)|(?:^\s*cimport +([0-9a-zA-Z_.]+(?: *, *[0-9a-zA-Z_.]+)*))|(?:^\s*cdef +extern +from +['\"]([^'\"]+)['\"])|(?:^\s*include +['\"]([^'\"]+)['\"])sC   (?:^\s+\(([0-9a-zA-Z_., ]*)\)[#\n])|(?:^\s+([0-9a-zA-Z_., ]*)[#\n])c         C@ s%   t  t j j |   t t |    S(   N(   t   normalize_existing0R   R   t   dirnameR   R,   (   t	   base_patht	   rel_paths(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   normalize_existing  s    c         C@ s   g  } d } x} | D]u } t j j |  r> | j |  q n  t |  |  } t |  r{ | j t j j |   |  } q | j |  q W| | f S(   s  
    Given some base directory ``base_dir`` and a list of path names
    ``rel_paths``, normalize each relative path name ``rel`` by
    replacing it by ``os.path.join(base, rel)`` if that file exists.

    Return a couple ``(normalized, needed_base)`` where ``normalized``
    if the list of normalized file names and ``needed_base`` is
    ``base_dir`` if we actually needed ``base_dir``. If no paths were
    changed (for example, if all paths were already absolute), then
    ``needed_base`` is ``None``.
    N(   RV   R   R   t   isabsR   R-   R   RB   (   t   base_dirR   t
   normalizedt   needed_baset   relR   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR     s    	c         C@ sR   t  |  } g  } x9 |  D]1 } t | |  } | d  k	 r | j |  q q W| S(   N(   R   t   resolve_dependRV   R   (   Rs   RN   R   t   dependR   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   resolve_depends  s    c         C@ sd   |  d d k r$ |  d d k r$ d  Sx9 | D]1 } t | |   } t |  r+ t j j |  Sq+ Wd  S(   Ni    t   <it   >(   RV   R-   R   R   R   RB   (   R   RN   t   dirR   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR     s     c         C@ sa   t  j j t  j j t |     } | |  k rY t |  rY t |  t  j j |  f Sd Sd  S(   N(    (   R   R   R   t   abspatht   strR   t   packaget   basename(   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR     s    $c         C@ s<   t  j j t  j j |    d } d j t |   | f  S(   Ni    t   .(   R   R   t   splitextR   R   R   (   R   t   module(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   fully_qualified_name  s    "c         @ s  t  j |  d d  } | j   } Wd  QXt |  } t |  \ } } | j d d  j d d  } g  } g  } g  } xt j |  D] } | j   \   }	 }
 }   r$| j	    t
 j | d | j   } | rx| j   \ } } | p | } | j   f d   | j d  D  qxq |	 rM| j d	   |	 j d  D  q |
 rg| j	 | |
  q | j	 | |  q W| | | | f S(
   Nt   error_handlingt   ignores   \
Rd   s   	t   posc         3@ s'   |  ] } d  j    | j    Vq d S(   s   {0}.{1}N(   t   formatRe   (   R~   Rj   (   t   cimport_from(    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pys	   <genexpr>  s   R$   c         s@ s   |  ] } | j    Vq d  S(   N(   Re   (   R~   t   x(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pys	   <genexpr>  s    (   R	   t   open_source_fileRF   R|   Ri   t   replacet   dependency_regext   finditerR)   R   t   dependency_after_from_regext   searchRv   R[   R*   (   t   source_filenamet   fhRy   t   distutils_infoRg   t   cimportst   includest   externsR0   t   cimport_listt   externt   includet   m_after_fromt	   multilinet   one_linet
   subimports(    (   R   si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   parse_dependencies  s0    #t   DependencyTreec           B@ s   e  Z e d   Z d   Z e d    Z e d    Z d   Z d   Z	 d   Z
 e d d   Z e d    Z e d	    Z d
   Z e d    Z d   Z d   Z d   Z d   Z d d d  Z d   Z d   Z RS(   c         C@ s   | |  _  | |  _ i  |  _ d  S(   N(   t   contextt   quiett   _transitive_cache(   R   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR     s    		c         C@ s+   t  |  r! t j j |  } n  t |  S(   N(   R   R   R   RB   R   (   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR     s    c         C@ s   t    } x |  j |  d D] } t t j j |  |  } t |  sb |  j j | d   } n  | r d t j j
 | k r t j j |  } n  | j |  | j |  j |   q |  j s t d | | f  q q W| S(   Ni   R   s*   Unable to locate '%s' referenced from '%s'(   R,   R   R-   R   R   R   R   R   t   find_include_fileRV   R   RB   R.   RG   t   included_filesR   t   print(   R   R   R   R   t   include_path(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR   	  s    		c         C@ s   |  j  |  d  \ } } } t |  } t |  } t   } xV |  j |  D]E } |  j |  \ } } }	 | j |  | j |  | j |	  qM Wt | |  \ } }
 |
 r | j |
  n  t |  | | f S(   Ni   (   R   R,   R   t   cimports_externs_incdirsRG   R   R.   R   (   R   R   R   R   R   t   incdirsR   t   included_cimportst   included_externst   included_incdirst   incdir(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR     s    	c         C@ s   |  j  |  d S(   Ni    (   R   (   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR   -  s    c         C@ s
   t  |  S(   N(   R   (   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR   0  s    c         C@ s
   t  |  S(   N(   R   (   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR   3  s    c         C@ s  | d d k } | r, | r, t  d   n  | d  k	 r | j d  } | r] | j d  n  t |  j |   } xE | r | d r y | j   Wn t k
 r d  SX| j d  qu Wd j | |  } |  j j	 | d   } | r | Sn  | r d  S|  j j	 | d   S(   Ni    R   s   New relative imports.(
   t   NotImplementedErrorRV   R*   t   popR   R   t
   IndexErrorR   R   t   find_pxd_file(   R   R   R   t   is_relativet   module_patht   package_patht   relativet   pxd(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   find_pxd6  s*    c         C@ s   | d d k r8 t  | d  d  r8 | d  d g } n g  } xg |  j |  D]V } | d  d k sN | d k rv qN n  |  j | |  } | d  k	 rN | j |  qN qN Wt |  S(   Nis   .pyxs   .pxdi   s   cython.t   cython(   R   R   R  RV   R   R   (   R   R   t   pxd_listR   t   pxd_file(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   cimported_filesN  s    $c         C@ s?   t  | g  } | j |  j |   | j |  j |   | S(   N(   R,   RG   R  R   (   R   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   immediate_dependencies^  s    c         C@ s   |  j  | |  j t j  S(   N(   t   transitive_mergeR  R,   t   union(   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   all_dependenciese  s    c         C@ s   t  j j |  S(   N(   R   R   t   getmtime(   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt	   timestamph  s    c         C@ s   |  j  |  | f S(   N(   R  (   R   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   extract_timestampl  s    c         C@ s/   t  g  |  j |  D] } |  j |  ^ q  S(   N(   R   R	  R  (   R   R   RJ   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   newest_dependencyo  s    c         C@ s  y t  j t j d   } | j t |  j d   xX t |  j |   D]A } t j	 j
 |  d d	 k rM | j t |  j d   qM qM W| j t | j t | d t  t | d t  f  j d   | j | j   j d   | j   SWn t k
 rd SXd S(
   s;  
        Return a fingerprint of a cython file that is about to be cythonized.

        Fingerprints are looked up in future compilations. If the fingerprint
        is found, the cythonization can be skipped. The fingerprint must
        incorporate everything that has an influence on the generated code.
        s   UTF-8i   s   .cs   .cpps   .ht   py_limited_apiRt   N(   s   .cs   .cpps   .h(   RD   RE   R   R   RG   RL   t   sortedR	  R   R   R   R   R\   R   R:   t   get_fingerprintRH   t   IOErrorRV   (   R   R   R   t   compilation_optionsR0   R   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   transitive_fingerprintr  s    #	
c   
      C@ s   |  j  |  d } | j } |  j |  \ } } } t j   } | r t | |  } d | k r t t | d  j |   | d <q t |  | d <n  | r t | j	 d g    } x3 t | |  D]" }	 |	 | k r | j
 |	  q q W| | d <n  | S(   Ni   Rs   RN   (   R   R   R   R   R   R"   R   R,   R  R   R   (
   R   R   t   infot   kwdsR   R   R   t   basedirRN   t   inc(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   distutils_info0  s     	&c         C@ s+   |  j  | |  j t j  j |  j |  S(   N(   R  R  R|   R   R   (   R   R   R   R!   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR     s    	c         C@ se   y |  j  | | f } Wn( t k
 rA i  } |  j  | | f <n X|  j | | | | i  |  j  d S(   Ni    (   R   t   KeyErrort   transitive_merge_helperR  (   R   t   nodet   extractR   R5   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR    s    c         C@ s  | | k r | | d  f S| |  } | | k r< | | f Sz t |  | | <d  } x | |  D]q }	 |  j |	 | | | | |  \ }
 } | d  k	 r | d  k	 r | | | | k  r q | } n  | | |
  } qb W| | k r d  } n  | d  k r| | | <n  | | f SWd  | | =Xd  S(   N(   RV   RC   R  (   R   R  R  R   R5   t   stackt   outgoingt   depst   loopR   t   sub_depst   sub_loop(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR    s*    
$ 		N(   R   R   R:   R   R   R   R   R   R   R   R   RV   R  R  R  R	  R  R  R  R  R  R   R  R  (    (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR     s(   										c         C@ sL   t  d  k rH |  d  k r3 t d g t t   }  n  t |  d | a  n  t  S(   NR   R   (   t	   _dep_treeRV   R   R   R   R   (   t   ctxR   (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   create_dependency_tree  s
    c         C@ s   d | k rX | j  d g   d g } t | d |  } t t | |  j   | d <n  |  j } | |   } t d | d | d  } | | f S(   NRs   RN   R   t	   distutilst   module_nameRn   (   R   R   R  R,   Rs   t	   __class__t   dict(   t   templateR  RN   Rs   t   tR^   t   metadata(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   default_create_extension  s     	c   $      C@ s  | d  k	 r" t d j |   n  | d  k r7 g  } n  |  d  k rM g  i  f St |  t  so t |  t j  r{ |  g }  n  t g  |  D] } t | t  r | j	 ^ q  } t   }	 t
 | d | }
 t   } t | t  s | g } n  x0 | D]( } | j t t j j t |    q Wg  } i  } d t j k r\t j d j } t j d j } n t } d t f d     Y} | j j pt } x|  D]} t | t  r| } t | g   } d } d  } | } n t | | | f  rg  | j D]( } t j j |  d d k r| ^ q} | r\| d } t |  d k rlt d | j	 | f  qln | j |  q| } | j	 } t d |  } d  } n4 t d t t  t |  | j  f  } t! |   xt" t# t |   d |  D]} t j j |  | k rqn  |
 j$ |  } d | k r;| | k rJqqJn | rJ| } n  t% j& |  | |	 k ry |
 j' | | |  j( } Wn  t) k
 r| rqn    n X| d  k	 rx9 | j( j*   D]% \ } } | | k r| | | <qqWn  | | d <| g g  | j D] } | | k r| ^ q} d | k rox= | d D]. }  t+ |   }  |  | k r:| j |   q:q:Wn  | | d <| rd | k r| | d <n  | j, d t-  }! | | |  \ } }" |! pt. | d t-  | _/ | j/ rt0 |  n  | j |  |" | | <| | j k rt j j |  d | j1 d k r>d n d }# y | j j2 |#  Wn t3 k
 rzt d |  n X| j j4 d |  n  |	 j5 |  qqWqW| | f S(   Ns   Warning: passing language={0!r} to cythonize() is deprecated. Instead, put "# distutils: language={0}" in your .pyx or .pxd file(s)R   t
   setuptoolss   setuptools.extensiont   Extension_setuptoolsc           B@ s   e  Z RS(    (   R   R   (    (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR/    s    R&   i   s   .pys   .pyxi    s   Warning: Multiple cython sources found for extension '%s': %s
See http://cython.readthedocs.io/en/latest/src/userguide/sharing_declarations.html for sharing declarations among Cython files.R   sU   pattern is not of type str nor subclass of Extension (%s) but of type %s and class %ss   '%s' doesn't match any filesRn   Ro   R\   Rt   s   c++s   .cpps   .cs@   Warning: Cython source file not found in sources list, adding %s(   s   .pys   .pyx(6   RV   R   R   R   Rw   t   collectionst   IterableR,   R   Rn   R%  R   RG   t   mapR   R   R   R+   t   syst   modulest
   _Extensiont   optionst   create_extensionR-  R   Ro   R   RC   R   R|   t   reprR   R(  RZ   R@   R  R   R	   t$   raise_error_if_module_name_forbiddenR   R   t	   ExceptionR   R   R   R:   R   Rt   Ra   R\   R]   R;   t   insertR.   ($   t   patternst   excludeR$  R   R   R\   t   exclude_failuresR0   t   explicit_modulesR5   R  t
   to_excludeR/   t   module_listt   module_metadatat   Extension_distutilsR/  R7  t   filepatternR*  Rn   R!   t   ext_languageRj   t   cython_sourcest   msgt   fileR'  R  R   R?   Ro   Ry   Rt   R,  t   target_file(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   create_extension_list  s    		
"1		&	(
				&		
/
	
/c   ,      @ s^  | d k r g  } n  d | k r1 d g | d <n  d | k rN t | d  n  t d k rc d }	 n t |   }	 t |	 _ t |	 _ t |   }
 t |   } t | _ |
 j   } |
 } t |  d | d | d | d | d | d	 | \ }  } t	 | d | } t
 | d
 d    t j     f d  } t j t  } g  } x|  D]}   rox | j D] } | |  qXWn  g  | j D]( } t j j |  d d( k ry| ^ qy} t |  d k r| j } n d } g  } xi| j D]^} t j j |  \ } } | d) k r| j r!| d } |	 } n2 | j d k rC| d } | } n | d } |
 }   rt j j |  r{t j d  n  t j j   |  } t j j |  } t |  n  t j j |  rt j j |  } n d } | | j |  k  r| j |  | } } d } n. | j  |  \ } } d | | j! |  k } | sP| | k  r| r| r| | k r{t" d |  qt" d | | f  n  | r| j# r| j$ | | |  } n d } | j% | | | | | | | | j& | j  | f	  n  | j% |  | | j% |  q| j% |    r| |  qqW| | _ qBW| j# r~t j j | j#  s~t j' | j#  q~n  | j(   t |  }  d t t) |    }! xC t* |   D]5 }" |! j+ |" d |   }# | |" d |# f | |" <qW|  d k rd } n  | ry% d d l, }$ |$ j- | d t. }% Wn' t/ t0 f k
 rYt" d  d } qXya |% j1 t2 | d d }& |% j3   x8 |& j4   sy |& j& d  Wq|$ j5 k
 rqXqWWn t6 k
 r|% j7     n X|% j   n  | sx | D] }' t8 |'   qWn  | r%t9   }( x | j:   D] \ } }) t j j |  sW|( j; |)  q)t j j< |  d k  r)t= | d d  d! }* z/ |* j> t d"   d" k r|( j; |)  n  Wd |* j3   Xq)q)W|( r%x |( D] }+ |  j? |+  qWt" d# d$ j t@ g  |( D] }+ |+ j ^ q   q%n  | j# rMtA | j# t
 | d% d+   n  tB jC jD   |  S(,   s  
    Compile a set of source modules into C/C++ files and return a list of distutils
    Extension objects for them.

    :param module_list: As module list, pass either a glob pattern, a list of glob
                        patterns or a list of Extension objects.  The latter
                        allows you to configure the extensions separately
                        through the normal distutils options.
                        You can also pass Extension objects that have
                        glob patterns as their sources. Then, cythonize
                        will resolve the pattern and create a
                        copy of the Extension for every matching file.

    :param exclude: When passing glob patterns as ``module_list``, you can exclude certain
                    module names explicitly by passing them into the ``exclude`` option.

    :param nthreads: The number of concurrent builds for parallel compilation
                     (requires the ``multiprocessing`` module).

    :param aliases: If you want to use compiler directives like ``# distutils: ...`` but
                    can only know at compile time (when running the ``setup.py``) which values
                    to use, you can use aliases and pass a dictionary mapping those aliases
                    to Python strings when calling :func:`cythonize`. As an example, say you
                    want to use the compiler
                    directive ``# distutils: include_dirs = ../static_libs/include/``
                    but this path isn't always fixed and you want to find it when running
                    the ``setup.py``. You can then do ``# distutils: include_dirs = MY_HEADERS``,
                    find the value of ``MY_HEADERS`` in the ``setup.py``, put it in a python
                    variable called ``foo`` as a string, and then call
                    ``cythonize(..., aliases={'MY_HEADERS': foo})``.

    :param quiet: If True, Cython won't print error and warning messages during the compilation.

    :param force: Forces the recompilation of the Cython modules, even if the timestamps
                  don't indicate that a recompilation is necessary.

    :param language: To globally enable C++ mode, you can pass ``language='c++'``. Otherwise, this
                     will be determined at a per-file level based on compiler directives.  This
                     affects only modules found based on file names.  Extension instances passed
                     into :func:`cythonize` will not be changed. It is recommended to rather
                     use the compiler directive ``# distutils: language = c++`` than this option.

    :param exclude_failures: For a broad 'try to compile' mode that ignores compilation
                             failures and simply excludes the failed extensions,
                             pass ``exclude_failures=True``. Note that this only
                             really makes sense for compiling ``.py`` files which can also
                             be used without compilation.

    :param annotate: If ``True``, will produce a HTML file for each of the ``.pyx`` or ``.py``
                     files compiled. The HTML file gives an indication
                     of how much Python interaction there is in
                     each of the source code lines, compared to plain C code.
                     It also allows you to see the C/C++ code
                     generated for each line of Cython code. This report is invaluable when
                     optimizing a function for speed,
                     and for determining when to :ref:`release the GIL <nogil>`:
                     in general, a ``nogil`` block may contain only "white" code.
                     See examples in :ref:`determining_where_to_add_types` or
                     :ref:`primes`.

    :param compiler_directives: Allow to set compiler directives in the ``setup.py`` like this:
                                ``compiler_directives={'embedsignature': True}``.
                                See :ref:`compiler-directives`.
    R   R   t   common_utility_include_dirR=  R$  R   R>  R\   R   t	   build_dirc         @ st   t  j j |   } t  j j |   r- | }  n  | j |  rp t   t  j j t |  |    } t | |  n  d  S(   N(	   R   R   R   R   R   R-   R   R   t   copy_once_if_newer(   t   filepathR8   t   filepath_abst   mod_dir(   RL  (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   copy_to_build_dir  s    	i   s   .pyxs   .pys   .cpps   c++s   .cs1   build_dir has no effect for absolute source pathsii    i   s    Compiling %s because it changed.s&   Compiling %s because it depends on %s.s   [{0:%d}/{1}] Nt   initializers3   multiprocessing required for parallel cythonizationt	   chunksizei i   t   rt   encodings	   iso8859-1s   #error s   Failed compilations: %ss   , t
   cache_sizei   id   (   s   .pyxs   .py(   s   .pyxs   .pyi   i  @(E   RV   R   RU   R   R9   t   cplusRt   t   create_contextRJ  R%  R   R   R   R0  t   defaultdictR   Rs   Ro   R   R   RC   Rn   R\   R   t   warningst   warnR   R   t   safe_makedirs_oncet   existsR
  R  R  R  R   t   cacheR  R   R   t   makedirst   sortR   t   rangeR   t   multiprocessingt   Poolt   _init_multiprocessing_helpert   ImportErrort   OSErrort	   map_asynct   cythonize_one_helpert   closet   readyt   TimeoutErrort   KeyboardInterruptt	   terminatet   cythonize_oneR,   R   RG   t   getsizet   io_openRF   R]   R  t   cleanup_cacheR3  t   stdoutt   flush(,   RA  R=  t   nthreadsR   R   t   forceR\   R>  R6  t   pythran_optionst	   c_optionst   cpp_optionsR$  RB  R  RQ  t   modules_by_cfilet
   to_compileR0   t   depRy   t
   cy_sourcest   full_module_namet   new_sourcesR!   R^   t   c_fileR   t   c_timestampt   dep_timestampt   priorityt   fingerprintt   Nt   progress_fmtt   it   progressRb  t   poolt   resultt   argst   failed_modulesR4  RJ   R   (    (   RL  si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt	   cythonizek  s   B				 	
(	
	
	
		
	



	*	t   XML_RESULTSc         @ s     f d   } | S(   Nc          @ s   t  j    } t } z" y   |    Wn t } n XWd  t  j    | } t |  d  } d | } d | } | rz d } n d } t t j j t | d  d  } | j	 d j
   t    | j   Xd  S(	   Ni    s
   cythonize.i   R   t   failures   .xmlt   wsQ  
                    <?xml version="1.0" ?>
                    <testsuite name="%(name)s" errors="0" failures="%(failures)s" tests="1" time="%(t)s">
                    <testcase classname="%(name)s" name="cythonize">
                    %(failure_item)s
                    </testcase>
                    </testsuite>
                (   t   timeR9   R:   R   R   R   R   R   t   compile_result_dirt   writeRe   t   localsRi  (   R  R+  t   successR   Rn   t   failurest   failure_itemt   output(   t   func(    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   with_recordh  s$    

	"(    (   R  R  (    (   R  si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   record_resultsg  s    c         C@ s   |  S(   N(    (   R  (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyR    s    c	         C@ s7  d d l  m }	 m }
 d d l m } m } | rt j j | j	  sW t
 | j	  n  t | j	 d t j j |  | f  } | t } | d } t j j |  s t j j |  r| s t d | |  f  n  t j j |  rKt j | d   t j t | d   8 } t j t | d    } t j | |  Wd  QXWd  QXny t j | d   t j j |  } t j t j |   = } x3 | j   D]% } | j | t j j | |   qWWd  QXd  Sn  | st d	 | |  f  n  | d  k rt |
  } n  | | _ | | _ d
 } y1 |	 |  | d | } | j  d
 k rKd } n  Wn t! | f k
 r} t" j# j$ d |  d } d
 d  l% } | j&   n9 t' k
 r| r  n  d
 d  l% } | j&   d } n X| r| r| d  |    q3t j j |  r3t j( |  q3n | r3t) t* d  g  d D] } t+ | | d   ^ q)  } t, |  d k r| } t j t | d   < } t j t | d d    } t j | |  Wd  QXWd  QXn^ | } t j t j | d d t-   4 } x* | D]" } | j$ | t j j |   qWWd  QXt j. | d |  n  d  S(   Ni   (   t   compile_singleR   (   t   CompileErrort
   PyrexErrors   %s-%ss   .zips   %sFound compiled %s in cacheRA   t   wbs   %sCythonizing %si    R}  i   s   %s
R  t   h_filet   api_filet   i_files   .tmpR  (   s   c_files   h_files   api_files   i_file(/   t   Compiler.MainR  R   t   Compiler.ErrorsR  R  R   R   R]  R^  R   R-   R   t   gzip_extR   t   utimeRV   t
   contextlibt   closingt	   gzip_openR   t   shutilt   copyfileobjR   t   zipfilet   ZipFilet   namelistR  R   R   t   output_filet   embedded_metadatat
   num_errorst   EnvironmentErrorR3  t   stderrR  t	   tracebackt	   print_excR:  R]   R   t   filterR   RC   t   zipfile_compression_modet   rename(   t   pyx_fileR  R  R   R6  t   raise_on_failureR  R}  R  R  R   R  R  t   fingerprint_file_baset   gz_fingerprint_filet   zip_fingerprint_filet   gRJ   R   t   zt   artifactt   any_failuresR  t   eR  t   attrt	   artifactst   fingerprint_filet   zip(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyRn    s    %

$)		

	(&c         C@ s?   d d  l  } y t |    SWn t k
 r: | j     n Xd  S(   Ni    (   R  Rn  R:  R  (   R0   R  (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyRh    s    
c          C@ s&   d d  l  }  |  j  |  j |  j  d  S(   Ni    (   t   signalt   SIGINTt   SIG_IGN(   R  (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyRd    s    g333333?c         C@ ss  y t  j d d d t j j |   g d t  j } | j   } | d k r d t | j j	   j
   j   d  } | | k  r d  Sn  Wn t t f k
 r n Xd } g  } x^ t j |   D]M } t |  |  } t j |  }	 | |	 j 7} | j |	 j |	 j | f  q W| | k roxQ t t |   D]: \ }
 } } t j |  | | 8} | | | k  r.Pq.q.Wn  d  S(   Nt   dus   -ss   -kRr  i    i   (   t
   subprocesst   PopenR   R   R   t   PIPEt   waitt   intRr  RF   Re   R*   Rf  R;   t   listdirR-   t   statt   st_sizeR   t   st_atimet   reversedR  t   unlink(   R^  t   target_sizet   ratiot   pt   rest
   total_sizeR   RH  R   Rj   R  t   size(    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyRq    s,    0) "
(k   t
   __future__R    R   R  R   R   R0  R  RD   R   R  R  R'   R3  R  RZ  t   globR   t   ioR   Rp  t   os.pathR   R   t   distutils.extensionR   t   distutils.utilR   R  t   gzipR  R  Re  t   zlibt   ZIP_DEFLATEDR  t
   ZIP_STOREDRU   RV   R	   R
   R   R   R   R   R   R   R  R   R   R   R   R   R-   RM  R\  t   version_infot   getfilesystemencodingR   t   getdefaultencodingR   R   Rw   R"   R+   R@   RL   Ra   Rm   t   objectR   R   R   R   R   R  t
   Py_ssize_tR{   R|   Ri   t   compilet   MR   R   R   R   R   R   R   R   R   R   R#  R:   R%  R-  RJ  R  t   environR   R  R  R9   Rn  Rh  Rd  Rq  (    (    (    si   /home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python2.7/site-packages/Cython/Build/Dependencies.pyt   <module>   s   $	


4									
'TY			
	#			K			