PK APOCALYPSE V1

APOCALYPSE V1

Current Path : /opt/alt/python39/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/misc.cpython-39.pyc

a

��Re*Q�@sddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZmZmZddlmZddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!ddl"m#Z#ddl$m%Z%m&Z&m'Z'ddl(m)Z)dd	l*m+Z+dd
l,m-Z-m.Z.m/Z/ddl,m0Z0ddl1m2Z2dd
l3m4Z4ddl5m6Z6gd�Z7e�8e9�Z:e d�Z;eee<e<efZ=ee>e>e>fZ?ee@eee@ee@ffZAe@d�dd�ZBee>dfee>e>e>fd�dd�ZCe@dd�dd�ZDe@d�dd�ZEe%de&d�e'd�d �d�e@eFdd"�d#d$��ZGedefe@e=dd%�d&d'�ZHe@e@d�d(d)�ZId�e@e@e@d+�d,d-�ZJe@ee@e@d.�d/d0�ZKe@dd1�d2d3�ZLe@ee@e@d.�d4d5�ZMe@e@d1�d6d7�ZNe@e@d1�d8d9�ZOe@e>d:�d;d<�ZPeQe@d=�d>d?�ZReeeeee@ee>fd@�dAdB�ZSe@eFd�dCdD�ZTejUfee>eeVdE�dFdG�ZWd�e@eFe@dH�dIdJ�ZXe@ee@e@fd�dKdL�ZYe@e@ddM�dNdO�ZZe@eFd�dPdQ�Z[e#eFdR�dSdT�Z\e#eFdR�dUdV�Z]e#eFdR�dWdX�Z^dYdZ�Z_e@ee#d[�d\d]�Z`e#e@dR�d^d_�Zaeedd`�dadb�ZbGdcdd�dde
�Zcejde@eecde�dfdg��Zeeecd�dhdi�Zfeecd�djdk�Zgeeeedl�dmdn�Zhe@ee>e@do�dpdq�Zid�e@e@e@ds�dtdu�Zje@ee@ee>fdv�dwdx�Zke@eAdv�dydz�Zle@e@dv�d{d|�Zme@ee@geedffee@eAfd}�d~d�Zne@eAdv�d�d��Zoe@ee@dv�d�d��Zpe@ee@e@ee@e@ffd��d�d��Zqe@e@d��d�d��Zre@e@d��d�d��ZsGd�d��d��Zte@etd��d�d��Zue@etd��d�d��ZveFdd��d�d��ZweFd�d�d��Zxd�e@e>eee>fd��d�d��ZyeFd�d�d��Zzeeeeeefd��d�d��Z{ee;geFfee;eee;ee;fd��d�d��Z|dS)��N)�StringIO)�filterfalse�tee�zip_longest)�
TracebackType)
�Any�BinaryIO�Callable�ContextManager�Iterable�Iterator�List�Optional�TextIO�Tuple�Type�TypeVar�cast��Distribution)�retry�stop_after_delay�
wait_fixed)�__version__)�CommandError)�get_major_minor_version�
site_packages�	user_site)�
get_scheme)�WINDOWS)�egg_link_path_from_location)�running_under_virtualenv)
�rmtree�display_path�
backup_dir�ask�splitext�format_size�is_installable_dir�normalize_path�renames�get_prog�captured_stdout�
ensure_dir�remove_auth_from_url�T��returncCs4tj�tj�t�dd�}tj�|�}d�t|t��S)Nz..zpip {} from {} (python {}))	�os�path�join�dirname�__file__�abspath�formatrr)�pip_pkg_dir�r:��/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_internal/utils/misc.py�get_pip_versionGs�r<.)�py_version_infor1cCsDt|�dkr"|dt|�d7}nt|�dkr:|dd�}td|�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).
    �)rN�VersionInfo)�lenr)r=r:r:r;�normalize_version_infoRs
rA)r3r1c
CsRzt�|�Wn>tyL}z&|jtjkr8|jtjkr8�WYd}~n
d}~00dS)z os.path.makedirs without EEXIST.N)r2�makedirs�OSError�errno�EEXIST�	ENOTEMPTY)r3�er:r:r;r-es
r-c
CsPz2tj�tjd�}|dvr*tj�d�WS|WSWntttfyJYn0dS)Nr)z__main__.pyz-cz -m pip�pip)	r2r3�basename�sys�argv�
executable�AttributeError�	TypeError�
IndexError)�progr:r:r;r+os
r+Tr>g�?)�reraise�stop�waitF)�dir�
ignore_errorsr1cCstj||td�dS)N)rU�onerror)�shutilr"�rmtree_errorhandler)rTrUr:r:r;r"}sr")�funcr3�exc_infor1cCsRzt�|�jtj@}Wnty,YdS0|rLt�|tj�||�dS�dS)z�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.N)r2�stat�st_mode�S_IWRITErC�chmod)rYr3rZ�has_attr_readonlyr:r:r;rX�srXcCsFtj�tj�|��}|�t��tjj�rBd|tt���d�}|S)zTGives the display value for a given path, making it relative to cwd
    if possible.�.N)r2r3�normcaser7�
startswith�getcwd�sepr@�r3r:r:r;r#�sr#�.bak)rT�extr1cCs6d}|}tj�||�r.|d7}|t|�}q||S)z\Figure out the name of a directory to back up the given dir to
    (adding .bak, .bak2, etc)�)r2r3�exists�str)rTrg�n�	extensionr:r:r;r$�sr$)�message�optionsr1cCs2tj�dd���D]}||vr|Sqt||�S)N�PIP_EXISTS_ACTION�)r2�environ�get�splitr%)rmrn�actionr:r:r;�ask_path_exists�s
ru)rmr1cCstj�d�rtd|����dS)z&Raise an error if no input is allowed.�PIP_NO_INPUTz5No input was expected ($PIP_NO_INPUT set); question: N)r2rqrr�	Exception�rmr:r:r;�_check_no_input�s�rycCsFt|�t|�}|����}||vr<td�|d�|���q|SqdS)z@Ask the message interactively, with the given possible responsesz>Your response ({!r}) was not one of the expected responses: {}z, N)ry�input�strip�lower�printr8r4)rmrn�responser:r:r;r%�s
��r%cCst|�t|�S)zAsk for input interactively.)ryrzrxr:r:r;�	ask_input�srcCst|�t�|�S)z!Ask for a password interactively.)ry�getpassrxr:r:r;�ask_password�sr�)�valr1cCs2|��}|dvrdS|dvr dStd|����dS)z�Convert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )�y�yes�t�true�on�1rh)rk�no�f�false�off�0rzinvalid truth value N)r|�
ValueError)r�r:r:r;�	strtobool�sr�)�bytesr1cCs\|dkrd�|dd�S|dkr4d�t|d��S|dkrJd�|d�Sd�t|��SdS)	Ni@Bz	{:.1f} MBg@�@i�i'z{} kBz	{:.1f} kBz{} bytes)r8�int)r�r:r:r;r'�sr')�rowsr1cs@dd�|D�}dd�t|ddi�D���fdd�|D�}|�fS)z�Return a list of formatted rows and a list of column sizes.

    For example::

    >>> tabulate([['foobar', 2000], [0xdeadbeef]])
    (['foobar     2000', '3735928559'], [10, 4])
    cSsg|]}ttt|���qSr:)�tuple�maprj��.0�rowr:r:r;�
<listcomp>��ztabulate.<locals>.<listcomp>cSsg|]}ttt|���qSr:)�maxr�r@)r��colr:r:r;r��r��	fillvaluerpcs$g|]}d�ttj|������qS)� )r4r�rj�ljust�rstripr���sizesr:r;r��r�)r)r��tabler:r�r;�tabulate�sr�cCsHtj�|�sdStj�tj�|d��r*dStj�tj�|d��rDdSdS)atIs path is a directory containing pyproject.toml or setup.py?

    If pyproject.toml exists, this is a PEP 517 project. Otherwise we look for
    a legacy setuptools layout by identifying setup.py. We don't check for the
    setup.cfg because using it without setup.py is only available for PEP 517
    projects, which are already covered by the pyproject.toml check.
    Fzpyproject.tomlTzsetup.py)r2r3�isdir�isfiler4rer:r:r;r(�sr()�file�sizer1ccs|�|�}|sq|VqdS)z7Yield pieces of data from a file-like object until EOF.N)�read)r�r��chunkr:r:r;�read_chunkss
r�)r3�resolve_symlinksr1cCs6tj�|�}|rtj�|�}ntj�|�}tj�|�S)zN
    Convert a path to its canonical, case-normalized, absolute version.

    )r2r3�
expanduser�realpathr7ra)r3r�r:r:r;r)s
r)cCs@t�|�\}}|���d�r8|dd�|}|dd�}||fS)z,Like os.path.splitext, but take off .tar tooz.tar���N)�	posixpathr&r|�endswith)r3�basergr:r:r;r&$s
r&)�old�newr1cCsxtj�|�\}}|r.|r.tj�|�s.t�|�t�||�tj�|�\}}|rt|rtzt�|�WntyrYn0dS)z7Like os.renames(), but handles renaming across devices.N)	r2r3rsrirBrW�move�
removedirsrC)r�r��head�tailr:r:r;r*-s
r*cCst�s
dS|�ttj��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!rbr)rJ�prefixrer:r:r;�is_local>s	r�)�distr1cCstt|��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�r�r:r:r;�
dist_is_localLsr�cCst|��tt��S)zF
    Return True if given Distribution is installed in user site.
    )r�rbr)rr�r:r:r;�dist_in_usersiteWsr�cCst|��tt��S)z[
    Return True if given Distribution is installed in
    sysconfig.get_python_lib().
    )r�rbr)rr�r:r:r;�dist_in_site_packages^sr�cCs*tt|��}|�ttd�j�d�d��S)zf
    Return True if given Distribution is installed in
    path matching distutils_scheme layout.
    rp�pythonr)r)r�rbr�purelibrs)r��	norm_pathr:r:r;�dist_in_install_pathfs�r�)�req_namer1cCs<ddlm}ddlm}|��|�}|dur0dSt||�jS)a%Given 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()``.

    Left for compatibility until direct pkg_resources uses are refactored out.
    r)�get_default_environmentrN)�pip._internal.metadatar��$pip._internal.metadata.pkg_resourcesr�get_distributionr�_dist)r�r��_Distr�r:r:r;r�psr�cCs t|j�}|rt|�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 �project_namer)�location)r��egg_linkr:r:r;r��s	
r�)�msg�argsr1cGstj|g|�R�dS�N)�logger�info)r�r�r:r:r;�write_output�sr�c@s:eZdZUdZeed<eedd�dd��Zedd��Z	dS)�
StreamWrapperN�orig_stream)r�r1cCs||_|�Sr�)r�)�clsr�r:r:r;�from_stream�szStreamWrapper.from_streamcCs|jjSr�)r��encoding��selfr:r:r;r��szStreamWrapper.encoding)
�__name__�
__module__�__qualname__r�r�__annotations__�classmethodr��propertyr�r:r:r:r;r��s

r�)�stream_namer1c
csLtt|�}tt|t�|��ztt|�VWtt||�ntt||�0dS)z�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)�getattrrJ�setattrr�r�)r��orig_stdoutr:r:r;�captured_output�s

r�cCstd�S)z�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.
    �stdout�r�r:r:r:r;r,�s	r,cCstd�S)z 
    See captured_stdout().
    �stderrr�r:r:r:r;�captured_stderr�sr�)�
sequential�namedr1cOsDtt|tt|���fi|��}dd�|��D�}||d<tdd|�S)NcSsi|]\}}||�qSr:r:)r��key�valuer:r:r;�
<dictcomp>�r�zenum.<locals>.<dictcomp>�reverse_mapping�Enumr:)�dict�zip�ranger@�items�type)r�r��enums�reverser:r:r;�enum�sr�)�host�portr1cCs.|dur|Sd|vr d|�d�}|�d|��S)z.
    Build a netloc from a host-port pair
    N�:�[�]r:)r�r�r:r:r;�build_netloc�s
r��https)�netloc�schemer1cCs8|�d�dkr*d|vr*d|vr*d|�d�}|�d|��S)z)
    Build a full URL from a netloc.
    r���@r�r�z://)�count)rrr:r:r;�build_url_from_netloc�sr)rr1cCs t|�}tj�|�}|j|jfS)z2
    Return the host-port pair from a netloc.
    )r�urllib�parse�urlparse�hostnamer�)r�url�parsedr:r:r;�parse_netloc�srcCstd|vr|dfS|�dd�\}}d}d|vr>|�dd�\}}n
|d}}tj�|�}|durhtj�|�}|||ffS)zp
    Parse out and remove the auth information from a netloc.

    Returns: (netloc, (username, password)).
    r)NNrhNr�)�rsplitrsrr�unquote)r�auth�pw�userr:r:r;�split_auth_from_netloc�s
rcCsNt|�\}\}}|dur|S|dur.d}d}ntj�|�}d}dj|||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"
    N�****rpz:****z{user}{password}@{netloc})r�passwordr)rrr�quoter8)rrrr:r:r;�
redact_netloc	s�r)r
�transform_netlocr1cCsJtj�|�}||j�}|j|d|j|j|jf}tj�|�}|t	d|�fS)aRTransform 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�NetlocTuple)
rr�urlsplitrrr3�query�fragment�
urlunsplitr)r
r�purl�netloc_tuple�
url_pieces�surlr:r:r;�_transform_urls

r!cCst|�Sr�)r�rr:r:r;�_get_netloc3sr#cCs
t|�fSr�)rr"r:r:r;�_redact_netloc7sr$)r
r1cCst|t�\}\}}|||fS)z�
    Parse a url into separate netloc, auth, and url with no auth.

    Returns: (url_without_auth, netloc, (username, password))
    �r!r#)r
�url_without_authrrr:r:r;�split_auth_netloc_from_url;sr'cCst|t�dS)z7Return a copy of url with 'username:password@' removed.rr%�r
r:r:r;r.Esr.cCst|t�dS)z.Replace the password in a given url with ****.r)r!r$r(r:r:r;�redact_auth_from_urlLsr)c@sJeZdZeedd�dd�Zed�dd�Zed�dd	�Zeed
�dd�Z	dS)
�
HiddenTextN)�secret�redactedr1cCs||_||_dSr�)r+r,)r�r+r,r:r:r;�__init__RszHiddenText.__init__r0cCsd�t|��S)Nz<HiddenText {!r}>)r8rjr�r:r:r;�__repr__VszHiddenText.__repr__cCs|jSr��r,r�r:r:r;�__str__YszHiddenText.__str__)�otherr1cCs t|�t|�krdS|j|jkS)NF)r�r+)r�r1r:r:r;�__eq__]szHiddenText.__eq__)
r�r�r�rjr-r.r0r�boolr2r:r:r:r;r*Qsr*)r�r1cCst|dd�S)Nrr/)r*)r�r:r:r;�
hide_valuefsr4cCst|�}t||d�S)Nr/)r)r*)r
r,r:r:r;�hide_urljsr5)�
modifying_pipr1cCszdd�tjd�djtjdd��g}|oBtoBtj�tjd�|v}|rvtjddgtjd	d�}t	d
�d�
|����dS)z�Protection of pip.exe from modification on Windows

    On Windows, any operation modifying pip should be run as:
        python -m pip ...
    zpip.exez	pip{}.exerzpip{}.{}.exeNrz-mrHrhz3To modify pip, please run the following command:
{}r�)r8rJ�version_inforr2r3rIrKrLrr4)r6�	pip_names�should_show_use_python_msg�new_commandr:r:r;�(protect_pip_from_modification_on_windowsos����r;cCstjduotj��S)zIs this console interactive?N)rJ�stdin�isattyr:r:r:r;�is_console_interactive�sr>�)r3�	blocksizer1cCsft��}d}t|d��8}t||d�D]}|t|�7}|�|�q$Wd�n1sT0Y||fS)z5Return (hash, length) for path using hashlib.sha256()r�rb)r�N)�hashlib�sha256�openr�r@�update)r3r@�h�lengthr��blockr:r:r;�	hash_file�s*rIcCs&zddl}Wnty YdS0dS)z8
    Return whether the wheel package is installed.
    rNFT)�wheel�ImportError)rJr:r:r;�is_wheel_installed�s
rL)�iterabler1cCst|�}t||�S)zb
    Return paired elements.

    For example:
        s -> (s0, s1), (s2, s3), (s4, s5), ...
    )�iterr)rMr:r:r;�pairwise�srO)�predrMr1cCs t|�\}}t||�t||�fS)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
    )rr�filter)rPrM�t1�t2r:r:r;�	partition�s
rT)F)rf)T)r�)r?)}�
contextlibrDr�rB�io�loggingr2r�rWr[rJ�urllib.parserr�	itertoolsrrr�typesr�typingrrr	r
rrr
rrrrrr�pip._vendor.pkg_resourcesr�pip._vendor.tenacityrrrrHr�pip._internal.exceptionsr�pip._internal.locationsrrrr�pip._internal.utils.compatr�pip._internal.utils.egg_linkr �pip._internal.utils.virtualenvr!�__all__�	getLoggerr�r�r/�
BaseException�ExcInfor�r?rjrr<rAr-r+r3r"rXr#r$ruryr%rr�r��floatr'r�r(�DEFAULT_BUFFER_SIZEr�r�r)r&r*r�r�r�r�r�r�r�r�r��contextmanagerr�r,r�r�r�rrrrr!r#r$r'r.r)r*r4r5r;r>rIrLrOrTr:r:r:r;�<module>s�<
"
	(	
	

	
�"
 �

if you don't want to be vaporized in a nuclear explosion, i simply have to become nuclear myself… i am atomic