\e[c@@sddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZddlmZddlmZddlmZddlmZddlmZdd lmZm Z m!Z!m"Z"dd l#m$Z$m%Z%dd l&m'Z'm(Z(m)Z)m*Z*m+Z+erdd lm,Z-ndd lm-Z-ddddddddddddddddddd d!d"d#d$d%gZ.ej/e0Z1diZ2djZ3dkZ4dlZ5e4e2e5e3Z6e4e5Z7yddl8Z8e7e27Z7Wne9k rle1j:d2nXyddl;Z;e7e37Z7Wne9k re1j:d3nXd4Z<d5Z=d6Z>ed7d8d9d:e?d;Z@d<ZAd=ZBd>d?ZCd@ZDdAZEdBZFdCZGdDZHdEZIejJdFZKdGZLdHZMeNdIZOdJZPdKZQdLZRdMZSdNZTdOZUdPZVeNe"eNe?e?dQZWdRZXdSZYdTZZeNdUZ[dVZ\dWZ]eNddXdddddYZ_dZZ`d[Zad\ebfd]YZcd^e-fd_YZdejed`ZfdaZgdbebfdcYZhdddZideZjdfZkdgZldhZmdS(mi(tabsolute_importN(tdeque(t pkg_resources(tretry(tPY2(tinput(tparse(tWINDOWStconsole_to_strt expandusert stdlib_pkgs(t CommandErrortInstallationError(trunning_under_virtualenvt site_packagest user_sitetvirtualenv_no_globaltwrite_delete_marker_file(tBytesIO(tStringIOtrmtreet display_patht backup_dirtasktsplitextt format_sizetis_installable_dirt is_svn_paget file_contentstsplit_leading_dirthas_leading_dirtnormalize_pathtrenamestget_progt unzip_filet untar_filet unpack_filetcall_subprocesstcaptured_stdoutt ensure_dirtARCHIVE_EXTENSIONStSUPPORTED_EXTENSIONStget_installed_versiontremove_auth_from_urls.tar.bz2s.tbzs.tar.xzs.txzs.tlzs.tar.lzs .tar.lzmas.zips.whls.tar.gzs.tgzs.tarsbz2 module is not availableslzma module is not availablecO@s5yt|SWn tk r0|||nXdS(N(t __import__t ImportError(tpkg_or_module_stringt ExceptionTypetargstkwargs((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pytimport_or_raiseOs cC@sCytj|Wn+tk r>}|jtjkr?q?nXdS(s os.path.makedirs without EEXIST.N(tostmakedirstOSErrorterrnotEEXIST(tpathte((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR'Vs cC@sYy8tjjtjd}|dkr3dtjS|SWntttfk rTnXdS(Nis __main__.pys-cs %s -m piptpip(s __main__.pys-c( R3R8tbasenametsystargvt executabletAttributeErrort TypeErrort IndexError(tprog((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR!_s  tstop_max_delayi t wait_fixedicC@stj|d|dtdS(Nt ignore_errorstonerror(tshutilRtrmtree_errorhandler(tdirRE((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyRlscC@sAtj|jtj@r:tj|tj||dSdS(sOn 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(R3tstattst_modetS_IREADtchmodtS_IWRITE(tfuncR8texc_info((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyRHrs  cC@stjjtjj|}tjddkrd|jtjd}|jtj d}n|j tj tjj rd|t tj }n|S(sTGives the display value for a given path, making it relative to cwd if possible.iitreplacet.(R3R8tnormcasetabspathR<t version_infotdecodetgetfilesystemencodingtencodetgetdefaultencodingt startswithtgetcwdtseptlen(R8((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyRss.bakcC@sKd}|}x4tjj||rB|d7}|t|}qW||S(s\Figure out the name of a directory to back up the given dir to (adding .bak, .bak2, etc)i(R3R8texistststr(RItexttnt extension((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyRs  cC@sCx3tjjddjD]}||kr|SqWt||S(NtPIP_EXISTS_ACTIONt(R3tenvirontgettsplitR(tmessagetoptionstaction((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pytask_path_existss" cC@syxrtjjdr(td|nt|}|jj}||krmd|dj|fGHq|SqWdS(s@Ask the message interactively, with the given possible responsest PIP_NO_INPUTs7No input was expected ($PIP_NO_INPUT set); question: %ss<Your response (%r) was not one of the expected responses: %ss, N(R3ReRft ExceptionRtstriptlowertjoin(RhRitresponse((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyRs   cC@sX|dkrd|ddS|d kr4d|dS|dkrLd|dSd|SdS( Nis%.1fMBg@@i s%ikBs%.1fkBs%ibytesi@Bi'((tbytes((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyRs     cC@sEtjj|stStjj|d}tjj|rAtStS(s@Return True if `path` is a directory containing a setup.py file.ssetup.py(R3R8tisdirtFalseRptisfiletTrue(R8tsetup_py((s7/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyRs cC@s(tjd|o'tjd|tjS(sT Returns true if the page appears to be the index page of an svn repository s[^<]*Revision \d+:s#���Powered by (?:<a[^>]*?>)?Subversion(���t���ret���searcht���I(���t���html(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR������s����c���������C@��s/���t��|��d���}�|�j���j�d��SWd��QXd��S(���Nt���rbs���utf-8(���t���opent���readRV���(���t���filenamet���fp(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR������s����c���������c@��s/���x(�t��r*�|��j�|��}�|�s"�Pn��|�Vq�Wd�S(���s7���Yield pieces of data from a file-like object until EOF.N(���Rv���R~���(���t���filet���sizet���chunk(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt ���read_chunks���s ���� c���������C@��s���|��j��d��j��d��}��d�|��k�rj�d�|��k�rN�|��j�d��|��j�d��k��sZ�d�|��k�rj�|��j�d�d��Sd�|��k�r�|��j�d�d��S|��d�f�Sd��S(���Nt���/s���\i���Rd���(���t���lstript���findRg���(���R8���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR������s����6  c���������C@��s\���d�}�xO�|��D]G�}�t�|��\�}�}�|�s/�t�S|�d�k�rD�|�}�q �|�|�k�r �t�Sq �Wt�S(���sy���Returns true if all the paths have the same leading path name (i.e., everything is in one subdirectory in an archive)N(���t���NoneR���Rt���Rv���(���t���pathst ���common_prefixR8���t���prefixt���rest(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR������s����    c���������C@��sI���t��|���}��|�r'�t�j�j�|���}��n�t�j�j�|���}��t�j�j�|���S(���sN��� Convert a path to its canonical, case-normalized, absolute version. (���R ���R3���R8���t���realpathRT���RS���(���R8���t���resolve_symlinks(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR������s ���� c���������C@��sO���t��j�|���\�}�}�|�j���j�d��rE�|�d�|�}�|�d� }�n��|�|�f�S(���s,���Like os.path.splitext, but take off .tar toos���.tari(���t ���posixpathR���Ro���t���endswith(���R8���t���baseR`���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR�����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�q�Xn��d�S(���s7���Like os.renames(), but handles renaming across devices.N( ���R3���R8���Rg���R^���R4���RG���t���movet ���removedirsR5���(���t���oldt���newt���headt���tail(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR ��� ��s����  c���������C@��s)���t����s �t�St�|���j�t�t�j���S(���s��� 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." (���R ���Rv���R���RZ���R<���R���(���R8���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���is_local��s���� c���������C@��s���t��t�|����S(���s��� Return True if given Distribution object is installed locally (i.e. within current virtualenv). Always True if we're not in a virtualenv. (���R���t ���dist_location(���t���dist(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt ���dist_is_local*��s����c���������C@��s%���t��t�|����}�|�j�t��t���S(���sF��� Return True if given Distribution is installed in user site. (���R���R���RZ���R���(���R���t ���norm_path(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���dist_in_usersite5��s����c���������C@��s���t��t�|����j�t��t���S(���s[��� Return True if given Distribution is installed in sysconfig.get_python_lib(). (���R���R���RZ���R���(���R���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���dist_in_site_packages=��s����c���������C@��sJ���xC�t��j�D]8�}�t�j�j�|�|��j�d��}�t�j�j�|��r �t�Sq �Wt�S(���s$���Is distribution an editable install?s ���.egg-link(���R<���R8���R3���Rp���t ���project_nameRu���Rv���Rt���(���R���t ���path_itemt���egg_link(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���dist_is_editableG��s ����c��� ������C@��s���|��r�t��}�n �d���}�|�r*�d���}�n �d���}�|�rE�d���}�n �d���}�|�r]�t�}�n �d���}�g��t�j�D]K�} �|�| ��rp�| �j�|�k�rp�|�| ��rp�|�| ��rp�|�| ��rp�| �^�qp�S(���s�� 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. c���������S@��s���t��S(���N(���Rv���(���t���d(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt ���local_testi��s����c���������S@��s���t��S(���N(���Rv���(���R���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt ���editable_testm��s����c���������S@��s ���t��|��� S(���N(���R���(���R���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR���p��s����c���������S@��s ���t��|���S(���N(���R���(���R���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���editables_only_testt��s����c���������S@��s���t��S(���N(���Rv���(���R���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR���w��s����c���������S@��s���t��S(���N(���Rv���(���R���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt ���user_test}��s����(���R���R���R���t ���working_sett���key( ���t ���local_onlyt���skipt���include_editablest���editables_onlyt ���user_onlyR���R���R���R���R���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���get_installed_distributionsP��s$����           c���������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(���s�� 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. s ���.egg-linkN( ���R ���R���t���appendR���R���R3���R8���Rp���R���Ru���(���R���t���sitest���sitet���egglink(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt ���egg_link_path��s����     c���������C@��s���t��|���}�|�r�|�S|��j�S(���s��� 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. (���R���t���location(���R���R���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR�����s���� c����������C@��s ���t��j�d��}��t��j�|���|��S(���sB���Get the current umask which involves having to set it temporarily.i����(���R3���t���umask(���t���mask(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt ���current_umask��s���� c��� ������C@��s~��t��|��t�|��d��}�zSt�j�|�d�t�}�t�|�j����oF�|�}�x|�j���D]}�|�j�}�|�j �|��}�|�} �|�r�t �|��d�} �n��t �j �j �|�| ��} �t �j �j�| ��} �| �j�d��s�| �j�d��r�t��| ��qV�t��| ��t�| �d��} �z�| �j�|��Wd�| �j���|�j�d�?} �| �rft�j�| ��rf| �d �@rft �j�| �d �t���d �B�n��XqV�WWd�|�j���Xd�S( ���s�� 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. R|���t ���allowZip64i���R���s���\t���wbNi���iI���i��(���R'���R}���t���zipfilet���ZipFileRv���R���t���namelistt���infolistR���R~���R���R3���R8���Rp���t���dirnameR���t���writet���closet ���external_attrRJ���t���S_ISREGRM���R���( ���R���R���t���flattent���zipfpt���zipt���leadingt���infot���namet���datat���fnRI���R���t���mode(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR"�����s0����      'c��� ������C@��s��t��|��|��j���j�d��s4�|��j���j�d��r=�d�}�np�|��j���j�t��r[�d�}�nR�|��j���j�t��ry�d�}�n4�|��j���j�d��r�d�}�n�t�j�d�|���d �}�t�j�|��|��}�zt �g��|�j ���D]�}�|�j �d �k�r�|�j �^�q��}�x|�j ���D]}�|�j �}�|�d �k�r'qn��|�r@t �|��d �}�n��t �j�j�|�|��}�|�j���rnt��|��q|�j���ry�|�j�|�|��Wqt�k �r}�t�j�d �|��|�j �|��qqXqy�|�j�|��} �Wn5�t�t�f�k �r }�t�j�d �|��|�j �|��qn�Xt��t �j�j�|���t�|�d ���} �t�j�| �| ��Wd�QX| �j���|�j�|�|��|�j�d�@rt �j�|�d�t���d�B�qqWWd�|�j���Xd�S(���s�� 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. s���.gzs���.tgzs���r:gzs���r:bz2s���r:xzs���.tart���rs-���Cannot determine compression type for file %ss���r:*t���pax_global_headeri���s/���In the tar file %s the member %s is invalid: %sR���NiI���i��(���R'���Ro���R���t���BZ2_EXTENSIONSt ���XZ_EXTENSIONSt���loggert���warningt���tarfileR}���R���t ���getmembersR���R���R3���R8���Rp���Rs���t���issymt���_extract_memberRm���t ���extractfilet���KeyErrorR?���R���RG���t ���copyfileobjR���t���utimeR���RM���R���( ���R���R���R���t���tart���memberR���R���R8���t���excR���t���destfp(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR#�����sb���� *     !        &c���������C@��s(��t��j�j�|���}��|�d�k�sB�|��j���j�t��sB�t�j�|���rb�t�|��|�d�|��j�d�� n�|�d�k�s�t �j �|���s�|��j���j�t �t �t ��r�t�|��|��nz�|�r�|�j�d��r�t�t�|����r�d�d�l�m�}�|�d�|�j��j�|��n&�t�j�d �|��|�|��t�d �|���d��S( ���Ns���application/zipR���s���.whls���application/x-gzips ���text/htmli����(���t ���Subversions���svn+sZ���Cannot unpack file %s (downloaded from %s, content-type: %s); cannot detect archive formats%���Cannot determine archive format of %s(���R3���R8���R���Ro���R���t���ZIP_EXTENSIONSR���t ���is_zipfileR"���R���t ���is_tarfilet���TAR_EXTENSIONSR���R���R#���RZ���R���R���t���pip._internal.vcs.subversionR���t���urlt���unpackR���t���criticalR ���(���R���R���t ���content_typet���linkR���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR$���:��s,����    t���raisec������ ���C@��s^��|�d�k�r�g��}�n��|�r$�d�}�n �t�j�}�|�d�k�r�g��} �xd�|��D]\�} �d�| �k�s|�d�| �k�s|�d�| �k�s|�d�| �k�r�d�| �j�d�d��} �n��| �j�| ��qF�Wd�j�| ��}�n��t�j�d�|��t�j �j ���} �|�r�| �j �|��n��x�|�D]�} �| �j �| �d��q�WyD�t�j �|��d�t�j�d �t�j�d �|�d �|�d �| �} �| �j�j���Wn)�t�k �r}}�t�j�d �|�|����n�Xg��}�|�d�k �rx�t�rt�| �j�j����}�|�sPn��|�j���}�|�j�|�d��t�j���t�j�k�rt�j�|��q|�d�k �r|�j���qqWn��z�| �j���Wd�| �j�rD| �j�j���n��X|�d�k �rz| �j�rj|�j�d��qz|�j�d��n��| �j�rG|�d�k�rt�j���t�j�k�r|� rt�j�d�|��t�j�d�j�|��d��n��t �d�|�| �j�|�f���qG|�d�k�rt�j!�d�|�| �j�|��qG|�d�k�r.qGt"�d�t#�|����n��|�sZd�j�|��Sd�S(���s��� Args: unset_environ: an iterable of environment variable names to unset prior to calling subprocess.Popen(). t��� s��� t���"t���'s���"%s"s���\"s���Running command %st���stderrt���stdint���stdoutt���cwdt���envs#���Error %s while executing command %sNt���errort���doneR���s ���Complete output from command %s:Rd���s)��� ----------------------------------------s,���Command "%s" failed with error code %s in %st���warns$���Command "%s" had error code %s in %st���ignores���Invalid value: on_returncode=%s($���R���t ���subprocesst���PIPERQ���R���Rp���R���t���debugR3���Re���t���copyt���updatet���popt���Popent���STDOUTR���R���Rm���R���Rv���R���R���t���readlinet���rstript���getEffectiveLevelt ���std_loggingt���DEBUGt���spint���waitt ���returncodet���finishR���R ���R���t ���ValueErrort���repr(���t���cmdt ���show_stdoutR���t ���on_returncodet ���command_desct ���extra_environt ���unset_environt���spinnerR���t ���cmd_partst���partR���R���t���procR���t ���all_outputt���line(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR%���[��s����      0                c���������C@��s���t��|��d���}�|�j���}�Wd�QXd�t�j�t��d�g�}�x9�|�D]1�}�y�|�j�|��}�Wn�t�k �rr�qC�n�XPqC�Wt�|��t�k�s�t ��|�S(���sR��Return the contents of *filename*. Try to decode the file contents with utf-8, the preferred system encoding (e.g., cp1252 on some Windows machines), and latin1, in that order. Decoding a byte string with latin1 will never raise an error. In the worst case, the returned string will contain some garbage characters. R|���Ns���utf-8t���latin1( ���R}���R~���t���localet���getpreferredencodingRt���RV���t���UnicodeDecodeErrort���typeRr���t���AssertionError(���R���R���R���t ���encodingst���enc(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���read_text_file��s����   c���������C@��s���t��j�|���t�|���d��S(���N(���R3���R4���R���(���t ���build_dir(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���_make_build_dir��s���� t���FakeFilec�����������B@��s)���e��Z�d��Z�d���Z�d���Z�d���Z�RS(���sQ���Wrap a list of lines in an object with readline() to make ConfigParser happy.c���������C@��s���d���|�D�|��_��d��S(���Nc���������s@��s���|��] �}�|�Vq�d��S(���N(����(���t���.0t���l(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pys ���<genexpr>��s����(���t���_gen(���t���selft���lines(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���__init__��s����c���������C@��sL���y3�y�t��|��j��SWn�t�k �r1�|��j�j����SXWn�t�k �rG�d�SXd��S(���NRd���(���t���nextR$��t ���NameErrort ���StopIteration(���R%��(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR�����s����  c���������C@��s���|��j��S(���N(���R$��(���R%��(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���__iter__��s����(���t���__name__t ���__module__t���__doc__R'��R���R+��(����(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR!����s���  t ���StreamWrapperc�����������B@��s&���e��Z�e�d�����Z�e�d����Z�RS(���c���������C@��s���|�|��_��|����S(���N(���t ���orig_stream(���t���clsR0��(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt ���from_stream��s���� c���������C@��s ���|��j��j�S(���N(���R0��t���encoding(���R%��(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR3����s����(���R,��R-��t ���classmethodR2��t���propertyR3��(����(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR/����s���c���������c@��sR���t��t�|���}�t�t�|��t�j�|���z�t��t�|���VWd�t�t�|��|��Xd�S(���s���Return 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(���t���getattrR<���t���setattrR/��R2��(���t ���stream_namet ���orig_stdout(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���captured_output ��s ����c�����������C@��s ���t��d��S(���s���Capture 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. R���(���R:��(����(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR&�����s���� t���cached_propertyc�����������B@��s ���e��Z�d��Z�d���Z�d���Z�RS(���s���A property that is only computed once per instance and then replaces itself with an ordinary attribute. Deleting the attribute resets the property. Source: https://github.com/bottlepy/bottle/blob/0.11.5/bottle.py#L175 c���������C@��s���t��|�d��|��_�|�|��_�d��S(���NR.��(���R6��R.��RO���(���R%��RO���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR'��,��s����c���������C@��s4���|�d��k�r�|��S|��j�|��}�|�j�|��j�j�<|�S(���N(���R���RO���t���__dict__R,��(���R%��t���objR1��t���value(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���__get__0��s����  (���R,��R-��R.��R'��R?��(����(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR;��$��s��� c���������C@��sM���t��j�j�|���}�|�d�k�r-�t��j���}�n��|�j�|��}�|�rI�|�j�Sd�S(���sC���Get the installed version of dist_name avoiding pkg_resources cacheN(���R���t ���RequirementR���R���t ���WorkingSetR���t���version(���t ���dist_nameR���t���reqR���(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR*���8��s ���� c���������C@��s���t��|��d�d�d�S(���s���Consume an iterable at C speed.t���maxleni����N(���R���(���t���iterator(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���consumeJ��s����c����������O@��sT���t��t�|��t�t�|�����|��}�d���|�j���D�}�|�|�d�<t�d�d�|��S(���Nc���������S@��s���i��|��]�\�}�}�|�|��q�S(����(����(���R"��R���R>��(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pys ���<dictcomp>R��s��� �t���reverse_mappingt���Enum(����(���t���dictR���t���rangeR]���t���itemsR��(���t ���sequentialt���namedt���enumst���reverse(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���enumP��s����$ c���������C@��sY���t��j�|���}�|�j�j�d��d�}�|�j�|�|�j�|�j�|�j�f�}�t��j�|��}�|�S(���Nt���@i( ���t ���urllib_parset���urlsplitt���netlocRg���t���schemeR8���t���queryt���fragmentt ���urlunsplit(���R���t���purlt���stripped_netloct ���url_piecest���surl(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyR+���W��s ����!c���������C@��s���d�d�j��t�j�d��d�j��t�j�d� ��g�}�|��oW�t�oW�t�j�j�t�j�d��|�k�}�|�r�t�j�d�d�g�t�j�d�}�t �d �j��d �j �|�����n��d �S( ���s���Protection of pip.exe from modification on Windows On Windows, any operation modifying pip should be run as: python -m pip ... s���pip.exes ���pip{}.exei����s ���pip{}.{}.exei���s���-mR:���i���s3���To modify pip, please run the following command: {}R���N( ���t���formatR<���RU���R���R3���R8���R;���R=���R>���R ���Rp���(���t ���modifying_pipt ���pip_namest���should_show_use_python_msgt ���new_command(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt(���protect_pip_from_modification_on_windowsi��s����(���s���.tar.bz2s���.tbz(���s���.tar.xzs���.txzs���.tlzs���.tar.lzs ���.tar.lzma(���s���.zips���.whl(���s���.tar.gzs���.tgzs���.tar(n���t ���__future__R����t ���contextlibR6���t���ioR��t���loggingR��R3���R���Rx���RG���RJ���R���R<���R���R���t ���collectionsR���t ���pip._vendorR���t���pip._vendor.retryingR���t���pip._vendor.sixR���t���pip._vendor.six.movesR���t���pip._vendor.six.moves.urllibR���RS��t���pip._internal.compatR���R���R ���R ���t���pip._internal.exceptionsR ���R ���t���pip._internal.locationsR ���R���R���R���R���R���R���t���__all__t ���getLoggerR,��R���R���R���R���R���R(���R)���t���bz2R-���R���t���lzmaR2���R'���R!���Rt���R���RH���R���R���Rk���R���R���R���R���R���t���DEFAULT_BUFFER_SIZER���R���R���Rv���R���R���R ���R���R���R���R���R���R���R���R���R���R"���R#���R$���R���R%���R��R ��t���objectR!��R/��t���contextmanagerR:��R&���R;��R*���RG��RQ��R+���Rc��(����(����(����s7���/tmp/pip-install-0xiv62/pip/pip/_internal/utils/misc.pyt���<module>���s���              "(                    5 %   + L !n