<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
ž
7’Re$b  c               @   s®  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
 Z
 d  d l m Z m Z m Z d  d l m Z m Z m Z m Z m Z m Z d  d l m Z m Z m Z d  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  g Z  d! d „  Z! d] d" d „ Z# d# d$ „  Z$ d% d	 „  Z% d& d' d
 „ Z& d d d( d „ Z( d d) d* „ Z) d+ d, „  Z* d- d „  Z+ Gd. d/ „  d/ e, ƒ Z- e- ƒ  Z. [- e j/ d0 e j0 ƒ Z1 d1 d „  Z2 d2 d „  Z3 d3 d „  Z4 d4 d „  Z5 d5 d „  Z6 d6 d „  Z7 d7 d „  Z8 d8 d „  Z9 d9 d „  Z: d: d „  Z; d; d „  Z< d< d= „  Z= d> d? „  Z> d@ dA „  Z? dB dC „  Z@ dD dE „  ZA d^ d_ d^ d] dJ dK „ ZC dL dM „  ZD dN dO „  ZE dP d „  ZF dQ dR „  ZG d^ dS d „ ZH dT d „  ZI dU d „  ZJ dV d „  ZK dW d „  ZL d^ d d d^ e jM d d dX d  „ ZN dY dZ „  ZO Gd[ d\ „  d\ e, ƒ ZP d S(`   i    N(   u   InstallationErroru
   BadCommandu   PipError(   u   WindowsErroru   string_typesu	   raw_inputu   console_to_stru	   user_siteu   PermissionError(   u   site_packagesu   running_under_virtualenvu   virtualenv_no_global(   u   logger(   u   pkg_resources(   u   versionu   rmtreeu   display_pathu
   backup_diru   find_commandu   asku   Infu   normalize_nameu   splitextu   format_sizeu   is_installable_diru   is_svn_pageu   file_contentsu   split_leading_diru   has_leading_diru   make_path_relativeu   normalize_pathu   renamesu   get_terminal_sizeu   get_progu
   unzip_fileu
   untar_fileu   create_download_cache_folderu   cache_downloadu   unpack_fileu   call_subprocessc               C   sP   y. t  j j t j d ƒ d k r- d t j SWn t t t f k
 rK Yn Xd S(   Ni    u   __main__.pyu   -cu	   %s -m pipu   pip(   u   __main__.pyu   -c(	   u   osu   pathu   basenameu   sysu   argvu
   executableu   AttributeErroru	   TypeErroru
   IndexError(    (    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   get_prog!   s    c             C   s   t  j |  d | d t ƒd  S(   Nu   ignore_errorsu   onerror(   u   shutilu   rmtreeu   rmtree_errorhandler(   u   diru   ignore_errors(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   rmtree*   s    c             C   sÂ   | d d … \ } } | t  k r5 | j d d k pp | t k rT | j d d k pp | t k op | j d d k sy ‚  n  t j | ƒ j t j @t j k r¡ ‚  n  t j | t j	 ƒ |  | ƒ d S(   uÑ   On Windows, the files in .svn are read-only, so when rmtree() tries to
    remove them, an exception is thrown.  We catch that here, remove the
    read-only attribute, and hopefully continue without problems.Ni   i    i   i   i   (
   u   WindowsErroru   argsu   OSErroru   PermissionErroru   osu   statu   st_modeu   S_IREADu   chmodu   S_IWRITE(   u   funcu   pathu   exc_infou   exctypeu   value(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   rmtree_errorhandler/   s    "u   rmtree_errorhandlerc             C   sd   t  j j t  j j |  ƒ ƒ }  |  j t  j ƒ  t  j j ƒ r` d |  t t  j ƒ  ƒ d … }  n  |  S(   uT   Gives the display value for a given path, making it relative to cwd
    if possible.u   .N(   u   osu   pathu   normcaseu   abspathu
   startswithu   getcwdu   sepu   len(   u   path(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   display_pathB   s    #u   .bakc             C   sK   d } | } x4 t  j j |  | ƒ rB | d 7} | t | ƒ } q W|  | S(   u\   Figure out the name of a directory to back up the given dir to
    (adding .bak, .bak2, etc)i   (   u   osu   pathu   existsu   str(   u   diru   extu   nu	   extension(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   backup_dirK   s    
c             C   s7  | d k r0 t j j d d ƒ j t j ƒ } n  t | t ƒ rK | g } n  | d k rc t ƒ  } n  d d „  | j	 ƒ  j t j ƒ Dƒ } t j
 j |  ƒ d j	 ƒ  | k r¶ d g } n  xj | D]b } t j
 j | |  ƒ } x. | D]& } | | } t j
 j | ƒ rß | Sqß Wt j
 j | ƒ r½ | Sq½ Wt d |  ƒ ‚ d S(   u<   Searches the PATH for the given command and returns its pathu   PATHu    c             S   s"   g  |  ] } t  | ƒ r | ‘ q S(    (   u   len(   u   .0u   ext(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>_   s   	 u    find_command.<locals>.<listcomp>i   u   Cannot find command %rN(   u   Noneu   osu   environu   getu   splitu   pathsepu
   isinstanceu   string_typesu   get_pathextu   loweru   pathu   splitextu   joinu   isfileu
   BadCommand(   u   cmdu   pathsu   pathextu   pathu   cmd_pathu   extu   cmd_path_ext(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   find_commandV   s$    $%"
c             C   sF   |  d k r- t j j d d d d g ƒ }  n  t j j d |  ƒ } | S(   u9   Returns the path extensions from environment or a defaultu   .COMu   .EXEu   .BATu   .CMDu   PATHEXTN(   u   Noneu   osu   pathsepu   joinu   environu   get(   u   default_pathextu   pathext(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   get_pathextq   s    !u   get_pathextc             C   sC   x3 t  j j d d ƒ j ƒ  D] } | | k r | Sq Wt |  | ƒ S(   Nu   PIP_EXISTS_ACTIONu    (   u   osu   environu   getu   splitu   ask(   u   messageu   optionsu   action(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   ask_path_existsy   s    "u   ask_path_existsc             C   s}   xv t  j j d ƒ r( t d |  ƒ ‚ n  t |  ƒ } | j ƒ  j ƒ  } | | k rr t d | d j | ƒ f ƒ q | Sq d S(   u@   Ask the message interactively, with the given possible responsesu   PIP_NO_INPUTu7   No input was expected ($PIP_NO_INPUT set); question: %su<   Your response (%r) was not one of the expected responses: %su   , N(	   u   osu   environu   getu	   Exceptionu	   raw_inputu   stripu   loweru   printu   join(   u   messageu   optionsu   response(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   ask€   s    c             B   sn   |  Ee  Z d  Z d Z d d „  Z d d „  Z d d „  Z d d	 „  Z d
 d „  Z d d „  Z	 d d „  Z
 d S(   u   _Infu   I am bigger than everything!c             C   s   |  | k r d Sd Sd  S(   NTF(   u   Trueu   False(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __eq__‘   s    u   _Inf.__eq__c             C   s   |  j  | ƒ S(   N(   u   __eq__(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __ne__—   s    u   _Inf.__ne__c             C   s   d S(   NF(   u   False(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __lt__š   s    u   _Inf.__lt__c             C   s   d S(   NF(   u   False(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __le__   s    u   _Inf.__le__c             C   s   d S(   NT(   u   True(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __gt__    s    u   _Inf.__gt__c             C   s   d S(   NT(   u   True(   u   selfu   other(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __ge__£   s    u   _Inf.__ge__c             C   s   d S(   Nu   Inf(    (   u   self(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __repr__¦   s    u   _Inf.__repr__N(   u   __name__u
   __module__u   __qualname__u   __doc__u   __eq__u   __ne__u   __lt__u   __le__u   __gt__u   __ge__u   __repr__(   u
   __locals__(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   _InfŽ   s   u   _Infu   [^a-z]c             C   s   t  j d |  j ƒ  ƒ S(   Nu   -(   u   _normalize_reu   subu   lower(   u   name(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   normalize_name±   s    c             C   sX   |  d k r d |  d d S|  d	 k r4 d |  d S|  d k rL d |  d Sd |  Sd  S(
   Niè  u   %.1fMBg     @@i
   u   %ikBu   %.1fkBu   %ibytesi@B i'  (    (   u   bytes(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   format_sizeµ   s    c             C   sE   t  j j |  ƒ s d St  j j |  d ƒ } t  j j | ƒ rA d Sd S(   u@   Return True if `path` is a directory containing a setup.py file.u   setup.pyFT(   u   osu   pathu   isdiru   Falseu   joinu   isfileu   True(   u   pathu   setup_py(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   is_installable_dirÀ   s    c             C   s(   t  j d |  ƒ o' t  j d |  t  j ƒ S(   uJ   Returns true if the page appears to be the index page of an svn repositoryu   <title>[^<]*Revision \d+:u#   Powered by (?:<a[^>]*?>)?Subversion(   u   reu   searchu   I(   u   html(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   is_svn_pageÊ   s    c          
   C   s8   t  |  d ƒ } z | j ƒ  j d ƒ SWd  | j ƒ  Xd  S(   Nu   rbu   utf-8(   u   openu   readu   decodeu   close(   u   filenameu   fp(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   file_contentsÐ   s    c             C   s    t  |  ƒ }  |  j d ƒ j d ƒ }  d |  k rv d |  k rZ |  j d ƒ |  j d ƒ k  sf d |  k rv |  j d d ƒ Sd |  k r’ |  j d d ƒ S|  d f Sd  S(   Nu   /u   \i   u    (   u   stru   lstripu   findu   split(   u   path(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   split_leading_dirØ   s    6c             C   s\   d } xO |  D]G } t | ƒ \ } } | s/ d S| d k rD | } q | | k r d Sq Wd S(   uy   Returns true if all the paths have the same leading path name
    (i.e., everything is in one subdirectory in an archive)NFT(   u   Noneu   split_leading_diru   Falseu   True(   u   pathsu   common_prefixu   pathu   prefixu   rest(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   has_leading_dirä   s    	c             C   s7  t  j j |  ƒ } t  j j |  ƒ }  t  j j t  j j |  ƒ ƒ }  t  j j t  j j | ƒ ƒ } |  j t  j j ƒ j t  j j ƒ } | j t  j j ƒ j t  j j ƒ } x> | rè | rè | d | d k rè | j	 d ƒ | j	 d ƒ q« Wd g t
 | ƒ | | g } | d g k r$d t  j j St  j j j | ƒ S(   u  
    Make a filename relative, where the filename path, and it is
    relative to rel_to

        >>> make_relative_path('/usr/share/something/a-file.pth',
        ...                    '/usr/share/another-place/src/Directory')
        '../../../something/a-file.pth'
        >>> make_relative_path('/usr/share/something/a-file.pth',
        ...                    '/home/user/src/Directory')
        '../../../usr/share/something/a-file.pth'
        >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/')
        'a-file.pth'
    i    u   ..u    u   .(   u   osu   pathu   basenameu   dirnameu   normpathu   abspathu   stripu   sepu   splitu   popu   lenu   join(   u   pathu   rel_tou   path_filenameu
   path_partsu   rel_to_partsu
   full_parts(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   make_path_relativeó   s    $$#c             C   s(   t  j j t  j j t  j j |  ƒ ƒ ƒ S(   uN   
    Convert a path to its canonical, case-normalized, absolute version.

    (   u   osu   pathu   normcaseu   realpathu
   expanduser(   u   path(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   normalize_path  s    c             C   s[   t  j |  ƒ \ } } | j ƒ  j d ƒ rQ | d d … | } | d d … } n  | | f S(   u,   Like os.path.splitext, but take off .tar toou   .tari   Niüÿÿÿiüÿÿÿ(   u	   posixpathu   splitextu   loweru   endswith(   u   pathu   baseu   ext(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   splitext  s
    c             C   s¨   t  j j | ƒ \ } } | rG | rG t  j j | ƒ rG t  j | ƒ n  t j |  | ƒ t  j j |  ƒ \ } } | r¤ | r¤ y t  j | ƒ Wq¤ t k
 r  Yq¤ Xn  d S(   u7   Like os.renames(), but handles renaming across devices.N(	   u   osu   pathu   splitu   existsu   makedirsu   shutilu   moveu
   removedirsu   OSError(   u   oldu   newu   headu   tail(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   renames!  s    c             C   s)   t  ƒ  s d St |  ƒ j t t j ƒ ƒ S(   u›   
    Return True if path is within sys.prefix, if we're running in a virtualenv.

    If we're not in a virtualenv, all paths are considered "local."

    T(   u   running_under_virtualenvu   Trueu   normalize_pathu
   startswithu   sysu   prefix(   u   path(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   is_local2  s    	u   is_localc             C   s   t  t |  ƒ ƒ S(   u   
    Return True if given Distribution object is installed locally
    (i.e. within current virtualenv).

    Always True if we're not in a virtualenv.

    (   u   is_localu   dist_location(   u   dist(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_is_local>  s    u   dist_is_localc             C   s-   t  r% t t |  ƒ ƒ j t t  ƒ ƒ Sd Sd S(   uF   
    Return True if given Distribution is installed in user site.
    NF(   u	   user_siteu   normalize_pathu   dist_locationu
   startswithu   False(   u   dist(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_in_usersiteI  s    u   dist_in_usersitec             C   s   t  t |  ƒ ƒ j t  t ƒ ƒ S(   ua   
    Return True if given Distribution is installed in distutils.sysconfig.get_python_lib().
    (   u   normalize_pathu   dist_locationu
   startswithu   site_packages(   u   dist(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_in_site_packagesR  s    u   dist_in_site_packagesc             C   s)   d d l  m } | j |  g  ƒ } | j S(   u$   Is distribution an editable install?i    (   u   FrozenRequirement(   u   pipu   FrozenRequirementu	   from_distu   editable(   u   distu   FrozenRequirementu   req(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_is_editableY  s    u   dist_is_editableu
   setuptoolsu   pipu   pythonu
   distributec                s€   |  r t  ‰ n d d „  ‰ | r0 d d „  ‰  n d d „  ‰  | rQ d d „  ‰ n d d „  ‰ ‡  ‡ ‡ ‡ f d d †  t j Dƒ S(	   uÌ  
    Return a list of installed Distribution objects.

    If ``local_only`` is True (default), only return installations
    local to the current virtualenv, if in a virtualenv.

    ``skip`` argument is an iterable of lower-case project names to
    ignore; defaults to ('setuptools', 'pip', 'python'). [FIXME also
    skip virtualenv?]

    If ``editables`` is False, don't report editables.

    If ``editables_only`` is True , only report editables.

    c             S   s   d S(   NT(   u   True(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>v  s    u-   get_installed_distributions.<locals>.<lambda>c             S   s   d S(   NT(   u   True(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>y  s    c             S   s   t  |  ƒ S(   N(   u   dist_is_editable(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>{  s    c             S   s
   t  |  ƒ S(   N(   u   dist_is_editable(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>~  s    c             S   s   d S(   NT(   u   True(   u   d(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <lambda>€  s    c                sI   g  |  ]? } ˆ | ƒ r | j  ˆ k r ˆ  | ƒ r ˆ | ƒ r | ‘ q S(    (   u   key(   u   .0u   d(   u   editable_testu   editables_only_testu
   local_testu   skip(    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>‚  s
   	 u/   get_installed_distributions.<locals>.<listcomp>(   u   dist_is_localu   pkg_resourcesu   working_set(   u
   local_onlyu   skipu   include_editablesu   editables_only(    (   u   editable_testu   editables_only_testu
   local_testu   skipu!   /tmp/pip-zej_zi-build/pip/util.pyu   get_installed_distributions`  s    	u   get_installed_distributionsc             C   s¸   g  } t  ƒ  rN t ƒ  r( | j t ƒ qq | j t ƒ t rq | j t ƒ qq n# t rd | j t ƒ n  | j t ƒ x@ | D]8 } t j j | |  j ƒ d } t j j	 | ƒ rx | Sqx Wd S(   u  
    Return the path for the .egg-link file if it exists, otherwise, None.

    There's 3 scenarios:
    1) not in a virtualenv
       try to find in site.USER_SITE, then site_packages
    2) in a no-global virtualenv
       try to find in site_packages
    3) in a yes-global virtualenv
       try to find in site_packages, then site.USER_SITE  (don't look in global location)

    For #1 and #3, there could be odd cases, where there's an egg-link in 2 locations.
    This method will just return the first one found.
    u	   .egg-linkN(
   u   running_under_virtualenvu   virtualenv_no_globalu   appendu   site_packagesu	   user_siteu   osu   pathu   joinu   project_nameu   isfile(   u   distu   sitesu   siteu   egglink(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   egg_link_pathŠ  s    		u   egg_link_pathc             C   s   t  |  ƒ } | r | S|  j S(   uÿ   
    Get the site-packages location of this distribution. Generally
    this is dist.location, except in the case of develop-installed
    packages, where dist.location is the source code location, and we
    want to know where the egg-link file is.

    (   u   egg_link_pathu   location(   u   distu   egg_link(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   dist_location¬  s    u   dist_locationc              C   sÍ   d d „  }  |  d ƒ p- |  d ƒ p- |  d ƒ } | s| y8 t  j t  j ƒ  t  j ƒ } |  | ƒ } t  j | ƒ Wq| Yq| Xn  | s¯ t  j j d d ƒ t  j j d d	 ƒ f } n  t | d ƒ t | d ƒ f S(
   ul   Returns a tuple (x, y) representing the width(x) and the height(x)
    in characters of the terminal window.c             S   s   yL d d  l  } d d  l } d d  l } | j d | j |  | j d ƒ ƒ } Wn d  SYn X| d k rk d  S| d k r{ d  S| S(   Ni    u   hhu   1234(   i    i    (   i    i    (   u   fcntlu   termiosu   structu   unpacku   ioctlu
   TIOCGWINSZu   None(   u   fdu   fcntlu   termiosu   structu   cr(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   ioctl_GWINSZ½  s    	u'   get_terminal_size.<locals>.ioctl_GWINSZi    i   i   u   LINESi   u   COLUMNSiP   (   u   osu   openu   ctermidu   O_RDONLYu   closeu   environu   getu   int(   u   ioctl_GWINSZu   cru   fd(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   get_terminal_sizeº  s    $-c              C   s    t  j d ƒ }  t  j |  ƒ |  S(   uB   Get the current umask which involves having to set it temporarily.i    (   u   osu   umask(   u   mask(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   current_umaskØ  s    u   current_umaskc             C   sÀ  t  j j | ƒ s" t  j | ƒ n  t |  d ƒ } z}t j | ƒ } t | j ƒ  ƒ oX | } xO| j	 ƒ  D]A} | j
 } | j | ƒ } | }	 | r¥ t | ƒ d }	 n  t  j j | |	 ƒ }	 t  j j |	 ƒ }
 t  j j |
 ƒ sî t  j |
 ƒ n  |	 j d ƒ s|	 j d ƒ r1t  j j |	 ƒ s©t  j |	 ƒ q©qh t |	 d ƒ } z | j | ƒ Wd | j ƒ  | j d ?} | r¨t j | ƒ r¨| d @r¨t  j |	 d	 t ƒ  d Bƒ n  Xqh WWd | j ƒ  Xd S(
   uŸ  
    Unzip the file (with path `filename`) to the destination `location`.  All
    files are written based on system defaults and umask (i.e. permissions are
    not preserved), except that regular file members with any execute
    permissions (user, group, or world) have "chmod +x" applied after being
    written. Note that for windows, any execute changes using os.chmod are
    no-ops per the python docs.
    u   rbi   u   /u   \u   wbNi   iI   iÿ  (   u   osu   pathu   existsu   makedirsu   openu   zipfileu   ZipFileu   has_leading_diru   namelistu   infolistu   filenameu   readu   split_leading_diru   joinu   dirnameu   endswithu   writeu   closeu   external_attru   statu   S_ISREGu   chmodu   current_umask(   u   filenameu   locationu   flattenu   zipfpu   zipu   leadingu   infou   nameu   datau   fnu   diru   fpu   mode(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   unzip_fileß  s6    		
'c             C   sñ  t  j j | ƒ s" t  j | ƒ n  |  j ƒ  j d ƒ sL |  j ƒ  j d ƒ rU d } nh |  j ƒ  j d ƒ s |  j ƒ  j d ƒ rˆ d } n5 |  j ƒ  j d ƒ r¦ d } n t j d	 |  ƒ d
 } t j	 |  | ƒ } zt
 d d „  | j ƒ  Dƒ ƒ } xê| j ƒ  D]Ü} | j } | d k rqþ n  | r8t | ƒ d } n  t  j j | | ƒ } | j ƒ  r~t  j j | ƒ sÚt  j | ƒ qÚqþ | j ƒ  rÜy | j | | ƒ WqÚt j ƒ  d } t j d |  | j | f ƒ wþ YqÚXqþ y | j | ƒ }	 WnH t t f k
 r9t j ƒ  d } t j d |  | j | f ƒ wþ Yn Xt  j j t  j j | ƒ ƒ stt  j t  j j | ƒ ƒ n  t	 | d ƒ }
 z t j |	 |
 ƒ Wd |
 j ƒ  X|	 j ƒ  | j d @rþ t  j | d t ƒ  d Bƒ qþ qþ WWd | j ƒ  Xd S(   uŸ  
    Untar the file (with path `filename`) to the destination `location`.
    All files are written based on system defaults and umask (i.e. permissions
    are not preserved), except that regular file members with any execute
    permissions (user, group, or world) have "chmod +x" applied after being
    written.  Note that for windows, any execute changes using os.chmod are
    no-ops per the python docs.
    u   .gzu   .tgzu   r:gzu   .bz2u   .tbzu   r:bz2u   .taru   ru-   Cannot determine compression type for file %su   r:*c             S   s(   g  |  ] } | j  d  k r | j  ‘ q S(   u   pax_global_header(   u   name(   u   .0u   member(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>$  s   	 u   untar_file.<locals>.<listcomp>u   pax_global_headeri   u/   In the tar file %s the member %s is invalid: %su   wbNiI   iÿ  (   u   osu   pathu   existsu   makedirsu   loweru   endswithu   loggeru   warnu   tarfileu   openu   has_leading_diru
   getmembersu   nameu   split_leading_diru   joinu   isdiru   issymu   _extract_memberu   sysu   exc_infou   extractfileu   KeyErroru   AttributeErroru   dirnameu   shutilu   copyfileobju   closeu   modeu   chmodu   current_umask(   u   filenameu   locationu   modeu   taru   leadingu   memberu   fnu   pathu   eu   fpu   destfp(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   untar_file  sf    	*	*			
&c             C   s@   t  j d 8_ t  j d |  ƒ t  j d 7_ t j |  ƒ d  S(   Ni   u&   Creating supposed download cache at %s(   u   loggeru   indentu   notifyu   osu   makedirs(   u   folder(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   create_download_cache_folderX  s    c             C   sU   t  j d t |  ƒ ƒ t j | |  ƒ t |  d d ƒ } | j | ƒ | j ƒ  d  S(   Nu   Storing download in cache at %su   .content-typeu   w(   u   loggeru   notifyu   display_pathu   shutilu   copyfileu   openu   writeu   close(   u   target_fileu   temp_locationu   content_typeu   fp(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   cache_download_  s
    c             C   sC  t  j j |  ƒ }  | d k sZ |  j d ƒ sZ |  j d ƒ sZ |  j d ƒ sZ t j |  ƒ rz t |  | d |  j d ƒ ƒnÅ | d k s± t j |  ƒ s± t	 |  ƒ d j
 ƒ  d k rÁ t |  | ƒ n~ | r| j d ƒ rt t |  ƒ ƒ rd d l m } | d | j ƒ j | ƒ n* t j d |  | | f ƒ t d | ƒ ‚ d  S(   Nu   application/zipu   .zipu	   .pybundleu   .whlu   flattenu   application/x-gzipi   u   .taru   .tar.gzu   .tar.bz2u   .tgzu   .tbzu	   text/htmli    (   u
   Subversionu   svn+uZ   Cannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formatu%   Cannot determine archive format of %s(   u	   .pybundleu   .whl(   u   .taru   .tar.gzu   .tar.bz2u   .tgzu   .tbz(   u   osu   pathu   realpathu   endswithu   zipfileu
   is_zipfileu
   unzip_fileu   tarfileu
   is_tarfileu   splitextu   loweru
   untar_fileu
   startswithu   is_svn_pageu   file_contentsu   pip.vcs.subversionu
   Subversionu   urlu   unpacku   loggeru   fatalu   InstallationError(   u   filenameu   locationu   content_typeu   linku
   Subversion(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   unpack_fileg  s$     	c             C   sâ  | d  k r‹ g  } xd |  D]\ }	 d |	 k sO d |	 k sO d |	 k sO d |	 k rh d |	 j d d ƒ }	 n  | j |	 ƒ q Wd j | ƒ } n  | rš d  }
 n	 t j }
 t j | d | ƒ t j	 j
 ƒ  } | rÜ | j | ƒ n  y4 t j |  d t j d	 d  d
 |
 d | d | ƒ} Wn< t k
 rNt j ƒ  d } t j d | | f ƒ ‚  Yn Xg  } |
 d  k	 r| j }
 xÌ t |
 j ƒ  ƒ } | s‰Pn  | j ƒ  } | j | d ƒ | r| | ƒ } t | t ƒ rÖ| \ } } n  t j | | ƒ t j | ƒ st j ƒ  qqmt j | ƒ qmn! | j ƒ  \ } } | p3d g } | j ƒ  | j rÅ| r¥| r†t j d | ƒ t j d j | ƒ d ƒ n  t d | | j | f ƒ ‚ qÅt j  d | | j | f ƒ n  |
 d  k	 rÞd j | ƒ Sd  S(   Nu    u   
u   "u   'u   "%s"u   \"u   Running command %su   stderru   stdinu   stdoutu   cwdu   envi   u#   Error %s while executing command %su    u    Complete output from command %s:u)   
----------------------------------------u*   Command %s failed with error code %s in %su"   Command %s had error code %s in %s(!   u   Noneu   replaceu   appendu   joinu
   subprocessu   PIPEu   loggeru   logu   osu   environu   copyu   updateu   Popenu   STDOUTu	   Exceptionu   sysu   exc_infou   fatalu   stdoutu   console_to_stru   readlineu   rstripu
   isinstanceu   tupleu   stdout_level_matchesu   show_progressu   infou   communicateu   waitu
   returncodeu   notifyu   InstallationErroru   warn(   u   cmdu   show_stdoutu   filter_stdoutu   cwdu   raise_on_returncodeu   command_levelu   command_descu   extra_environu	   cmd_partsu   partu   stdoutu   envu   procu   eu
   all_outputu   lineu   levelu   returned_stdoutu   returned_stderr(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   call_subprocess€  sp    0			
	c             C   sE   t  j |  ƒ } | d k r d St  j | ƒ } t d d „  | Dƒ ƒ S(   uØ   
    Attempt to determine if this is a pre-release using PEP386/PEP426 rules.

    Will return True if it is a pre-release and False if not. Versions are
    assumed to be a pre-release if they cannot be parsed.
    c             S   s)   g  |  ] } t  d  d „  | Dƒ ƒ ‘ q S(   c          	   S   s1   g  |  ]' } | t  d  d d d d g ƒ k ‘ q S(   u   au   bu   cu   rcu   dev(   u   set(   u   .0u   y(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>Ñ  s   	 u,   is_prerelease.<locals>.<listcomp>.<listcomp>(   u   any(   u   .0u   x(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu
   <listcomp>Ñ  s   	 u!   is_prerelease.<locals>.<listcomp>NT(   u   versionu   _suggest_normalized_versionu   Noneu   Trueu   _normalized_keyu   any(   u   versu
   normalizedu   parsed(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   is_prereleaseÃ  s
    u   is_prereleasec             B   sV   |  Ee  Z d  Z d d d d „ Z d d „  Z d d „  Z d d „  Z d	 d
 „  Z d S(   u   BuildDirectoryc             C   sm   | d  k r! | d  k r! d } n  | d  k rW t j d d ƒ } | d  k rW d } qW n  | |  _ | |  _ d  S(   Nu   prefixu
   pip-build-T(   u   Noneu   Trueu   tempfileu   mkdtempu   nameu   delete(   u   selfu   nameu   delete(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __init__Ö  s    		u   BuildDirectory.__init__c             C   s   d j  |  j j |  j ƒ S(   Nu	   <{} {!r}>(   u   formatu	   __class__u   __name__u   name(   u   self(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __repr__æ  s    u   BuildDirectory.__repr__c             C   s   |  j  S(   N(   u   name(   u   self(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu	   __enter__é  s    u   BuildDirectory.__enter__c             C   s   |  j  ƒ  d  S(   N(   u   cleanup(   u   selfu   excu   valueu   tb(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   __exit__ì  s    u   BuildDirectory.__exit__c             C   s   |  j  r t |  j ƒ n  d  S(   N(   u   deleteu   rmtreeu   name(   u   self(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   cleanupï  s    	u   BuildDirectory.cleanupN(	   u   __name__u
   __module__u   __qualname__u   Noneu   __init__u   __repr__u	   __enter__u   __exit__u   cleanup(   u
   __locals__(    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   BuildDirectoryÔ  s
   u   BuildDirectoryFT(   u
   setuptoolsu   pipu   pythonu
   distribute(Q   u   sysu   shutilu   osu   statu   reu	   posixpathu   zipfileu   tarfileu
   subprocessu   textwrapu   tempfileu   pip.exceptionsu   InstallationErroru
   BadCommandu   PipErroru   pip.backwardcompatu   WindowsErroru   string_typesu	   raw_inputu   console_to_stru	   user_siteu   PermissionErroru   pip.locationsu   site_packagesu   running_under_virtualenvu   virtualenv_no_globalu   pip.logu   loggeru   pip._vendoru   pkg_resourcesu   pip._vendor.distlibu   versionu   __all__u   get_progu   Falseu   rmtreeu   rmtree_errorhandleru   display_pathu
   backup_diru   Noneu   find_commandu   get_pathextu   ask_path_existsu   asku   objectu   _Infu   Infu   compileu   Iu   _normalize_reu   normalize_nameu   format_sizeu   is_installable_diru   is_svn_pageu   file_contentsu   split_leading_diru   has_leading_diru   make_path_relativeu   normalize_pathu   splitextu   renamesu   is_localu   dist_is_localu   dist_in_usersiteu   dist_in_site_packagesu   dist_is_editableu   Trueu   get_installed_distributionsu   egg_link_pathu   dist_locationu   get_terminal_sizeu   current_umasku
   unzip_fileu
   untar_fileu   create_download_cache_folderu   cache_downloadu   unpack_fileu   DEBUGu   call_subprocessu   is_prereleaseu   BuildDirectory(    (    (    u!   /tmp/pip-zej_zi-build/pip/util.pyu   <module>   s–   .							
		'"-L	?