
0c@_am                 @   s  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 Z
 d  d l Z d  d l Z d  d l m Z d  d l m Z d  d l m Z d  d l m Z d  d l m Z d  d l m Z m Z d  d	 l m Z m Z m Z m Z m Z d  d
 l  m! Z" d  d l# m$ Z% d  d l& m' Z' d  d l( m) Z) d  d l* m+ Z+ m, Z, m- Z- d  d l. m/ Z/ m0 Z0 m1 Z1 m2 Z2 d  d l3 m4 Z4 m5 Z5 d  d l6 m7 Z7 m8 Z8 e rd  d l m9 Z: n d  d l m: Z: e4 r|d  d l; m< Z< m= Z= m> Z> m? Z? m@ Z@ mA ZA mB ZB mC ZC mD ZD mE ZE mF ZF mG ZG d  d lH mI ZI eE eJ eJ eJ f ZK eF d  ZL d d d d d d d d d d  d! d" d# d$ g ZM e jN eO  ZP d% d&   ZQ d' d(   ZR d) d"   ZS d* d    ZT e d+ d, d- d.  d/ d0 d   ZU d1 d2   ZV d3 d4   ZW d5 d   ZX d6 d7 d  ZY d8 d9   ZZ d: d;   Z[ d< d   Z\ d= d>   Z] d? d@   Z^ dA d   Z_ dB dC   Z` dD d   Za e jb dE dF  Zc dG dH d  Zd dI d   Ze dJ d   Zf dK dL   Zg dM dN   Zh dO dP   Zi dQ dR   Zj dS dT   Zk dG e1 dG d/ d/ d dU dV  Zl dW dX   Zm dY dZ   Zn d[ d\   Zo d] d^   Zp d_ d`   Zq Gda db   db er  Zs Gdc dd   dd e:  Zt e ju de df    Zv dg d!   Zw dh di   Zx d dj d#  Zy dk dl   Zz dm dn   Z{ do dp   Z| dq dr ds  Z} dt du   Z~ dv dw   Z dx dy   Z dz d{   Z d| d}   Z d~ d   Z d d   Z d d$   Z d d   Z Gd d   d er  Z d d   Z d d   Z d d   Z d d   Z d d d  Z d d   Z d d   Z d d   Z d S)    )absolute_importN)deque)tee)pkg_resources)canonicalize_name)retry)PY2	text_type)filterfilterfalseinputmapzip_longest)parse)unquote)__version__)CommandError)get_major_minor_versionsite_packages	user_site)WINDOWS
expanduserstdlib_pkgsstr_to_display)MYPY_CHECK_RUNNINGcast)running_under_virtualenvvirtualenv_no_global)BytesIO)StringIO)AnyAnyStrCallable	ContainerIterableIteratorListOptionalTextTupleTypeVarUnion)DistributionTrmtreedisplay_path
backup_dirasksplitextformat_sizeis_installable_dirnormalize_pathrenamesget_progcaptured_stdout
ensure_dirget_installed_versionremove_auth_from_urlc              C   sL   t  j j t  j j t  d d  }  t  j j |   }  d j t |  t    S)Nz..zpip {} from {} (python {}))	ospathjoindirname__file__abspathformatr   r   )pip_pkg_dir rD   7/tmp/pip-build-jynh7p1z/pip/pip/_internal/utils/misc.pyget_pip_versionN   s    $rF   c             C   s\   t  |   d k  r- |  d t  |   d 7}  n" t  |   d k rO |  d d  }  t d |   S)ax  
    Convert a tuple of ints representing a Python version to one of length
    three.

    :param py_version_info: a tuple of ints representing a Python version,
        or None to specify no version. The tuple can have any length.

    :return: a tuple of length three if `py_version_info` is non-None.
        Otherwise, return `py_version_info` unchanged (i.e. None).
       r   NVersionInfo)r   )lenr   )Zpy_version_inforD   rD   rE   normalize_version_infoZ   s
    rJ   c             C   sd   y t  j |   WnL t k
 r_ } z, | j t j k rM | j t j k rM   WYd d } ~ Xn Xd S)z os.path.makedirs without EEXIST.N)r<   makedirsOSErrorerrnoEEXISTZ	ENOTEMPTY)r=   erD   rD   rE   r9   n   s
    $c              C   s_   y= t  j j t j d  }  |  d k r8 d j t j  S|  SWn t t t	 f k
 rZ Yn Xd S)Nr   __main__.py-cz	{} -m pippip)rP   rQ   )
r<   r=   basenamesysargvrB   
executableAttributeError	TypeError
IndexError)progrD   rD   rE   r7   y   s    stop_max_delayi  
wait_fixedi  Fc             C   s   t  j |  d | d t d  S)Nignore_errorsonerror)shutilr.   rmtree_errorhandler)dirr]   rD   rD   rE   r.      s    c             C   sk   y t  j |  j t j @} Wn t t f k
 r< d SYn X| rd t  j | t j  |  |  d S  d S)zOn 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.N)r<   statst_modeS_IWRITEIOErrorrL   chmod)funcr=   exc_infoZhas_attr_readonlyrD   rD   rE   r`      s    	
r`   c             C   s   |  d k r d St  |  t  r# |  Sy |  j t j   d  } Wn< t k
 r} t rm t d j |    } n t	 |   } Yn X| S)z
    Convert a bytes (or text) path to text (unicode in Python 2) for display
    and logging purposes.

    This function should never error out. Also, this function is mainly needed
    for Python 2 since in Python 3 str paths are already text.
    Nstrictzb{!r})

isinstancer	   decoderT   getfilesystemencodingUnicodeDecodeErrorr   r   rB   ascii)r=   r/   rD   rD   rE   path_to_display   s    	ro   c             C   s   t  j j t  j j |    }  t j d d k ra |  j t j   d  }  |  j t j	   d  }  |  j
 t  j   t  j j  r d |  t t  j    d  }  |  S)zTGives the display value for a given path, making it relative to cwd
    if possible.r      replace.N)r<   r=   normcaserA   rT   version_infork   rl   encodegetdefaultencoding
startswithgetcwdseprI   )r=   rD   rD   rE   r/      s     z.bakc             C   sK   d } | } x4 t  j j |  |  rB | d 7} | t |  } q W|  | S)z\Figure out the name of a directory to back up the given dir to
    (adding .bak, .bak2, etc)   )r<   r=   existsstr)ra   extn	extensionrD   rD   rE   r0      s    
c             C   sC   x3 t  j j d d  j   D] } | | k r | Sq Wt |  |  S)NPIP_EXISTS_ACTION )r<   environgetsplitr1   )messageoptionsactionrD   rD   rE   ask_path_exists   s    "r   c             C   s+   t  j j d  r' t d j |     d S)z&Raise an error if no input is allowed.PIP_NO_INPUTz7No input was expected ($PIP_NO_INPUT set); question: {}N)r<   r   r   	ExceptionrB   )r   rD   rD   rE   _check_no_input   s    r   c             C   se   x^ t  |   t |   } | j   j   } | | k rY t d j | d j |    q | Sq Wd S)z@Ask the message interactively, with the given possible responsesz>Your response ({!r}) was not one of the expected responses: {}z, N)r   r   striplowerprintrB   r>   )r   r   responserD   rD   rE   r1      s    
c             C   s   t  |   t |   S)zAsk for input interactively.)r   r   )r   rD   rD   rE   	ask_input   s    
r   c             C   s   t  |   t j |   S)z!Ask for a password interactively.)r   getpass)r   rD   rD   rE   ask_password  s    
r   c             C   sx   |  d k r! d j  |  d d  S|  d	 k rD d j  t |  d   S|  d k ra d j  |  d  Sd j  t |    Sd  S)
Ni  z	{:.1f} MBg     @@
   z{} kBz	{:.1f} kBz{} bytesi@B i'  )rB   int)bytesrD   rD   rE   r3     s    c                sU   d d   |  D }  d d   t  |  d d  D     f d d   |  D } |   f S)zReturn a list of formatted rows and a list of column sizes.

    For example::

    >>> tabulate([['foobar', 2000], [0xdeadbeef]])
    (['foobar     2000', '3735928559'], [10, 4])
    c             S   s%   g  |  ] } t  t t |    q SrD   )tupler   r|   ).0rowrD   rD   rE   
<listcomp>"  s   	 ztabulate.<locals>.<listcomp>c             S   s%   g  |  ] } t  t t |    q SrD   )maxr   rI   )r   colrD   rD   rE   r   #  s   	 	fillvaluer   c                s4   g  |  ]* } d  j  t t j |     j    q S) )r>   r   r|   ljustrstrip)r   r   )sizesrD   rE   r   $  s   	 )r   )ZrowstablerD   )r   rE   tabulate  s    	r   c             C   sp   t  j j |   s d St  j j |  d  } t  j j |  rA d St  j j |  d  } t  j j |  rl d Sd S)zBIs path is a directory containing setup.py or pyproject.toml?
    Fzsetup.pyTzpyproject.toml)r<   r=   isdirr>   isfile)r=   setup_pyZpyproject_tomlrD   rD   rE   r4   (  s    c             c   s&   x |  j  |  } | s P| Vq Wd S)z7Yield pieces of data from a file-like object until EOF.N)read)filesizechunkrD   rD   rE   read_chunks7  s
    r   Tc             C   sI   t  |   }  | r' t j j |   }  n t j j |   }  t j j |   S)zN
    Convert a path to its canonical, case-normalized, absolute version.

    )r   r<   r=   realpathrA   rs   )r=   resolve_symlinksrD   rD   rE   r5   @  s
    c             C   sX   t  j |   \ } } | j   j d  rN | d d  | } | d d  } | | f S)z,Like os.path.splitext, but take off .tar tooz.tar   Nr   )	posixpathr2   r   endswith)r=   baser}   rD   rD   rE   r2   N  s
    c             C   s   t  j j |  \ } } | rD | rD t  j j |  rD t  j |  t j |  |  t  j j |   \ } } | r | r y t  j |  Wn t k
 r Yn Xd S)z7Like os.renames(), but handles renaming across devices.N)	r<   r=   r   r{   rK   r_   move
removedirsrL   )oldnewheadtailrD   rD   rE   r6   X  s    c             C   s#   t    s d S|  j t t j   S)z
    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."

    Caution: this function assumes the head of path has been normalized
    with normalize_path.
    T)r   rw   r5   rT   prefix)r=   rD   rD   rE   is_localj  s    
	r   c             C   s   t  t |    S)z
    Return True if given Distribution object is installed locally
    (i.e. within current virtualenv).

    Always True if we're not in a virtualenv.

    )r   dist_location)distrD   rD   rE   dist_is_localy  s    	r   c             C   s   t  |   j t t   S)zF
    Return True if given Distribution is installed in user site.
    )r   rw   r5   r   )r   rD   rD   rE   dist_in_usersite  s    r   c             C   s   t  |   j t t   S)z[
    Return True if given Distribution is installed in
    sysconfig.get_python_lib().
    )r   rw   r5   r   )r   rD   rD   rE   dist_in_site_packages  s    r   c             C   sJ   xC t  j D]8 } t j j | |  j d  } t j j |  r
 d Sq
 Wd S)zC
    Return True if given Distribution is an editable install.
    z	.egg-linkTF)rT   r=   r<   r>   project_namer   )r   	path_itemegg_linkrD   rD   rE   dist_is_editable  s
    r   c                s   | r t  j |  } n	 t  j } |  r0 t  n d d    | rQ d d     n d d     | rr d d    n d d    | r t  n d	 d
          f d d   | D S)a^  
    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 stdlib_pkgs

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

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

    If ``user_only`` is True , only report installations in the user
    site directory.

    If ``paths`` is set, only report the distributions present at the
    specified list of locations.
    c             S   s   d S)NTrD   )drD   rD   rE   
local_test  s    z/get_installed_distributions.<locals>.local_testc             S   s   d S)NTrD   )r   rD   rD   rE   editable_test  s    z2get_installed_distributions.<locals>.editable_testc             S   s   t  |   S)N)r   )r   rD   rD   rE   r     s    c             S   s
   t  |   S)N)r   )r   rD   rD   rE   editables_only_test  s    z8get_installed_distributions.<locals>.editables_only_testc             S   s   d S)NTrD   )r   rD   rD   rE   r     s    c             S   s   d S)NTrD   )r   rD   rD   rE   	user_test  s    z.get_installed_distributions.<locals>.user_testc                sU   g  |  ]K }  |  r | j   k r   |  r  |  r  |  r |  q SrD   )key)r   r   )r   r   r   skipr   rD   rE   r     s   	 z/get_installed_distributions.<locals>.<listcomp>)r   
WorkingSetworking_setr   r   )
local_onlyr   include_editableseditables_only	user_onlypathsr   rD   )r   r   r   r   r   rE   get_installed_distributions  s     			r   c             C   sY   t  |   }  t d d d f  d d d d d d d d	  } d
 d   | D } | j |   S)zFind a distribution matching the ``req_name`` in the environment.

    This searches from *all* distributions available in the environment, to
    match the behavior of ``pkg_resources.get_distribution()``.
    r   Fr   r   Tr   r   r   Nc             S   s"   i  |  ] } | t  | j   q SrD   )r   r   )r   prD   rD   rE   
<dictcomp>  s   	 z(_search_distribution.<locals>.<dictcomp>)r   r   r   )req_namepackagesZpkg_dictrD   rD   rE   _search_distribution  s    
	r   c             C   sL   t  |   } | sB y t j j |   Wn t j k
 rA d SYn Xt  |   S)zGiven a requirement name, return the installed Distribution object.

    This searches from *all* distributions available in the environment, to
    match the behavior of ``pkg_resources.get_distribution()``.
    N)r   r   r   requireDistributionNotFound)r   r   rD   rD   rE   get_distribution  s    		r   c             C   s   g  } t    r< | j t  t   r\ t r\ | j t  n  t rO | j t  | j t  x@ | D]8 } t j j | |  j  d } t j j	 |  rc | Sqc Wd S)a  
    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.
    z	.egg-linkN)
r   appendr   r   r   r<   r=   r>   r   r   )r   sitessiteegglinkrD   rD   rE   egg_link_path  s    	r   c             C   s)   t  |   } | r t |  St |  j  S)aO  
    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.

    The returned location is normalized (in particular, with symlinks removed).
    )r   r5   location)r   r   rD   rD   rE   r   =  s    

r   c             G   s   t  j |  |  d  S)N)loggerinfo)msgargsrD   rD   rE   write_outputM  s    r   c               @   s:   e  Z d  Z d Z d d   Z d d   Z d d   Z d S)	FakeFilezQWrap a list of lines in an object with readline() to make
    ConfigParser happy.c             C   s   t  |  |  _ d  S)N)iter_gen)selflinesrD   rD   rE   __init__U  s    zFakeFile.__init__c             C   s.   y t  |  j  SWn t k
 r) d SYn Xd  S)Nr   )nextr   StopIteration)r   rD   rD   rE   readlineX  s    zFakeFile.readlinec             C   s   |  j  S)N)r   )r   rD   rD   rE   __iter__^  s    zFakeFile.__iter__N)__name__
__module____qualname____doc__r   r   r   rD   rD   rD   rE   r   R  s   r   c               @   s4   e  Z d  Z e d d    Z e d d    Z d S)StreamWrapperc             C   s   | |  _  |    S)N)orig_stream)clsr   rD   rD   rE   from_streamd  s    	zStreamWrapper.from_streamc             C   s
   |  j  j S)N)r   encoding)r   rD   rD   rE   r   j  s    zStreamWrapper.encodingN)r   r   r   classmethodr   propertyr   rD   rD   rD   rE   r   b  s   r   c             c   sR   t  t |   } t t |  t j |   z t  t |   VWd t t |  |  Xd S)zReturn a context manager used by captured_stdout/stdin/stderr
    that temporarily replaces the sys stream *stream_name* with a StringIO.

    Taken from Lib/support/__init__.py in the CPython repo.
    N)getattrrT   setattrr   r   )stream_nameorig_stdoutrD   rD   rE   captured_outputo  s
    r   c               C   s
   t  d  S)zCapture the output of sys.stdout:

       with captured_stdout() as stdout:
           print('hello')
       self.assertEqual(stdout.getvalue(), 'hello
')

    Taken from Lib/support/__init__.py in the CPython repo.
    stdout)r   rD   rD   rD   rE   r8   ~  s    	c               C   s
   t  d  S)z 
    See captured_stdout().
    stderr)r   rD   rD   rD   rE   captured_stderr  s    r  c             C   sJ   t  j j |   } | d k r* t  j   } | j |  } | rF | j Sd S)zCGet the installed version of dist_name avoiding pkg_resources cacheN)r   Requirementr   r   findversion)	dist_namer   reqr   rD   rD   rE   r:     s
    c             C   s   t  |  d d d S)zConsume an iterable at C speed.maxlenr   N)r   )iteratorrD   rD   rE   consume  s    r	  c              O   sW   t  t |  t t |     |  } d d   | j   D } | | d <t d f  |  S)Nc             S   s   i  |  ] \ } } | |  q SrD   rD   )r   r   valuerD   rD   rE   r     s   	 zenum.<locals>.<dictcomp>Zreverse_mappingEnum)dictziprangerI   itemstype)Z
sequentialnamedZenumsreverserD   rD   rE   enum  s    $
r  c             C   s;   | d k r |  Sd |  k r+ d j  |   }  d j  |  |  S)z.
    Build a netloc from a host-port pair
    N:z[{}]z{}:{})rB   )hostportrD   rD   rE   build_netloc  s
    r  httpsc             C   sL   |  j  d  d k r< d |  k r< d |  k r< d j |   }  d j | |   S)z)
    Build a full URL from a netloc.
    r  rp   @[z[{}]z{}://{})countrB   )netlocschemerD   rD   rE   build_url_from_netloc  s    -r  c             C   s+   t  |   } t j |  } | j | j f S)z2
    Return the host-port pair from a netloc.
    )r  urllib_parseurlparsehostnamer  )r  urlparsedrD   rD   rE   parse_netloc  s    r$  c             C   s~   d |  k r |  d f S|  j  d d  \ } }  d | k rO | j d d  } n | d f } t d d   | D  } |  | f S)zp
    Parse out and remove the auth information from a netloc.

    Returns: (netloc, (username, password)).
    r  Nrz   r  c             s   s-   |  ]# } | d  k r d  n	 t  |  Vq d  S)N)urllib_unquote)r   xrD   rD   rE   	<genexpr>  s    z)split_auth_from_netloc.<locals>.<genexpr>)NN)rsplitr   r   )r  auth	user_passrD   rD   rE   split_auth_from_netloc  s    
r+  c             C   st   t  |   \ }  \ } } | d k r( |  S| d k rC d } d } n t j |  } d } d j d | d | d |   S)	z
    Replace the sensitive data in a netloc with "****", if it exists.

    For example:
        - "user:pass@example.com" returns "user:****@example.com"
        - "accesstoken@example.com" returns "****@example.com"
    Nz****r   z:****z{user}{password}@{netloc}userpasswordr  )r+  r  quoterB   )r  r,  r-  rD   rD   rE   redact_netloc  s    		r/  c             C   s\   t  j |   } | | j  } | j | d | j | j | j f } t  j |  } | | f S)aR  Transform and replace netloc in a url.

    transform_netloc is a function taking the netloc and returning a
    tuple. The first element of this tuple is the new netloc. The
    entire tuple is returned.

    Returns a tuple containing the transformed url as item 0 and the
    original tuple returned by transform_netloc as item 1.
    r   )r  urlsplitr  r  r=   queryfragment
urlunsplit)r"  Ztransform_netlocZpurlZnetloc_tupleZ
url_piecesZsurlrD   rD   rE   _transform_url  s
    
%r4  c             C   s
   t  |   S)N)r+  )r  rD   rD   rE   _get_netloc  s    r5  c             C   s   t  |   f S)N)r/  )r  rD   rD   rE   _redact_netloc  s    r6  c             C   s(   t  |  t  \ } \ } } | | | f S)z
    Parse a url into separate netloc, auth, and url with no auth.

    Returns: (url_without_auth, netloc, (username, password))
    )r4  r5  )r"  Zurl_without_authr  r)  rD   rD   rE   split_auth_netloc_from_url!  s    r7  c             C   s   t  |  t  d S)z7Return a copy of url with 'username:password@' removed.r   )r4  r5  )r"  rD   rD   rE   r;   ,  s    c             C   s   t  |  t  d S)z.Replace the password in a given url with ****.r   )r4  r6  )r"  rD   rD   rE   redact_auth_from_url4  s    r8  c               @   sL   e  Z d  Z d d   Z d d   Z d d   Z d d   Z d	 d
   Z d S)
HiddenTextc             C   s   | |  _  | |  _ d  S)N)secretredacted)r   r:  r;  rD   rD   rE   r   ;  s    	zHiddenText.__init__c             C   s   d j  t |    S)Nz<HiddenText {!r}>)rB   r|   )r   rD   rD   rE   __repr__D  s    zHiddenText.__repr__c             C   s   |  j  S)N)r;  )r   rD   rD   rE   __str__H  s    zHiddenText.__str__c             C   s,   t  |   t  |  k r d S|  j | j k S)NF)r  r:  )r   otherrD   rD   rE   __eq__M  s    zHiddenText.__eq__c             C   s   |  | k S)NrD   )r   r>  rD   rD   rE   __ne__X  s    zHiddenText.__ne__N)r   r   r   r   r<  r=  r?  r@  rD   rD   rD   rE   r9  :  s
   	r9  c             C   s   t  |  d d S)Nr;  z****)r9  )r
  rD   rD   rE   
hide_value]  s    rA  c             C   s   t  |   } t |  d | S)Nr;  )r8  r9  )r"  r;  rD   rD   rE   hide_urlb  s    rB  c             C   s   d d j  t j d  d j  t j d d    g } |  o] t o] t j j t j d  | k } | r t j d d g t j d	 d  } t	 d
 j  d j
 |     d S)zProtection of pip.exe from modification on Windows

    On Windows, any operation modifying pip should be run as:
        python -m pip ...
    zpip.exez	pip{}.exer   zpip{}.{}.exeNrp   z-mrR   rz   z3To modify pip, please run the following command:
{}r   )rB   rT   rt   r   r<   r=   rS   rU   rV   r   r>   )Zmodifying_pipZ	pip_namesZshould_show_use_python_msgZnew_commandrD   rD   rE   (protect_pip_from_modification_on_windowsh  s    rC  c               C   s   t  j d k	 o t  j j   S)z!Is this console interactive?
    N)rT   stdinisattyrD   rD   rD   rE   is_console_interactive  s    rF  rz      c             C   so   t  j   } d } t |  d  A } x7 t | d | D]# } | t |  7} | j |  q7 WWd QRX| | f S)z:Return (hash, length) for path using hashlib.sha256()
    r   rbr   N)hashlibsha256openr   rI   update)r=   	blocksizehlengthfblockrD   rD   rE   	hash_file  s    rR  c              C   s-   y d d l  }  Wn t k
 r( d SYn Xd S)z8
    Return whether the wheel package is installed.
    r   NFT)wheelImportError)rS  rD   rD   rE   is_wheel_installed  s
    	rU  c             C   s   t  |   }  t |  |   S)zb
    Return paired elements.

    For example:
        s -> (s0, s1), (s2, s3), (s4, s5), ...
    )r   r   )iterablerD   rD   rE   pairwise  s    rW  c             C   s.   t  |  \ } } t |  |  t |  |  f S)z
    Use a predicate to partition entries into false entries and true entries,
    like

        partition(is_odd, range(10)) --> 0 2 4 6 8   and  1 3 5 7 9
    )r   r   r
   )predrV  t1t2rD   rD   rE   	partition  s    r[  i   )
__future__r   
contextlibrM   r   rI  iologgingr<   r   r_   rb   rT   collectionsr   	itertoolsr   Zpip._vendorr   pip._vendor.packaging.utilsr   Zpip._vendor.retryingr   Zpip._vendor.sixr   r	   Zpip._vendor.six.movesr
   r   r   r   r   Zpip._vendor.six.moves.urllibr   r  Z"pip._vendor.six.moves.urllib.parser   r%  rR   r   Zpip._internal.exceptionsr   Zpip._internal.locationsr   r   r   Zpip._internal.utils.compatr   r   r   r   Zpip._internal.utils.typingr   r   Zpip._internal.utils.virtualenvr   r   r   r   Ztypingr    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   Zpip._vendor.pkg_resourcesr,   r   rH   r-   __all__	getLoggerr   r   rF   rJ   r9   r7   r.   r`   ro   r/   r0   r   r   r1   r   r   r3   r   r4   DEFAULT_BUFFER_SIZEr   r5   r2   r6   r   r   r   r   r   r   r   r   r   r   r   objectr   r   contextmanagerr   r8   r  r:   r	  r  r  r  r$  r+  r/  r4  r5  r6  r7  r;   r8  r9  rA  rB  rC  rF  rR  rU  rW  r[  rD   rD   rD   rE   <module>   s   ("R	"
	
	>$
#