
Xc        )   @` s  d  d l  m Z m Z 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 y d  d l m Z Wn! e k
 r d  d l m Z n Xe   Z g  Z d   Z e	 j e  y e Wn! e k
 r,d  d l m Z n Xd  d l m Z d  d l m  Z  d  d	 l m! 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" d# d$ d% d& d' d( d) d* d+ d, d- d. d/ d0 d1 d2 g) Z" d3 e# f d4     YZ$ d5   Z% d6   Z& d7   Z' d8   Z( e) d9  Z* d:   Z+ e) d;  Z, d<   Z- d=   Z. d> e/ d?  Z0 d> d> e/ d@  Z1 dA   Z2 e2   re3 dB d  dC dD dE dF dG dH dI dJ dK dL dM dN dO dP dQ dR  	Z4 e) e) e5 dS  Z6 n e) e) dT  Z6 dU   Z7 dV   Z8 dW   Z9 dX   Z: dY   Z; dZ   Z< d[   Z= d\   Z> d]   Z? e j@ d^ e jA  jB ZC e j@ d_ e jA  jB ZD e j@ d` e jA  jB ZE e j@ da e jA  jB ZF db   ZG dc   ZH dd   ZI de   ZJ df   ZK dg   ZL dh   ZM di   ZN dj   ZO dk   ZP dl   ZQ dm   ZR dn   ZS do   ZT dp   ZU dq   ZV dr   ZW ds   ZX dt   ZY e5 du  ZZ dv   Z[ dw   Z\ d  dx  Z] d
 e# f dy     YZ^ i  dz  Z_ d{   Z` d|   Za e) d}  Zb e) d~  Zc d   Zd e) e) e) d  Ze d   Zf d   Zg d   Zh d   Zi e jj dH  d k rd   Zk n	 d   Zk d S(   i    (   t   divisiont   absolute_importt   print_functionN(   t   DistutilsError(   t   localc          C` sI   t  d  k	 rE x6 t  D]+ }  y t j |   Wq t k
 r= q Xq Wn  d  S(   N(   t   _tmpdirst   Nonet   shutilt   rmtreet   OSError(   t   d(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   clean_up_temporary_directory   s    (   t   Set(   t   get_exception(   t
   basestring(   t   npy_load_modulet   Configurationt   get_numpy_include_dirst   default_config_dictt   dict_appendt
   appendpatht   generate_config_pyt   get_cmdt   allpatht   get_mathlibst   terminal_has_colorst   red_textt
   green_textt   yellow_textt	   blue_textt	   cyan_textt	   cyg2win32t   mingw32t   all_stringst   has_f_sourcest   has_cxx_sourcest   filter_sourcest   get_dependenciest   is_local_src_dirt   get_ext_source_filest   get_script_filest   get_lib_source_filest   get_data_filest   dot_joint	   get_framet
   minrelpatht   njoint   is_sequencet	   is_stringt   as_listt   gpathst   get_languaget
   quote_argst   get_build_architecturet   get_infot   get_pkg_infot   get_num_build_jobst   InstallableLibc           B` s   e  Z d  Z d   Z RS(   s  
    Container to hold information on an installable library.

    Parameters
    ----------
    name : str
        Name of the installed library.
    build_info : dict
        Dictionary holding build information.
    target_dir : str
        Absolute path specifying where to install the library.

    See Also
    --------
    Configuration.add_installed_library

    Notes
    -----
    The three parameters are stored as attributes with the same names.

    c         C` s   | |  _  | |  _ | |  _ d  S(   N(   t   namet
   build_infot
   target_dir(   t   selfR:   R;   R<   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   __init__O   s    		(   t   __name__t
   __module__t   __doc__R>   (    (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR9   9   s   c          C` s   d d l  m }  t t j j d d   } |    } | d k rD | St | j d  d d  t | j d  d d  t | j d  d d  f } t	 d	   | D  r | St
 d
   | D  Sd S(   sG  
    Get number of parallel build jobs set by the --parallel command line
    argument of setup.py
    If the command did not receive a setting the environment variable
    NPY_NUM_BUILD_JOBS checked and if that is unset it returns 1.

    Returns
    -------
    out : int
        number of parallel jobs that can be run

    i    (   t   get_distributiont   NPY_NUM_BUILD_JOBSi   t   buildt   parallelt	   build_extt
   build_clibc         s` s   |  ] } | d  k Vq d  S(   N(   R   (   t   .0t   x(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pys	   <genexpr>m   s    c         s` s!   |  ] } | d  k	 r | Vq d  S(   N(   R   (   RH   RI   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pys	   <genexpr>p   s    N(   t   numpy.distutils.coreRB   t   intt   ost   environt   getR   t   getattrt   get_command_objt   allt   max(   RB   t   envjobst   distt   cmdattr(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR8   U   s    	c         C` sd   t  |   }  xQ t t |    D]= } |  | } d | k r | d d k r d | |  | <q q W|  S(   Nt    i    s   "'s   "%s"(   t   listt   ranget   len(   t   argst   it   a(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR4   r   s    
c         C` s   |  j  d  } t j j |   S(   sD   Convert a /-separated pathname to one using the OS's path separator.t   /(   t   splitRL   t   patht   join(   R:   t   splitted(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   |   s    c         C` s   t  j j t  j j |   } t  j j t  j j |    } t |  t |  k  rX |  S| | k rh d S| | t |   k r | t |  t  j g k s t t |  | t |  f    | t |  d }  n  |  S(   s$   Return path relative to parent_path.t    i   (   RL   R_   t   realpatht   abspathRY   t   sept   AssertionErrort   repr(   R_   t   parent_patht   pdt   apath(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   rel_path   s    >c         C` s   y: t  d |  j |  j  } t j j t j j |   } Wn t k
 r t  d |  j |  j  } t |  t	 j
 | } t | d  r t j j t j j | j   } q t j j d  } n X| d k	 r t | |  } n  | p d S(   s   Return path of the module given a frame object from the call stack.

    Returned path is relative to parent_path when given,
    otherwise it is absolute path.
    t   __file__R?   t   .N(   t   evalt	   f_globalst   f_localsRL   R_   t   dirnameRd   t	   NameErrort
   __import__t   syst   modulest   hasattrRl   R   Rk   (   t   frameRh   t   caller_fileR
   t   caller_namet   mod(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   get_path_from_frame   s    "
$c          G` s   g  } xO |  D]G } t  |  r5 | j t |    q t |  sG t  | j |  q W| }  |  sm d } n t j j |    } t j j d k r | j	 d t j j  } n  t
 |  S(   s2  Join two or more pathname components +
    - convert a /-separated pathname to one using the OS's path separator.
    - resolve `..` and `.` from path.

    Either passing n arguments as in njoin('a','b'), or a sequence
    of n names as in njoin(['a','b']) is handled, or a mixture of such arguments.
    Rb   R]   (   R/   t   appendR.   R0   Rf   RL   R_   R`   Re   t   replaceR-   (   R_   t   pathst   pt   joined(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR.      s    	c   	      C` s   |  d k	 r$ t j j |  d  } n^ t   } xR | D]7 }  t j j |  d  } t j j |  r4 | } Pq4 q4 Wt d | f   t |  } g  } d } xU | D]M } | j |  r | t	 |  j
   } | r | j | j d   q q q W| j   | S(   s/   Return the MATHLIB line from numpyconfig.h
    s   _numpyconfig.hs1   _numpyconfig.h not found in numpy include dirs %rs   #define MATHLIBt   ,N(   R   RL   R_   R`   R   t   existsR   t   opent
   startswithRY   t   stript   extendR^   t   close(	   R_   t   config_filet   dirst   fnt   fidt   mathlibst   st   linet   value(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR      s(    	 
c         C` s  t  |   s |  Sd |  k r  |  S|  j t j  } x< | rp y | j d d  } Wn t k
 re Pn X| | =q5 Wd } xn | r y | j d |  } Wn t k
 r Pn X| | d d k r | d 7} qz | | =| | d =d } qz W| s d St j j |  S(   s$   Resolve `..` and '.' from path.
    Rm   i   s   ..Rb   (   R0   R^   RL   Re   t   indext
   ValueErrorR`   (   R_   t   lR[   t   j(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR-      s0    		
c         C` s  t  |   s$ t t t |      g  } t |   sI t t |     x||  D]t} t |  rd | k sz d | k r t j |  } t j t | |   } | r | j |  q| r | j |  q| r | j |  n  t	 d | | f  qt | |  } t
 j j |  r+| j |  qt
 j j |  rM| j |  n | rc| j |  n  t
 j j |  st	 d | | f  qqP t  |  r| j t | | |   qP | j |  qP Wg  | D] } t |  ^ qS(   Nt   *t   ?s#   could not resolve pattern in %r: %rs   non-existing path in %r: %r(   R/   Rf   Rg   t   typeR0   t   globR.   R   R|   t   printRL   R_   R   t
   _fix_pathsR-   (   R~   t
   local_patht   include_non_existingt	   new_pathst   nR   t   p2t   n2(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR     s<    $Rb   c         C` s(   t  |   r |  f }  n  t |  | |  S(   s:   Apply glob to paths and prepend local_path if needed.
    (   R0   R   (   R~   R   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR2   '  s    c      	   C` sz   t  t d  s1 t j   t _ t j t j  n  t j d |  d | d t j d |  \ } } t j	 | d  } | | f S(   Nt   tempdirt   suffixt   prefixt   dirt   textt   w(
   Rv   t   _tdatat   tempfilet   mkdtempR   R   R|   t   mkstempRL   t   fdopen(   R   R   R   R   R:   t   fo(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   make_temp_file.  s    	c          C` s  t  j d k r" d t j k r" d St t  j d  rt  j j   ry d d  l }  |  j   |  j	 d  d k r |  j	 d  d k r |  j
 d  d  k	 r |  j
 d  d  k	 s |  j
 d	  d  k	 r |  j
 d
  d  k	 s |  j
 d  d  k	 r d SWqt k
 rqXn  d S(   Nt   cygwint	   USE_COLORi    t   isattyt   colorst   pairst   setft   setbt   setaft   setabt   scpi   (   Rt   t   platformRL   RM   Rv   t   stdoutR   t   cursest	   setuptermt   tigetnumt   tigetstrR   t	   Exception(   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   ;  s"    	!
t   blackt   redi   t   greeni   t   yellowi   t   bluei   t   magentai   t   cyani   t   whitei   t   defaulti	   c         C` s   g  } | r | j  d  n  | rT d t j | j   d  } | j  t |   n  | r d t j | j   d  } | j  t |   n  | r d d j |  |  f S|  Sd  S(   Nt   1i   i    i(   i   s   [%sm%s[0mt   ;(   R|   t   _colour_codesRN   t   lowert   strR`   (   R   t   fgt   bgt   boldt   seqt   fgcodet   bgcode(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   colour_textY  s    c         C` s   |  S(   N(    (   R   R   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   h  s    c         C` s   t  |  d  S(   NR   (   R   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   default_textk  s    c         C` s   t  |  d  S(   NR   (   R   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   m  s    c         C` s   t  |  d  S(   NR   (   R   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   o  s    c         C` s   t  |  d  S(   NR   (   R   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   q  s    c         C` s   t  |  d  S(   NR   (   R   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   s  s    c         C` s   t  |  d  S(   NR   (   R   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   u  s    c         C` sG   t  j d k rC |  j d  rC |  d d t j j |  d  }  n  |  S(   NR   s	   /cygdrivei
   t   :i   (   Rt   R   R   RL   R_   t   normcase(   R_   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   z  s    %c           C` sT   t  j d k rP t j j d d  d k r. t St j j d d  d k rP t Sn  t S(   s0   Return true when using mingw32 environment.
    t   win32t   OSTYPERb   t   msyst   MSYSTEMt   MINGW32(   Rt   R   RL   RM   RN   t   Truet   False(    (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR      s    c          C` sx   t  j j d  }  |  d k rn t  j |  d |  d !} i d d 6d d 6d	 d
 6d d 6d d 6j | d  } n d } | S(   sF   Return name of MSVC runtime library if Python was built with MSVC >= 7s   MSC v.ii   i
   t   msvcr70t   1300t   msvcr71t   1310t   msvcr80t   1400t   msvcr90t   1500t   msvcr100t   1600N(   Rt   t   versiont   findRN   R   (   t   msc_post   msc_vert   lib(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   msvc_runtime_library  s    

s   .*[.](cpp|cxx|cc)\Zs   .*[.](f90|f95|f77|for|ftn|f)\Zs   .*[.](f90|f95)\Zs   \s*module\s*(?P<name>[\w_]+)c         C` su   t  |   s g  Sg  } t |  d  } x? | D]7 } t |  } | r, | j d  } | j |  q, q, W| j   | S(   sR   Return a list of Fortran f90 module names that
    given source file defines.
    t   rR:   (   t   f90_ext_matchR   t   f90_module_name_matcht   groupR|   R   (   t   sourceRu   t   fR   t   mR:   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   _get_f90_modules  s    
c         C` s   t  |  t  S(   N(   t
   isinstanceR   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR0     s    c         C` s%   x |  D] } t  |  s t Sq Wt S(   s4   Return True if all items in lst are string objects. (   R0   R   R   (   t   lstt   item(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR!     s    c         C` s-   t  |   r t Sy t |   Wn t SXt S(   N(   R0   R   RY   R   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR/     s    c         C` s"   t  |   o! d |  k p! d |  k S(   NR   R   (   R0   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   is_glob_pattern  s    c         C` s!   t  |   r t |   S|  g Sd  S(   N(   R/   RW   (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR1     s    
c         C` sX   d } xK |  D]C } t | t  r t |  r8 d } PqP t |  rP d } qP q q W| S(   s2   Determine language value (c,f77,f90) from sources t   f90t   f77N(   R   R   R   R   t   fortran_ext_match(   t   sourcest   languageR   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR3     s    c         C` s%   x |  D] } t  |  r t Sq Wt S(   s.   Return True if sources contains Fortran files (   R   R   R   (   R   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR"     s    c         C` s%   x |  D] } t  |  r t Sq Wt S(   s*   Return True if sources contains C++ files (   t   cxx_ext_matchR   R   (   R   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR#     s    c         C` s   g  } g  } g  } g  } xu |  D]m } t  |  rc t |  } | rS | j |  q | j |  q t |  r | j |  q | j |  q W| | | | f S(   st   Return four lists of filenames containing
    C, C++, Fortran, and Fortran 90 module sources,
    respectively.
    (   R   R   R|   R   (   R   t	   c_sourcest   cxx_sourcest	   f_sourcest   fmodule_sourcesR   Ru   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR$     s    c         C` sF   g  } x9 |  D]1 } t  j  t j j | d   } | j |  q W| S(   Ns   *.h(   R   RL   R_   R`   R   (   t   directory_listt   headersR
   t   head(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   _get_headers  s
    c         C` sa   g  } xT |  D]L } t  j j |  } | d d k r | d | k r | j | d  q q W| S(   Ni    Rb   (   RL   R_   R^   R|   (   t   list_of_sourcest   direcsR   R
   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   _get_directories  s     c         C` s   t  t |    S(   N(   R  R	  (   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR%     s    c         C` s   t  |   s t St j j |   } t j j t j   | g  } | t |  j t j	  } | rz | d rz | d } n  | r | d d k r t St j	 j
 |  } t j j |  S(   s1   Return true if directory is local directory.
    i    i   RD   (   R0   R   RL   R_   Rd   t   commonprefixt   getcwdRY   R^   Re   R`   t   isdir(   t	   directoryt   abs_dirt   ct   new_dir(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR&     s    c   	      c` s   i d d 6d d 6d d 6} t  j d  } x t j |  d t D]r \ } } } g  | D] } | | k rV | ^ qV } | | (x4 | D], } | j |  s t j j | |  Vq q Wq@ Wd  S(   Ni   t   CVSs   .svnRD   s   (?:[~#]|\.py[co]|\.o)$t   topdown(   t   ret   compileRL   t   walkR   t   searchR_   R`   (	   t   top_patht   pruned_directoriest   prune_file_patt   dirpatht   dirnamest	   filenamesR
   t   prunedR   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   general_source_files#  s    %%c         c` s  d d d g } t  j d  } x t j |  d t D] \ } } } g  | D] } | | k rJ | ^ qJ } | | (x | D] } t j j | |  } t | |   }	 g  }
 x^ t j |  D]M } t j j | |  } t j j	 |  r | j
 |  r |
 j |  q q W|	 |
 f Vqv Wq4 W|  } t | |   }	 g  t j |  D]* } | j
 |  s?t j j | |  ^ q?} g  | D] } t j j	 |  rv| ^ qv}
 |	 |
 f Vd S(   sJ   Return a directory name relative to top_path and
    files contained.
    R  s   .svnRD   s   (?:[~#]|\.py[co]|\.o)$R  N(   R  R  RL   R  R   R_   R`   Rk   t   listdirt   isfileR  R|   (   R  R  R  R  R  R  R
   R  t   dpatht   rpatht   filesR   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt    general_source_directories_files-  s(    %%"*+c         C` s   g  } g  |  j  D] } t |  r | ^ q } | j |  | j t |   x[ |  j D]P } t |  r | j t t |    qX t j	 j
 |  rX | j |  qX qX W| S(   N(   R   R0   R   R%   t   dependsR&   RW   R  RL   R_   R   R|   (   t   extR  t   _mR   R
   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR'   G  s    (c         C` s)   g  |  D] } t  |  r | ^ q }  |  S(   N(   R0   (   t   scriptsR'  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR(   T  s    %c         C` s   g  } |  d j  d g   } g  | D] } t |  r# | ^ q# } | j |  | j t |   |  d j  d g   } xX | D]P } t |  r | j t t |    q~ t j j	 |  r~ | j
 |  q~ q~ W| S(   Ni   R   R%  (   RN   R0   R   R%   R&   RW   R  RL   R_   R   R|   (   R   R  R   R'  R%  R
   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR)   X  s    %c         C` s   t  j j   } | j d d  } | d k rB | j d d  } n  |  s t j j d  sl t j j d  ru d } q t j j d  r d } q t j j d	  r d
 } q d | k r | j d | j d  d d  } q n  | S(   s;  Return the correct file extension for shared libraries.

    Parameters
    ----------
    is_python_ext : bool, optional
        Whether the shared library is a Python extension.  Default is False.

    Returns
    -------
    so_ext : str
        The shared library extension.

    Notes
    -----
    For Python shared libs, `so_ext` will typically be '.so' on Linux and OS X,
    and '.pyd' on Windows.  For Python >= 3.2 `so_ext` has a tag prepended on
    POSIX systems according to PEP 3149.  For Python 3.2 this is implemented on
    Linux, but not on OS X.

    t
   EXT_SUFFIXt   SORb   t   linuxt   gnukfreebsds   .sot   darwins   .dylibt   wins   .dllt   SOABIRm   i   N(	   t	   distutilst	   sysconfigt   get_config_varsRN   R   Rt   R   R   R}   (   t   is_python_extt   confvarst   so_ext(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   get_shared_lib_extensionf  s    			(c         C` s   t  |   r |  g S|  d } g  } x | D] } t | d  rE q* n  t |  rm | j t t |    q* t  |  r t j j |  r | j	 |  q t
 d |  q* t t |    q* W| S(   Ni   t   __call__s   Not existing data file:(   R0   Rv   R&   R   RW   R  RL   R_   R   R|   R   t	   TypeErrorRg   (   t   dataR   R  R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR*     s    
c          G` s&   d j  g  |  D] } | r | ^ q  S(   NRm   (   R`   (   RZ   R\   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR+     s    c         C` se   y t  j |  d  SWnI t k
 r` t  j   d j } x! t |  d  D] } | j } qI W| SXd S(   s:   Return frame object from call stack with given level.
    i   i   N(   Rt   t	   _getframet   AttributeErrort   exc_infot   tb_frameRX   t   f_back(   t   levelRw   t   _(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR,     s    c        
   B` s  e  Z d  d d d d d d d d d	 g
 Z d
 d g Z d d g Z g  Z d7 d7 d7 d7 d d d  Z d   Z d   Z	 d   Z
 d   Z d   Z d d  Z d d  Z d7 d7 d d  Z d7 e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d    Z d!   Z d"   Z d#   Z d$   Z d7 d%  Z d7 d&  Z d'   Z d(   Z  d)   Z! d*   Z" d+   Z# d,   Z$ d-   Z% d.   Z& d/   Z' d0   Z( d7 d7 d1  Z) e* d2  Z+ e* d3  Z, d4 d5  Z- d6   Z. RS(8   t   packagest   ext_modulest
   data_filest   include_dirst	   librariesR  R(  t
   py_modulest   installed_librariest   define_macrost   package_dirt   installed_pkg_configR:   R   i   s   setup.pyc      	   K` su  t  | |  |  _ d |  _ t |  } t | |  |  _ | d k rZ |  j } d |  _ n  | d k rr |  j } n3 t j j	 t
 |  j |   r t
 |  j |  } n  t j j	 | p d  s t d | f   n  | |  _ | |  _ t j j |  j j d    |  _ |  j |  _ |  j |  _ xB |  j D]7 }	 t j | j |	 g    }
 t |  |	 t |
   q*Wx< |  j D]1 }	 t j | j |	 i    }
 t |  |	 |
  qoW|  j |  j } |  j |  _ x | j   D] }	 |	 | k rqn  | |	 } t |  |	 |  t | t  r"|  j j |	  qt | t  rD|  j j |	  q|  j j |	  qWt j j  t
 | d   r|  j! j |  j  | |  j" |  j <n  t d t# d t# d t# d t#  |  _$ d } xm t% d	 d
  D]\ } y t |  } Wn t k
 rPn Xy t& d | j' | j(  } PWqt) k
 r.qXqWt | |  j*  rh| j$ d rh|  j+ | j$   qhn  | |  _, d S(   s  Construct configuration instance of a package.

        package_name -- name of the package
                        Ex.: 'distutils'
        parent_name  -- name of the parent package
                        Ex.: 'numpy'
        top_path     -- directory of the toplevel package
                        Ex.: the directory where the numpy package source sits
        package_path -- directory of package. Will be computed by magic from the
                        directory of the caller module if not specified
                        Ex.: the directory where numpy.distutils is
        caller_level -- frame level to caller namespace, internal parameter.
        Rb   Rm   s   %r is not a directorys   __init__.pyt   ignore_setup_xxx_pyt   assume_default_configurationt   delegate_options_to_subpackagest   quieti   i   R=   N(-   R+   R:   R   R   R,   R{   R   RL   R_   R  R.   R   R  t   package_pathR`   R^   t   path_in_packaget
   _list_keyst	   list_keyst
   _dict_keyst	   dict_keyst   copyRN   t   setattrR1   t   _extra_keyst
   extra_keyst   keysR   RW   R|   t   dictR   RA  RI  R   t   optionsRX   Rn   Ro   Rp   Rr   t	   __class__t   set_optionst
   setup_name(   R=   t   package_namet   parent_nameR  RO  t   caller_levelR^  t   attrst   caller_frameR   t   vt
   known_keysR\   t   caller_instanceR[   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR>     sv    				!
c         C` s^   |  j    i  } |  j |  j |  j } x0 | D]( } t |  |  } | r. | | | <q. q. W| S(   s   
        Return a dictionary compatible with the keyword arguments of distutils
        setup function.

        Examples
        --------
        >>> setup(**config.todict())                           #doctest: +SKIP
        (   t   _optimize_data_filesRR  RT  RX  RO   (   R=   R
   Re  R   R\   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   todict$  s    

c         C` s   |  j  d s t |  n  d  S(   NRN  (   R[  R   (   R=   t   message(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   info7  s    c         C` s   t  j j d | f  d  S(   Ns   Warning: %s(   Rt   t   stderrt   write(   R=   Ri  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   warn;  s    c         K` sP   xI | j    D]; \ } } | |  j k r8 | |  j | <q t d |   q Wd S(   s   
        Configure Configuration instance.

        The following options are available:
         - ignore_setup_xxx_py
         - assume_default_configuration
         - delegate_options_to_subpackages
         - quiet

        s   Unknown option: N(   t   itemsR[  R   (   R=   R[  t   keyR   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR]  >  s    c         C` s   d d l  m } |   S(   s2   Return the distutils distribution object for self.i    (   RB   (   RJ   RB   (   R=   RB   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyRB   O  s    c         C` s  | j  d  } t |  j g |  } g  t j |  D] } t j j |  r5 | ^ q5 } g  } x | D] }	 t j j t |	 d   s qf n  d |	 j  t j  k r qf n  d j	 |	 j  t j  t
 |   }
 |  j |
 d | d | d } | j |  qf W| S(   NRm   s   __init__.pyRD   R`  Ra  i   (   R^   R.   R   R   RL   R_   R  R   Re   R`   RY   t   get_subpackageR   (   R=   t   subpackage_nameR`  Ra  R   t   subpackage_pathR'  R   t   config_listR
   R   R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   _wildcard_get_subpackageT  s    4&c         ` s  t  j j d t j j |   z|t j j t j j |   d } t   j | |  } t	 d j
 | j d   | d   t  d  s   j d s   j d	   n  t | |   j | d
 | d } n t | g | j d  d    }	 |	 f }
    f d   }    f d   } t  j d d k  rA| |
  }
 n | |
  }
  j |
   } | j t | |  k r  j d t | |  | j f  n  Wd  t  j d =X| S(   Ni    R@  Rm   s   .pyt   Ui   t   configurationRL  sC   Assuming default configuration (%s does not define configuration())Ra  ic         ` s,    j  j j d k r( |    j f }  n  |  S(   Ni   (   Rv  t   __code__t   co_argcountR  (   RZ   (   R=   t   setup_module(    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   fix_args_py2  s    c         ` s,    j  j j d k r( |    j f }  n  |  S(   Ni   (   Rv  Rw  Rx  R  (   RZ   (   R=   Ry  (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   fix_args_py3  s    i   s*   Subpackage %r configuration returned as %r(   s   .pyRu  i   (   Rt   R_   t   insertRL   Rq   t   splitextt   basenameR+   R:   R   R`   R^   Rv   R[  Rm  R   R  t   version_infoRv  (   R=   t   setup_pyRq  Rr  R`  Ra  R^  R   t   configt   pnRZ   Rz  R{  (    (   R=   Ry  s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt    _get_configuration_from_setup_pyg  s6    "			 		!c         C` s  | d k r< | d k r' t d   n  t j j |  } n  | j d  } | d k r} d | k r} |  j | | d | d Sd | k s t t | | | f    | d k r t	 |  j
 g |  } n- t	 | g | d   } |  j | g  d } t	 | |  j  } |  j d s@t j j |  s@t	 | d	 |  } q@n  t j j |  s|  j d
 s|  j d t j j |  | f  n  t | | |  j | d | d } n" |  j | | | | d | d } | r| g Sg  Sd S(   s  Return list of subpackage configurations.

        Parameters
        ----------
        subpackage_name : str or None
            Name of the subpackage to get the configuration. '*' in
            subpackage_name is handled as a wildcard.
        subpackage_path : str
            If None, then the path is assumed to be the local path plus the
            subpackage_name. If a setup.py file is not found in the
            subpackage_path, then a default configuration is used.
        parent_name : str
            Parent name.
        s;   either subpackage_name or subpackage_path must be specifiedRm   R   Ra  i   ii    RK  s   setup_%s.pyRL  sE   Assuming default configuration (%s/{setup_%s,setup}.py was not found)N(   R   R   RL   R_   R~  R^   Rt  Rf   Rg   R.   R   R~   R^  R[  R   Rm  Rq   R   R  R  (   R=   Rq  Rr  R`  Ra  R   R  R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyRp    sH    	'		c   	      C` s  | r d } n	 |  j } |  j | | d | d d } | sL |  j d  n  x | D] } | } t | t  r} | j   } n  t | t  s t t	 t
 |     |  j d | j d  |  j f  |  j |   qS W|  j   } | d k	 r|  j d |  n  d S(	   s  Add a sub-package to the current Configuration instance.

        This is useful in a setup.py script for adding sub-packages to a
        package.

        Parameters
        ----------
        subpackage_name : str
            name of the subpackage
        subpackage_path : str
            if given, the subpackage path such as the subpackage is in
            subpackage_path / subpackage_name. If None,the subpackage is
            assumed to be located in the local path / subpackage_name.
        standalone : bool
        R`  Ra  i   s0   No configuration returned, assuming unavailable.s    Appending %s configuration to %sR:   sT   distutils distribution has been initialized, it may be too late to add a subpackage N(   R   R:   Rp  Rm  R   R   Rh  RZ  Rf   Rg   R   Rj  RN   R   RB   (	   R=   Rq  Rr  t
   standaloneR`  Rs  R  R
   RT   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   add_subpackage  s(    			'		c      
   C` s  t  |  r | \ } } n d } t  |  rW g  | D] } |  j | | f  ^ q4 d St |  sy t d | f   n  | d k r t j j |  r |  j t j j |  | f  S|  j | | f  S|  j	 | d t
 } t |  rt |  rt |  j t j  } | j   t t t |  d   } | j   x" | D] } | | sE| | =qEqEWx| D]]} t j j |  st d |  qjn  t | |  j  }	 |	 j t j  }
 |
 j   g  } d } x | D] } t |  r'| t |
  k rt d | | f   n  | j |
 |  nE | |
 | k s_t t | |
 | | | | |	 f    | j |  | d 7} qW|
 | r|  j d | |
 f  n  | j   |  j t j j |  | f  qjWn$ x! | D] } |  j | | f  qWd St |  st t |    |  j   } | d k	 rH| j d k	 rH| j } n	 |  j } x_ | D]W } xN t t |   D]: \ } } t j j |  j  | |  } | j | | f  qqWqXWd S(	   s  Recursively add files under data_path to data_files list.

        Recursively add files under data_path to the list of data_files to be
        installed (and distributed). The data_path can be either a relative
        path-name, or an absolute path-name, or a 2-tuple where the first
        argument shows where in the install directory the data directory
        should be installed to.

        Parameters
        ----------
        data_path : seq or str
            Argument can be either

                * 2-sequence (<datadir suffix>, <path to data directory>)
                * path to data directory where python datadir suffix defaults
                  to package dir.

        Notes
        -----
        Rules for installation paths:
          foo/bar -> (foo/bar, foo/bar) -> parent/foo/bar
          (gun, foo/bar) -> parent/gun
          foo/* -> (foo/a, foo/a), (foo/b, foo/b) -> parent/foo/a, parent/foo/b
          (gun, foo/*) -> (gun, foo/a), (gun, foo/b) -> gun
          (gun/*, foo/*) -> parent/gun/a, parent/gun/b
          /foo/bar -> (bar, /foo/bar) -> parent/bar
          (gun, /foo/bar) -> parent/gun
          (fun/*/gun/*, sun/foo/bar) -> parent/fun/foo/gun/bar

        Examples
        --------
        For example suppose the source directory contains fun/foo.dat and
        fun/bar/car.dat::

            >>> self.add_data_dir('fun')                       #doctest: +SKIP
            >>> self.add_data_dir(('sun', 'fun'))              #doctest: +SKIP
            >>> self.add_data_dir(('gun', '/full/path/to/fun'))#doctest: +SKIP

        Will install data-files to the locations::

            <package install directory>/
              fun/
                foo.dat
                bar/
                  car.dat
              sun/
                foo.dat
                bar/
                  car.dat
              gun/
                foo.dat
                car.dat
        Ns   not a string: %rR   i   s   Not a directory, skippingi    s   cannot fill pattern %r with %rs,   mismatch of pattern_list=%s and path_list=%s(!   R/   R   t   add_data_dirR0   R8  RL   R_   t   isabsR~  R~   R   R   R   R^   Re   t   reverseRW   RX   RY   R  R   Rk   R   R   R|   Rf   Rg   Rm  R`   RB   RC  R$  RP  (   R=   t	   data_pathR
   R   R~   t   pattern_listt   rlR[   R_   R"  t	   path_listt   target_listR   RT   RC  t   d1R   t   target_path(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR    sr    6&
 


8
	
&	c         C` s   i  } xU |  j  D]J \ } } | | k r8 t   | | <n  x | D] } | | j |  q? Wq Wg  | j   D] \ } } | t |  f ^ qk |  j  (d  S(   N(   RC  t   sett   addRn  RW   (   R=   t	   data_dictR   R#  R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyRg  r  s    c         G` s  t  |  d k r4 x | D] } |  j |  q Wd St  |  d k sL t  t | d  ro | d \ } } n d } t |  r | } nn t |  r t  |  d k r | d } q x! | D] } |  j | | f  q Wd Sn t t t |     | d k r`t	 | d  rd } n- t
 j j |  r7d } n t
 j j |  } |  j | | f  d S|  j | d t } t |  rwt |  r`| j t
 j  } | j   x | D] } | j t
 j  } | j   | j   g  }	 d }
 xE | D]= } t |  r|	 j | |
  |
 d 7}
 q|	 j |  qW|	 j   |  j t
 j j |	  | f  qWn |  j | | f  d St |  st t | | f    |  j   } | d k	 r| j d k	 r| j } n	 |  j } | j t
 j j |  j |  | f  d S(   s  Add data files to configuration data_files.

        Parameters
        ----------
        files : sequence
            Argument(s) can be either

                * 2-sequence (<datadir prefix>,<path to data file(s)>)
                * paths to data files where python datadir prefix defaults
                  to package dir.

        Notes
        -----
        The form of each element of the files sequence is very flexible
        allowing many combinations of where to get the files from the package
        and where they should ultimately be installed on the system. The most
        basic usage is for an element of the files argument sequence to be a
        simple filename. This will cause that file from the local path to be
        installed to the installation path of the self.name package (package
        path). The file argument can also be a relative path in which case the
        entire relative path will be installed into the package directory.
        Finally, the file can be an absolute path name in which case the file
        will be found at the absolute path name but installed to the package
        path.

        This basic behavior can be augmented by passing a 2-tuple in as the
        file argument. The first element of the tuple should specify the
        relative path (under the package install directory) where the
        remaining sequence of files should be installed to (it has nothing to
        do with the file-names in the source distribution). The second element
        of the tuple is the sequence of files that should be installed. The
        files in this sequence can be filenames, relative paths, or absolute
        paths. For absolute paths the file will be installed in the top-level
        package installation directory (regardless of the first argument).
        Filenames and relative path names will be installed in the package
        install directory under the path name given as the first element of
        the tuple.

        Rules for installation paths:

          #. file.txt -> (., file.txt)-> parent/file.txt
          #. foo/file.txt -> (foo, foo/file.txt) -> parent/foo/file.txt
          #. /foo/bar/file.txt -> (., /foo/bar/file.txt) -> parent/file.txt
          #. *.txt -> parent/a.txt, parent/b.txt
          #. foo/*.txt -> parent/foo/a.txt, parent/foo/b.txt
          #. */*.txt -> (*, */*.txt) -> parent/c/a.txt, parent/d/b.txt
          #. (sun, file.txt) -> parent/sun/file.txt
          #. (sun, bar/file.txt) -> parent/sun/file.txt
          #. (sun, /foo/bar/file.txt) -> parent/sun/file.txt
          #. (sun, *.txt) -> parent/sun/a.txt, parent/sun/b.txt
          #. (sun, bar/*.txt) -> parent/sun/a.txt, parent/sun/b.txt
          #. (sun/*, */*.txt) -> parent/sun/c/a.txt, parent/d/b.txt

        An additional feature is that the path to a data-file can actually be
        a function that takes no arguments and returns the actual path(s) to
        the data-files. This is useful when the data files are generated while
        building the package.

        Examples
        --------
        Add files to the list of data_files to be included with the package.

            >>> self.add_data_files('foo.dat',
            ...     ('fun', ['gun.dat', 'nun/pun.dat', '/tmp/sun.dat']),
            ...     'bar/cat.dat',
            ...     '/full/path/to/can.dat')                   #doctest: +SKIP

        will install these data files to::

            <package install directory>/
             foo.dat
             fun/
               gun.dat
               nun/
                 pun.dat
             sun.dat
             bar/
               car.dat
             can.dat

        where <package install directory> is the package (or sub-package)
        directory such as '/usr/lib/python2.4/site-packages/mypackage' ('C:
        \Python2.4 \Lib \site-packages \mypackage') or
        '/usr/lib/python2.4/site- packages/mypackage/mysubpackage' ('C:
        \Python2.4 \Lib \site-packages \mypackage \mysubpackage').
        i   Ni    R7  Rb   R   (   RY   t   add_data_filesRf   R/   R   R0   R8  Rg   R   Rv   RL   R_   R  Rq   R~   R   R   R^   Re   R  t   popR|   R`   RB   RC  RP  (   R=   R#  R   R
   t   filepatR~   R  R_   R  R  R[   R   RT   RC  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR  {  sf    X			



&%	c         C` sZ   |  j    } | d k	 rF t | d  s3 g  | _ n  | j j |  n |  j j |  d S(   s   Add define macros to configuration

        Add the given sequence of macro name and value duples to the beginning
        of the define_macros list This list will be visible to all extension
        modules of the current package.
        RH  N(   RB   R   Rv   RH  R   (   R=   t   macrosRT   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   add_define_macros  s    c         G` si   |  j  |  } |  j   } | d k	 rU | j d k rB g  | _ n  | j j |  n |  j j |  d S(   s   Add paths to configuration include directories.

        Add the given sequence of paths to the beginning of the include_dirs
        list. This list will be visible to all extension modules of the
        current package.
        N(   R~   RB   R   RD  R   (   R=   R~   RD  RT   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   add_include_dirs$  s    c         G` s&  g  } x | D] } t  |  rT g  |  j |  D] } | j |  j | f  ^ q/ q t | t t f  s| t |  d k r t t	 |    n  g  |  j | d  D] } | j | d | f  ^ q q W|  j
   } | d k	 r| j d k r g  | _ n  | j j |  n |  j j |  d S(   s  Add installable headers to configuration.

        Add the given sequence of files to the beginning of the headers list.
        By default, headers will be installed under <python-
        include>/<self.name.replace('.','/')>/ directory. If an item of files
        is a tuple, then its first argument specifies the actual installation
        location relative to the <python-include> path.

        Parameters
        ----------
        files : str or seq
            Argument(s) can be either:

                * 2-sequence (<includedir suffix>,<path to header file(s)>)
                * path(s) to header file(s) where python includedir suffix will
                  default to package name.
        i   i   i    N(   R0   R~   R|   R:   R   t   tupleRW   RY   R8  Rg   RB   R   R  R   (   R=   R#  R  R_   R   RT   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   add_headers4  s    5(;c         O` s+   | j  d t  } t | d |  j d | S(   s  Apply glob to paths and prepend local_path if needed.

        Applies glob.glob(...) to each path in the sequence (if needed) and
        pre-pends the local_path if needed. Because this is called on all
        source lists, this allows wildcard characters to be specified in lists
        of sources for extension modules and libraries and scripts and allows
        path-names be relative to the source directory.

        R   R   (   RN   R   R2   R   (   R=   R~   t   kwsR   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR~   V  s    
		c         C` sM   xF | j    D]8 } | | } | d k r |  j |  } | | | <q q Wd  S(   NR   R%  RD  t   library_dirst   module_dirst   extra_objects(   s   sourcess   dependss   include_dirss   library_dirsR  s   extra_objects(   RY  R~   (   R=   t   kwt   kRd  t   new_v(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   _fix_paths_dicte  s    
	c         K` s  t  j  |  } t |  j |  | d <| | d <d | k r | d } | d =t | t  rg | g } n  x? | D]4 } t | t  s t t |    t | |  qn Wn  |  j |  | j	 d g   } g  } g  | d <xH| D]@}	 t |	 t
  r|  j |	 d  n  d |	 k r|	 j d d  \ }
 } t j j t |  j |   } t j j |  r|  j d | d d } t | t  r| j   } n  xt g  | j	 d g   D] } | d	 ^ qD]I } | j d
 d  d	 } | |
 k r| j d d  t | |  PqqWq qn  | j |	  q W| | d | d <|  j | j	 d g   | d <d	 d l m } | |   } |  j j |  |  j   } | d k	 r|  j d |  n  | S(   s  Add extension to configuration.

        Create and add an Extension instance to the ext_modules list. This
        method also takes the following optional keyword arguments that are
        passed on to the Extension constructor.

        Parameters
        ----------
        name : str
            name of the extension
        sources : seq
            list of the sources. The list of sources may contain functions
            (called source generators) which must take an extension instance
            and a build directory as inputs and return a source file or list of
            source files or None. If None is returned then no sources are
            generated. If the Extension instance has no sources after
            processing all source generators, then no extension module is
            built.
        include_dirs :
        define_macros :
        undef_macros :
        library_dirs :
        libraries :
        runtime_library_dirs :
        extra_objects :
        extra_compile_args :
        extra_link_args :
        extra_f77_compile_args :
        extra_f90_compile_args :
        export_symbols :
        swig_opts :
        depends :
            The depends list contains paths to files or directories that the
            sources of the extension module depend on. If any path in the
            depends list is newer than the extension module, then the module
            will be rebuilt.
        language :
        f2py_options :
        module_dirs :
        extra_info : dict or list
            dict or list of dict of keywords to be appended to keywords.

        Notes
        -----
        The self.paths(...) method is applied to all lists that may contain
        paths.
        R:   R   t
   extra_infoRE  i   t   @Ra  i   i    t   __OF__RH  (   t	   ExtensionsT   distutils distribution has been initialized, it may be too late to add an extension N(   RU  R+   R:   R   RZ  Rf   Rg   R   R  RN   R  R^   RL   R_   Rd   R.   R   R  Rp  R   R   Rh  R  R|   RH  RJ   R  RB  RB   Rm  (   R=   R:   R   R  t   ext_argsR  Rj  RE  t   libnamest   libnamet   lnamet   lpathR  R   t   llnameR  R&  RT   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   add_extensionm  sX    0

!
	0		c         K` sF   |  j  | | d |  |  j   } | d k	 rB |  j d |  n  d S(   s  
        Add library to configuration.

        Parameters
        ----------
        name : str
            Name of the extension.
        sources : sequence
            List of the sources. The list of sources may contain functions
            (called source generators) which must take an extension instance
            and a build directory as inputs and return a source file or list of
            source files or None. If None is returned then no sources are
            generated. If the Extension instance has no sources after
            processing all source generators, then no extension module is
            built.
        build_info : dict, optional
            The following keys are allowed:

                * depends
                * macros
                * include_dirs
                * extra_compiler_args
                * extra_f77_compile_args
                * extra_f90_compile_args
                * f2py_options
                * language

        sQ   distutils distribution has been initialized, it may be too late to add a library N(   t   _add_libraryR   RB   Rm  (   R=   R:   R   R;   RT   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   add_library  s
    	c         C` s_   t  j  |  } | } | | d <d | k r8 g  | d <n  |  j |  |  j j | | f  d S(   s\   Common implementation for add_library and add_installed_library. Do
        not use directlyR   R%  N(   RU  R  RE  R|   (   R=   R:   R   t   install_dirR;   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR    s    
c         C` s]   | s i  } n  t  j j |  j |  } |  j | | | |  |  j j t | | |   d S(   sQ  
        Similar to add_library, but the specified library is installed.

        Most C libraries used with `distutils` are only used to build python
        extensions, but libraries built through this method will be installed
        so that they can be reused by third-party packages.

        Parameters
        ----------
        name : str
            Name of the installed library.
        sources : sequence
            List of the library's source files. See `add_library` for details.
        install_dir : str
            Path to install the library, relative to the current sub-package.
        build_info : dict, optional
            The following keys are allowed:

                * depends
                * macros
                * include_dirs
                * extra_compiler_args
                * extra_f77_compile_args
                * extra_f90_compile_args
                * f2py_options
                * language

        Returns
        -------
        None

        See Also
        --------
        add_library, add_npy_pkg_config, get_info

        Notes
        -----
        The best way to encode the options required to link against the specified
        C libraries is to use a "libname.ini" file, and use `get_info` to
        retrieve the required options (see `add_npy_pkg_config` for more
        information).

        N(   RL   R_   R`   RO  R  RG  R|   R9   (   R=   R:   R   R  R;   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   add_installed_library	  s
    ,	c         C` s   | d k r i  } n  t j j |  d } t j j |  j |  } |  j |  j k rx |  j |  j j | | | f  n | | | f g |  j |  j <d S(   s  
        Generate and install a npy-pkg config file from a template.

        The config file generated from `template` is installed in the
        given install directory, using `subst_dict` for variable substitution.

        Parameters
        ----------
        template : str
            The path of the template, relatively to the current package path.
        install_dir : str
            Where to install the npy-pkg config file, relatively to the current
            package path.
        subst_dict : dict, optional
            If given, any string of the form ``@key@`` will be replaced by
            ``subst_dict[key]`` in the template file when installed. The install
            prefix is always available through the variable ``@prefix@``, since the
            install prefix is not easy to get reliably from setup.py.

        See also
        --------
        add_installed_library, get_info

        Notes
        -----
        This works for both standard installs and in-place builds, i.e. the
        ``@prefix@`` refer to the source directory for in-place builds.

        Examples
        --------
        ::

            config.add_npy_pkg_config('foo.ini.in', 'lib', {'foo': bar})

        Assuming the foo.ini.in file has the following content::

            [meta]
            Name=@foo@
            Version=1.0
            Description=dummy description

            [default]
            Cflags=-I@prefix@/include
            Libs=

        The generated file will have the following content::

            [meta]
            Name=bar
            Version=1.0
            Description=dummy description

            [default]
            Cflags=-Iprefix_dir/include
            Libs=

        and will be installed as foo.ini in the 'lib' subpath.

        i    N(	   R   RL   R_   R}  R`   RO  R:   RJ  R|   (   R=   t   templateR  t
   subst_dictR~  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   add_npy_pkg_config<  s    <	c         G` si   |  j  |  } |  j   } | d k	 rU | j d k rB g  | _ n  | j j |  n |  j j |  d S(   s   Add scripts to configuration.

        Add the sequence of files to the beginning of the scripts list.
        Scripts will be installed under the <prefix>/bin/ directory.

        N(   R~   RB   R   R(  R   (   R=   R#  R(  RT   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   add_scripts  s    c         K` s  x9 |  j  D]. } t |  |  } | j | j | g    q
 Wx9 |  j D]. } t |  |  } | j | j | i    qF W|  j  |  j |  j } x | j   D] } | | k r-t |  | d   } | r | | | k r q n  |  j	 d | | | | j d d  f  t
 |  | | |  |  j j |  q | |  j k rf|  j d | t |  |  | | f  q | | k ruq t d |   q Wd  S(   Ns"   Inheriting attribute %r=%r from %rR:   R   s*   Ignoring attempt to set %r (from %r to %r)s   Don't know about key=%r(   RR  RO   R   RN   RT  t   updateRX  RY  R   Rm  RV  R|   Rj  R   (   R=   RZ  Ro  R\   Re  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR     s,     	!	!c         C` s   d d l  m } |  j |  j |  j } d d d } | d |  j d 7} | j   xC | D]; } t |  | d   } | r[ | d	 | | |  f 7} q[ q[ W| d 7} | S(   Ni    (   t   pformatt   <i   t   -s   
s   Configuration of s   :
s   %s = %s
t   >s   -----s   -----s   ----->(	   t   pprintR  RR  RT  RX  R:   t   sortRO   R   (   R=   R  Re  R   R  R\   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   __str__  s    
!
c         C` sl   t  d  } | j   d | _ d | _ t j j d  } | rh t j j d | g  } | t j d <n  | S(   sF   
        Returns the numpy.distutils config command instance.
        R  i    t   PATHRm   (	   R   t   ensure_finalizedt   dump_sourcet   noisyRL   RM   RN   t   pathsepR`   (   R=   t   cmdt   old_pathR_   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   get_config_cmd  s    
		c         C` s   t  d  } | j   | j S(   sh   
        Return a path to a temporary directory where temporary files should be
        placed.
        RD   (   R   R  t
   build_temp(   R=   R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   get_build_temp_dir  s    
c         C` s+   d } |  j    } | j | d d } | S(   sS  Check for availability of Fortran 77 compiler.

        Use it inside source generating function to ensure that
        setup distribution instance has been initialized.

        Notes
        -----
        True if a Fortran 77 compiler is available (because a simple Fortran 77
        code was able to be compiled successfully).
        s/   
        subroutine simple
        end
        t   langR   (   R  t   try_compile(   R=   t   simple_fortran_subroutinet
   config_cmdt   flag(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt	   have_f77c  s    c         C` s+   d } |  j    } | j | d d } | S(   sR  Check for availability of Fortran 90 compiler.

        Use it inside source generating function to ensure that
        setup distribution instance has been initialized.

        Notes
        -----
        True if a Fortran 90 compiler is available (because a simple Fortran
        90 code was able to be compiled successfully)
        s/   
        subroutine simple
        end
        R  R   (   R  R  (   R=   R  R  R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt	   have_f90c  s    c         C` s   t  |  r7 | \ } } t | d |  j d |  j nW d d l m } t | |  sh t t |    | j j	 |  j  | j j	 |  j  d S(   sE   Append libraries, include_dirs to extension or library item.
        RE  RD  i    (   R  N(
   R/   R   RE  RD  RJ   R  R   Rf   Rg   R   (   R=   t   extlibt   lib_nameR;   R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt	   append_to  s    		!c   
   
   C` s  d } d } t j   } ye t j | p* d  t j d g d t d t j d d d t } | j } t	 j
 d | j    } Wn n Xt j |  | r t | j d   } | St j d	 k r t j j d
 d  r t | d d  } n t | d d  } t j j |  rt |  } | j   }	 | j   |	 d  d k rut	 j d |	  } | rt | j d   } qqt	 j d |	  } | rt | j d   } qn  | S(   s+   Return path's SVN revision number.
        Rm   t
   svnversiont   shellR   Rk  t	   close_fdss   (?P<revision>\d+)t   revisionR   t   SVN_ASP_DOT_NET_HACKt   _svnt   entriess   .svni   s   <?xmls   revision="(?P<revision>\d+)"s   dir[\n\r]+(?P<revision>\d+)N(   R   RL   R  t   chdirt
   subprocesst   PopenR   t   PIPER   R  t   matcht   readRK   R   Rt   R   RM   RN   R.   R_   R   R   R   R  (
   R=   R_   R  R   t   cwdR   t   soutR  R   t   fstr(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   _get_svn_revision  s>    		$
c      
   C` s  d } d } t j   } ye t j | p* d  t j d g d t d t j d d d t } | j } t	 j
 d | j    } Wn n Xt j |  | r t | j d   } | St | d	 d
  } t | d	 d  } t j j |  rd }	 t |  }
 |
 j   j   } |
 j   i  } xs t | d  D]b } | j   d  \ } } | | k r^| }	 n  y t |  } Wn t k
 rq-n X| | | <q-W| j |	  } n  | S(   s1   Return path's Mercurial revision number.
        Rm   s   hg identify --numR  R   Rk  R  s   (?P<revision>\d+)R  s   .hgt   branchs   branch.cacheR   i   N(   R   RL   R  R  R  R  R   R  R   R  R  R  RK   R   R.   R_   R   R   R   R   t   fileR^   R   RN   (   R=   R_   R  R   R  R   R  t	   branch_fnt   branch_cache_fnt   branch0R   t	   revision0t
   branch_mapR   t   branch1t	   revision1(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   _get_hg_revision+  sF    		
	c         C` s7  t  |  d d  } | d k	 r" | S| d k rZ d |  j j d  d d d d d g } n	 | g } | d k r d d	 |  j j d  d d
 g } n	 | g } x"| D]} t |  j |  } t j j |  r d } t j j	 t j j
 |   d }	 t |  j |	  }
 y( t d j |
 j d   | |  } Wn3 t k
 rft   } |  j t |   d } n X| d k ryq n  x0 | D]( } t  | | d  } | d k	 rPqqW| d k	 rPqq q W| d k	 r| |  _ | S|  j |  j  } | d k r|  j |  j  } n  | d k	 r3t |  } | |  _ n  | S(   s  Try to get version string of a package.

        Return a version string of the current package or None if the version
        information could not be detected.

        Notes
        -----
        This method scans files named
        __version__.py, <packagename>_version.py, version.py, and
        __svn_version__.py for string variables version, __version__, and
        <packagename>_version, until a version number is found.
        R   s   __version__.pyRm   is   _version.pys
   version.pys   __svn_version__.pys   __hg_version__.pyt   __version__t   _versions   .pyRu  i   i    R@  N(   s   .pyRu  i   (   RO   R   R:   R^   R.   R   RL   R_   R   R}  R~  R+   R   R`   t   ImportErrorR   Rm  R   R   R  R  (   R=   t   version_filet   version_variableR   R#  t   version_varsR   R   Rj  R:   R   t   version_modulet   msgR\   R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   get_versionV  s\    	 	"	
	c         ` sx   t   j d    j  j   t j j   sB  d k rF d S     f d   }  j d |   f  d S(   s  Appends a data function to the data_files list that will generate
        __svn_version__.py file to the current package directory.

        Generate package __svn_version__.py file from SVN revision number,
        it will be removed after python exits but will be available
        when sdist, etc commands are executed.

        Notes
        -----
        If __svn_version__.py existed before, nothing is done.

        This is
        intended for working with source directories that are in an SVN
        repository.
        s   __svn_version__.pyNc          ` s   t  j j   sb t   }   j d  |  f  t  d  } | j d |   | j   n  d d  l }   j   f d  } | j	 |   S(   Ns   Creating %s (version=%r)R   s   version = %r
i    c         ` s{     rw y t  j |   | d |   Wn t k
 r8 n Xy' t  j |  d  | d |  d  Wqw t k
 rs qw Xn  d  S(   Ns   removed R  (   RL   t   removeR	   (   R   R   (   t   delete(    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   rm_file  s          (
   RL   R_   R   R   Rj  R   Rl  R   t   atexitt   register(   R   R   R  R  (   R  R  R=   t   target(    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   generate_svn_version_py  s    Rb   (   R.   R   R  RL   R_   R   R   R  (   R=   R  R  (    (   R  R  R=   R  s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   make_svn_version_py  s    c         ` sx   t   j d    j  j   t j j   sB  d k rF d S     f d   }  j d |   f  d S(   s  Appends a data function to the data_files list that will generate
        __hg_version__.py file to the current package directory.

        Generate package __hg_version__.py file from Mercurial revision,
        it will be removed after python exits but will be available
        when sdist, etc commands are executed.

        Notes
        -----
        If __hg_version__.py existed before, nothing is done.

        This is intended for working with source directories that are
        in an Mercurial repository.
        s   __hg_version__.pyNc          ` s   t  j j   sb t   }   j d  |  f  t  d  } | j d |   | j   n  d d  l }   j   f d  } | j	 |   S(   Ns   Creating %s (version=%r)R   s   version = %r
i    c         ` s{     rw y t  j |   | d |   Wn t k
 r8 n Xy' t  j |  d  | d |  d  Wqw t k
 rs qw Xn  d  S(   Ns   removed R  (   RL   R  R	   (   R   R   (   R  (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR    s          (
   RL   R_   R   R   Rj  R   Rl  R   R  R  (   R   R   R  R  (   R  R  R=   R  (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   generate_hg_version_py  s    Rb   (   R.   R   R  RL   R_   R   R   R  (   R=   R  R  (    (   R  R  R=   R  s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   make_hg_version_py  s    t
   __config__c         C` s    |  j  j |  j | t f  d S(   s   Generate package __config__.py file containing system_info
        information used during building the package.

        This file is installed to the
        package installation directory.

        N(   RF  R|   R:   R   (   R=   R:   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   make_config_py  s    c         G` sD   d d l  m } m } i  } x! | D] } | | | |   q# W| S(   s   Get resources information.

        Return information (from system_info.get_info) for all of the names in
        the argument list in a single dictionary.
        i   (   R6   R   (   t   system_infoR6   R   (   R=   t   namesR6   R   t	   info_dictR\   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR6     s
    N(/   R?   R@   RQ  RS  RW  t   numpy_include_dirsR   R>   Rh  Rj  Rm  R]  RB   Rt  R  Rp  R   R  R  Rg  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  R6   (    (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR     sh   [					);)	w						"			g	$	3I										%	+F+*c         C` ss   |  | k rk d d  l  } | j j } | d  k rO d d l m } | d   n  | j |   } | | |  <n  | |  S(   Ni    (   t   DistutilsInternalErrors+   setup distribution instance not initialized(   t   distutils.coret   coret   _setup_distributionR   t   distutils.errorsR  RP   (   t   cmdnamet   _cacheR0  RT   R  R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR   	  s    c          C` s2   t  j }  |  s. d d  l } | j   g }  n  |  S(   Ni    (   R   R  t   numpyt   get_include(   RD  R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR     s
    
c          C` s:   d d l  }  t j j t j j |  j  d d d  } | S(   s;   Return the path where to find the npy-pkg-config directory.i    NR  R   s   npy-pkg-config(   R  RL   R_   R`   Rq   Rl   (   R  R
   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   get_npy_pkg_dir  s    c         C` sB   d d l  m } | r) | j t    n t   g } | |  |  S(   s  
    Return library info for the given package.

    Parameters
    ----------
    pkgname : str
        Name of the package (should match the name of the .ini file, without
        the extension, e.g. foo for the file foo.ini).
    dirs : sequence, optional
        If given, should be a sequence of additional directories where to look
        for npy-pkg-config files. Those directories are searched prior to the
        NumPy directory.

    Returns
    -------
    pkginfo : class instance
        The `LibraryInfo` instance containing the build information.

    Raises
    ------
    PkgNotFound
        If the package is not found.

    See Also
    --------
    Configuration.add_npy_pkg_config, Configuration.add_installed_library,
    get_info

    i    (   t   read_config(   t   numpy.distutils.npy_pkg_configR  R|   R  (   t   pkgnameR   R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR7   &  s
    c         C` s   d d l  m } t |  |  } | | j    } x7 | | j    j   D] \ } } | | j |  qJ W| d | d <| d =| d =| S(   s9  
    Return an info dict for a given C library.

    The info dict contains the necessary options to use the C library.

    Parameters
    ----------
    pkgname : str
        Name of the package (should match the name of the .ini file, without
        the extension, e.g. foo for the file foo.ini).
    dirs : sequence, optional
        If given, should be a sequence of additional directories where to look
        for npy-pkg-config files. Those directories are searched prior to the
        NumPy directory.

    Returns
    -------
    info : dict
        The dictionary with build information.

    Raises
    ------
    PkgNotFound
        If the package is not found.

    See Also
    --------
    Configuration.add_npy_pkg_config, Configuration.add_installed_library,
    get_pkg_info

    Examples
    --------
    To get the necessary information for the npymath library from NumPy:

    >>> npymath_info = np.distutils.misc_util.get_info('npymath')
    >>> npymath_info                                    #doctest: +SKIP
    {'define_macros': [], 'libraries': ['npymath'], 'library_dirs':
    ['.../numpy/core/lib'], 'include_dirs': ['.../numpy/core/include']}

    This info dict can then be used as input to a `Configuration` instance::

      config.add_extension('foo', sources=['foo.c'], extra_info=npymath_info)

    i    (   t   parse_flagsR  RH  t   ignored(   R  R  R7   t   cflagst   libsRn  R   (   R  R   R  t   pkg_infoRj  R  Rd  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR6   L  s    -%c          C` s_   t  j d d k r" d d  l }  n d d  l }  y |  j t SWn t k
 rZ t St } n Xd  S(   Ni    i   (   Rt   R  t   builtinst   __builtin__t   __NUMPY_SETUP__R   R;  R   (   R  R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   is_bootstrapping  s    c         C` sQ   d d l  } | j d |  | | |  | | f d d t |  | |  } | j   S(   sq   Return a configuration dictionary for usage in
    configuration() function defined in file setup_<name>.py.
    i    NsX   Use Configuration(%r,%r,top_path=%r) instead of deprecated default_config_dict(%r,%r,%r)t
   stackleveli   (   t   warningsRm  R   Rh  (   R:   R`  R   R  R  (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR     s    		c         K` sq   xj | j    D]\ \ } } | |  k r_ |  | } t | t  rK | |  | <qi |  | j |  q | |  | <q Wd  S(   N(   Rn  R   R   R   (   R
   R  R  Rd  t   ov(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR     s    
c         C` s  t  j j d k rE |  j d t  j j  }  | j d t  j j  } n  d } t  j j |  rjt  j j |   d } t  j j t  j j |    d } t  j j |  \ } } t  j j | | g  } t  j j | t	 |   | t	 |   | k s#t  j j | t	 |   | t	 |   | k r8t  j j
 |  } n  | t	 |  } t  j j |  rp| d } qpn | } t  j j t | |  |   S(   NR]   Rb   i    i   (   RL   R_   Re   R}   R  t
   splitdriveRd   R
  R`   RY   Rq   t   normpathR.   (   R   R_   t   drivet	   absprefixt	   pathdriveR
   t   subpath(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR     s"    "//c         C` s   d d l  m } d d l m } | t j j |    t |  d  } | j d t j j	 t
 j d   | j d  | j d  x4 | j j   D]# \ } } | j d | | f  q W| j d	  | j   |  S(
   s   Generate config.py file containing system_info information
    used during building the package.

    Usage:
        config['py_modules'].append((packagename, '__config__',generate_config_py))
    i    (   R  (   t   mkpathR   s   # This file is generated by %s
sH   # It contains system_info results at the time of building this package.
s   __all__ = ["get_info","show"]

s   %s=%r
s  
def get_info(name):
    g = globals()
    return g.get(name, g.get(name + "_info", {}))

def show():
    for name,info_dict in globals().items():
        if name[0] == "_" or type(info_dict) is not type({}): continue
        print(name + ":")
        if not info_dict:
            print("  NOT AVAILABLE")
        for k,v in info_dict.items():
            v = str(v)
            if k == "sources" and len(v) > 200:
                v = v[:60] + " ...\n... " + v[-60:]
            print("    %s = %s" % (k,v))
    (   t   numpy.distutils.system_infoR  t   distutils.dir_utilR%  RL   R_   Rq   R   Rl  Rd   Rt   t   argvt   saved_resultsRn  R   (   R  R  R%  R   R  R[   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR     s    $
c         C` s,   |  j  d k s% t d |  j    n  |  j S(   sd   Return version major and minor of compiler instance if it is
    MSVC, raise an exception otherwise.t   msvcs"   Compiler instance is not msvc (%s)(   t   compiler_typeR   t   _MSVCCompiler__version(   t   compiler(    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   msvc_version  s    s   2.5c          C` s   d d l  m }  |    S(   Ni    (   R5   (   t   distutils.msvccompilerR5   (   R5   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR5     s    c          C` sU   d }  t  j j |   } | d k r( d St  j j d |  } t  j | t |   | !S(   si   Return the processor architecture.

        Possible results are "Intel", "Itanium", or "AMD64".
        s    bit (it   Intelt   )(   Rt   R   R   RY   (   R   R[   R   (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyR5     s    (l   t
   __future__R    R   R   RL   R  Rt   RU  R   R  R   R  R   R0  R
  R   t	   threadingR   t   tlocalR  t   dummy_threadingR   R   R   R  R  Rr   t   setsR   t   numpy.distutils.compatR   t   numpy.compatR   R   t   __all__t   objectR9   R8   R4   R   Rk   R   R{   R.   R   R-   R   R   R2   R   R   RZ  R   R   R   R   R   R   R   R   R   R   R    R   R  t   IR  R   R   R   R   R   R0   R!   R/   R   R1   R3   R"   R#   R$   R  R	  R%   R&   R  R$  R'   R(   R)   R6  R*   R+   R,   R   R   R   R  R7   R6   R  R   R   R   R   R.  R   R5   (    (    (    s8   /tmp/pip-build-X4mzal/numpy/numpy/distutils/misc_util.pyt   <module>   s   											
					%		!								
																		
				/		     U			&<				%	