403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.6/site-packages/pip/_vendor/resolvelib/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.6/site-packages/pip/_vendor/resolvelib/__pycache__/resolvers.cpython-36.pyc
3

�N�a�D�@s�ddlZddlZddlmZddlmZmZmZejdddg�Z	Gdd	�d	e
�ZGd
d�de�ZGdd
�d
e�Z
Gdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Zejdd�ZGdd�de�Zdd�Zejdd�Zdd�ZGd d!�d!e�ZdS)"�N�)�AbstractResolver)�
DirectedGraph�IteratorMapping�build_iter_view�RequirementInformation�requirement�parentc@seZdZdZdS)�ResolverExceptionz�A base class for all exceptions raised by this module.

    Exceptions derived by this class should all be handled in this module. Any
    bubbling pass the resolver should be treated as a bug.
    N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib/python3.6/resolvers.pyr

sr
cs$eZdZ�fdd�Zdd�Z�ZS)�RequirementsConflictedcstt|�j|�||_dS)N)�superr�__init__�	criterion)�selfr)�	__class__rrrszRequirementsConflicted.__init__cCs djdjdd�|jj�D���S)NzRequirements conflict: {}z, css|]}t|�VqdS)N)�repr)�.0�rrrr�	<genexpr>sz1RequirementsConflicted.__str__.<locals>.<genexpr>)�format�joinr�iter_requirement)rrrr�__str__szRequirementsConflicted.__str__)rrr
rr�
__classcell__rr)rrrsrcs$eZdZ�fdd�Zdd�Z�ZS)�InconsistentCandidatecs"tt|�j||�||_||_dS)N)rr r�	candidater)rr!r)rrrr!szInconsistentCandidate.__init__cCs$dj|jdjdd�|jj�D���S)Nz+Provided candidate {!r} does not satisfy {}z, css|]}t|�VqdS)N)r)rrrrrr)sz0InconsistentCandidate.__str__.<locals>.<genexpr>)rr!rrr)rrrrr&szInconsistentCandidate.__str__)rrr
rrrrr)rrr  sr c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�	CriterionaQRepresentation of possible resolution results of a package.

    This holds three attributes:

    * `information` is a collection of `RequirementInformation` pairs.
      Each pair is a requirement contributing to this criterion, and the
      candidate that provides the requirement.
    * `incompatibilities` is a collection of all known not-to-work candidates
      to exclude from consideration.
    * `candidates` is a collection containing all possible candidates deducted
      from the union of contributing requirements and known incompatibilities.
      It should never be empty, except when the criterion is an attribute of a
      raised `RequirementsConflicted` (in which case it is always empty).

    .. note::
        This class is intended to be externally immutable. **Do not** mutate
        any of its attribute containers.
    cCs||_||_||_dS)N)�
candidates�information�incompatibilities)rr#r$r%rrrrAszCriterion.__init__cCs djdd�|jD��}dj|�S)Nz, css|]\}}dj||�VqdS)z({!r}, via={!r})N)r)rZreqr	rrrrHsz%Criterion.__repr__.<locals>.<genexpr>z
Criterion({}))rr$r)r�requirementsrrr�__repr__FszCriterion.__repr__cCsdd�|jD�S)Ncss|]}|jVqdS)N)r)r�irrrrNsz-Criterion.iter_requirement.<locals>.<genexpr>)r$)rrrrrMszCriterion.iter_requirementcCsdd�|jD�S)Ncss|]}|jVqdS)N)r	)rr(rrrrQsz(Criterion.iter_parent.<locals>.<genexpr>)r$)rrrr�iter_parentPszCriterion.iter_parentN)rrr
rrr'rr)rrrrr"-s
r"c@seZdZdS)�ResolutionErrorN)rrr
rrrrr*Tsr*cseZdZ�fdd�Z�ZS)�ResolutionImpossiblecstt|�j|�||_dS)N)rr+r�causes)rr,)rrrrYszResolutionImpossible.__init__)rrr
rrrr)rrr+Xsr+cseZdZ�fdd�Z�ZS)�ResolutionTooDeepcstt|�j|�||_dS)N)rr-r�round_count)rr.)rrrr`szResolutionTooDeep.__init__)rrr
rrrr)rrr-_sr-�Statez!mapping criteria backtrack_causesc@sdeZdZdZdd�Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
Resolutionz�Stateful resolution object.

    This is designed as a one-off object that holds information to kick start
    the resolution process, and holds the results afterwards.
    cCs||_||_g|_dS)N)�_p�_r�_states)r�provider�reporterrrrrpszResolution.__init__cCs,y
|jdStk
r&td��YnXdS)Nr�state���)r3�
IndexError�AttributeError)rrrrr6us
zResolution.statecCs>|jd}t|jj�|jj�|jdd�d�}|jj|�dS)z�Push a new state into history.

        This new state will be used to hold resolution results of the next
        coming round.
        rN)�mapping�criteria�backtrack_causesr7)r3r/r:�copyr;r<�append)r�baser6rrr�_push_new_state|s
zResolution._push_new_statec	Cs�|jj||d�|jj|d�}|j|�}|r8t|j�}ng}|jj|t|t	j
d�||gi�t|t	jd�||i�d�}|r�t|j�}|j
t||��nt||�g}tt|�||d�}|js�t|��|||<dS)N)rr	)Zrequirement_or_candidaterr%)�
identifierr&r%)r#r$r%)r2Zadding_requirementr1Zidentify�get�listr%�find_matchesr�operator�methodcaller�
attrgetterr$r>rr"rr#r)	rr;rr	rArr%�matchesr$rrr�_add_to_criteria�s6


zResolution._add_to_criteriacCs>|jj||jjt|jjtjd��t|jjtjd��|jjd�S)Nr#r$)rAZresolutionsr#r$r<)	r1Zget_preferencer6r:rr;rErGr<)r�namerrr�_get_preference�s

zResolution._get_preferencecsBy�jj|�Wntk
r$dSXt��fdd�|j�D��S)NFc3s|]}�jj|�d�VqdS))rr!N)r1�is_satisfied_by)rr)�current_pinrrrr�sz8Resolution._is_current_pin_satisfying.<locals>.<genexpr>)r6r:�KeyError�allr)rrJrr)rMrr�_is_current_pin_satisfying�sz%Resolution._is_current_pin_satisfyingcCs8|jjj�}x&|jj|d�D]}|j|||d�qW|S)N)r!)r	)r6r;r=r1Zget_dependenciesrI)rr!r;rrrr�_get_updated_criteria�sz Resolution._get_updated_criteriacs��jj|}g}x�|jD]��y�j��}Wn0tk
rZ}z|j|j�wWYdd}~XnXt��fdd�|j�D��}|s�t	�|���j
j�d��jjj|��jj
j|d���jj
|<gSW|S)Nc3s|]}�jj|�d�VqdS))rr!N)r1rL)rr)r!rrrr�sz7Resolution._attempt_to_pin_criterion.<locals>.<genexpr>)r!)r6r;r#rQrr>rrOrr r2Zpinning�updater:�pop)rrJrr,r;�eZ	satisfiedr)r!rr�_attempt_to_pin_criterion�s&
z$Resolution._attempt_to_pin_criterioncs�x�t�j�dkr��jd
=�jj�}|jj�\}}dd�|jj�D���j||gf��jj	|d���fdd�}�j
�|�}|rdSqWd	S)a�Perform backtracking.

        When we enter here, the stack is like this::

            [ state Z ]
            [ state Y ]
            [ state X ]
            .... earlier states are irrelevant.

        1. No pins worked for Z, so it does not have a pin.
        2. We want to reset state Y to unpinned, and pin another candidate.
        3. State X holds what state Y was before the pin, but does not
           have the incompatibility information gathered in state Y.

        Each iteration of the loop will:

        1.  Discard Z.
        2.  Discard Y but remember its incompatibility information gathered
            previously, and the failure we're dealing with right now.
        3.  Push a new state Y' based on X, and apply the incompatibility
            information from Y to Y'.
        4a. If this causes Y' to conflict, we need to backtrack again. Make Y'
            the new Z and go back to step 2.
        4b. If the incompatibilities apply cleanly, end backtracking.
        �rcSsg|]\}}|t|j�f�qSr)rCr%)r�k�vrrr�
<listcomp>sz)Resolution._backtrack.<locals>.<listcomp>)r!cs�x��D]�\}}|sqy�jj|}Wntk
r:wYnX�jj|t�jjtjd��t�jjtjd�||i�d�}t	|�}|s�dS|j
|j�t|t
|j�|d��jj|<qWdS)Nrr%)rAr&r%F)r#r$r%T)r6r;rNr1rDrrErFrGr�extendr%r"rCr$)rWr%rrHr#)�incompatibilities_from_brokenrrr�_patch_criteria!s2
z.Resolution._backtrack.<locals>._patch_criteriaTFr7)�lenr3rSr:�popitemr;�itemsr>r2Zbacktrackingr@)rZbroken_staterJr!r\�successr)r[rr�
_backtrack�s
zResolution._backtrackc
sZ�jrtd���jj�ttj�igd�g�_xT|D]L}y�j�jj	|dd�Wq4t
k
r~}zt|jj
��WYdd}~Xq4Xq4W�j�x�t|�D]�}�jj|d��fdd��jj	j�D�}|s܈jj�jd��jSt|�jd�}�j|�}|�r0�j�}	d	d�|D��jjdd�<|	�s8t�jj��n�j��jj|�jd
�q�Wt|��dS)Nzalready resolved)r:r;r<)r	)�indexcs g|]\}}�j||�s|�qSr)rP)r�keyr)rrrrYjsz&Resolution.resolve.<locals>.<listcomp>)r6)rccSsg|]}|jD]}|�qqSr)r$)r�cr(rrrrY}s)rbr6)r3�RuntimeErrorr2Zstartingr/�collections�OrderedDictrIr6r;rr+rr$r@�rangeZstarting_roundr_Zending�minrKrUrar<Zending_roundr-)
rr&�
max_roundsrrTZround_indexZunsatisfied_namesrJZfailure_causesr`r)rr�resolveMs<

"

zResolution.resolveN)rrr
rr�propertyr6r@rIrKrPrQrUrarkrrrrr0is'
$Yr0cCs�||krdS||krdSxn||j�D]^}y|t|�}Wntk
rPw&YnX||krh|j|�dSt||||�r&|j|�dSq&WdS)NTF)r)�idrN�add�_has_route_to_root)r;rc�all_keys�	connected�p�pkeyrrrro�s 

ro�Resultzmapping graph criteriac
s�|j}dd�|j�D�}d|td�<t�}|jd�dh�x�|jj�D]�\}}t|j||��s`qF||krr|j|�xV|j�D]J}y|t|�}Wntk
r�w|YnX||kr�|j|�|j	||�q|WqFWt
�fdd�|j�D�||jd�S)NcSsi|]\}}|t|��qSr)rm)rrWrXrrr�
<dictcomp>�sz!_build_result.<locals>.<dictcomp>csi|]\}}|�kr||�qSrr)rrWrX)rqrrru�s)r:�graphr;)r:r_rmrrnr;ror)rNZconnectrt)r6r:rprvrcrrrrsr)rqr�
_build_result�s.


rwc@seZdZdZeZddd�ZdS)�Resolverz3The thing that performs the actual resolution work.�dcCs$t|j|j�}|j||d�}t|�S)aTake a collection of constraints, spit out the resolution result.

        The return value is a representation to the final resolution result. It
        is a tuple subclass with three public members:

        * `mapping`: A dict of resolved candidates. Each key is an identifier
            of a requirement (as returned by the provider's `identify` method),
            and the value is the resolved candidate.
        * `graph`: A `DirectedGraph` instance representing the dependency tree.
            The vertices are keys of `mapping`, and each edge represents *why*
            a particular package is included. A special vertex `None` is
            included to represent parents of user-supplied requirements.
        * `criteria`: A dict of "criteria" that hold detailed information on
            how edges in the graph are derived. Each key is an identifier of a
            requirement, and the value is a `Criterion` instance.

        The following exceptions may be raised if a resolution cannot be found:

        * `ResolutionImpossible`: A resolution cannot be found for the given
            combination of requirements. The `causes` attribute of the
            exception is a list of (requirement, parent), giving the
            requirements that could not be satisfied.
        * `ResolutionTooDeep`: The dependency tree is too deeply nested and
            the resolver gave up. This is usually caused by a circular
            dependency, but you can try to resolve this by increasing the
            `max_rounds` argument.
        )rj)r0r4r5rkrw)rr&rjZ
resolutionr6rrrrk�szResolver.resolveN)ry)rrr
rr
Zbase_exceptionrkrrrrrx�srx)rfrEZ	providersrZstructsrrr�
namedtupler�	Exceptionr
rr �objectr"r*r+r-r/r0rortrwrxrrrr�<module>s(
'%

Youez - 2016 - github.com/yon3zu
LinuXploit