HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/lib/python3.9/site-packages/resolvelib/__pycache__/resolvers.cpython-39.pyc
a

J{�_�@�@s�ddlZddlmZddlmZmZe�dddg�ZGdd	�d	e�Z	Gd
d�de	�Z
Gdd
�d
e	�ZGdd�de�Z
Gdd�de	�ZGdd�de�ZGdd�de�Ze�dd�ZGdd�de�Zdd�Ze�dd�Zdd�ZGd d!�d!e�ZdS)"�N�)�AbstractResolver)�
DirectedGraph�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�8/usr/lib/python3.9/site-packages/resolvelib/resolvers.pyr	sr	cs$eZdZ�fdd�Zdd�Z�ZS)�RequirementsConflictedcstt|��|�||_dS�N)�superr�__init__�	criterion)�selfr��	__class__rrrszRequirementsConflicted.__init__cCs d�d�dd�|j��D���S)NzRequirements conflict: {}�, css|]}t|�VqdSr��repr��.0�rrrr�	<genexpr>�z1RequirementsConflicted.__str__.<locals>.<genexpr>)�format�joinr�iter_requirement�rrrr�__str__s�zRequirementsConflicted.__str__�r
rrrr$�
__classcell__rrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)�InconsistentCandidatecs"tt|��||�||_||_dSr)rr'r�	candidater)rr(rrrrr szInconsistentCandidate.__init__cCs$d�|jd�dd�|j��D���S)Nz+Provided candidate {!r} does not satisfy {}rcss|]}t|�VqdSrrrrrrr(rz0InconsistentCandidate.__str__.<locals>.<genexpr>)r r(r!rr"r#rrrr$%s�zInconsistentCandidate.__str__r%rrrrr'sr'c@sLeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�	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||_||_||_dSr)�
candidates�information�incompatibilities)rr*r+r,rrrr@szCriterion.__init__cCs d�dd�|jD��}d�|�S)Nrcss|]\}}d�||�VqdS)z({!r}, via={!r})N)r )rZreqrrrrrFs�z%Criterion.__repr__.<locals>.<genexpr>z
Criterion({}))r!r+r )r�requirementsrrr�__repr__Es
�zCriterion.__repr__cCs:t|�|g��}t||�g}|||gd�}|s6t|��|S)z%Build an instance from a requirement.�r,)r�find_matchesrr)�cls�providerrr�cands�infosrrrr�from_requirementLszCriterion.from_requirementcCsdd�|jD�S)Ncss|]}|jVqdSr)r�r�irrrrWrz-Criterion.iter_requirement.<locals>.<genexpr>�r+r#rrrr"VszCriterion.iter_requirementcCsdd�|jD�S)Ncss|]}|jVqdSr�rr6rrrrZrz(Criterion.iter_parent.<locals>.<genexpr>r8r#rrr�iter_parentYszCriterion.iter_parentcCsXt|j�}|�t||��t|�dd�|D���}t|�||t|j��}|sTt|��|S)z5Build a new instance from this and a new requirement.cSsg|]\}}|�qSrr)rr�_rrr�
<listcomp>`rz)Criterion.merged_with.<locals>.<listcomp>)	�listr+�appendrrr0�typer,r)rr2rrr4r3rrrr�merged_with\s
zCriterion.merged_withcCs4|j�|�}|sdS|j|}t|�|t|j�|�S)z�Build a new instance from this, but excluding specified candidates.

        Returns the new instance, or None if we still have no valid candidates.
        N)r*Z	excludingr,r?r=r+)rr*r3Z	incompatsrrr�excluded_offs

zCriterion.excluded_ofN)r
rrr
rr.�classmethodr5r"r:r@rArrrrr),s
	
r)c@seZdZdS)�ResolutionErrorN)r
rrrrrrrCrsrCcseZdZ�fdd�Z�ZS)�ResolutionImpossiblecstt|��|�||_dSr)rrDr�causes)rrErrrrwszResolutionImpossible.__init__�r
rrrr&rrrrrDvsrDcseZdZ�fdd�Z�ZS)�ResolutionTooDeepcstt|��|�||_dSr)rrGr�round_count)rrHrrrr~szResolutionTooDeep.__init__rFrrrrrG}srG�Statezmapping criteriac@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|_dSr)�_p�_r�_states)rr2�reporterrrrr�szResolution.__init__cCs,z|jdWSty&td��Yn0dS)N����state)rM�
IndexError�AttributeErrorr#rrrrP�szResolution.statecCs2|jd}t|j��|j��d�}|j�|�dS)z�Push a new state into history.

        This new state will be used to hold resolution results of the next
        coming round.
        rO��mapping�criteriaN)rMrIrT�copyrUr>)r�baserPrrr�_push_new_state�s
�zResolution._push_new_statecCsf|j�||�|j�|�}z|jj|}Wn"tyLt�|j||�}Yn0|�	|j||�}||fSr)
rLZadding_requirementrKZidentifyrPrU�KeyErrorr)r5r@)rrr�name�critrrr�_merge_into_criterion�sz Resolution._merge_into_criterioncCs*|\}}|j�|jj�|�|j��|j�Sr)rKZget_preferencerPrT�getr*Zfor_preferencer+)r�itemrZrrrr�_get_criterion_item_preference�s�z)Resolution._get_criterion_item_preferencecsBz�jj|�Wnty$YdS0t��fdd�|��D��S)NFc3s|]}�j�|��VqdSr�rKZis_satisfied_byr�Zcurrent_pinrrrr�s�z8Resolution._is_current_pin_satisfying.<locals>.<genexpr>)rPrTrY�allr")rrZrrrar�_is_current_pin_satisfying�s�z%Resolution._is_current_pin_satisfyingcCs4i}|j�|�D]}|j||d�\}}|||<q|S)Nr9)rKZget_dependenciesr\)rr(rUrrZr[rrr�_get_criteria_to_update�s

z"Resolution._get_criteria_to_updatecs�g}|jD]��z����}Wn<tyX}z$|�|j�WYd}~q
WYd}~n
d}~00t��fdd�|��D��}|s�t�|���j�	���j
j�|d���j
j|<�j
j
�|�gS|S)Nc3s|]}�j�|��VqdSrr`r�r(rrrr�s�z7Resolution._attempt_to_pin_criterion.<locals>.<genexpr>)r*rdrr>rrbr"r'rLZpinningrPrT�poprU�update)rrZrrErU�eZ	satisfiedrrer�_attempt_to_pin_criterion�s$
"�
z$Resolution._attempt_to_pin_criterioncs�t�j�dkr��jd=�j��}|j��\}}dd�|j��D����||gf��j�	|���fdd�}��
�|�}|rdSqdS)	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.
        �rOcSsg|]\}}||jf�qSrr/�r�k�vrrrr<
s�z)Resolution._backtrack.<locals>.<listcomp>c	sd�D]Z\}}|sqz�jj|}Wnty8YqYn0|�|�}|durRdS|�jj|<qdS)NFT)rPrUrYrA)rlr,r�Zincompatibilities_from_brokenrrr�_patch_criterias

z.Resolution._backtrack.<locals>._patch_criteriaTF)�lenrMrfrT�popitemrU�itemsr>rLZbacktrackingrX)rZbroken_staterZr(ro�successrrnr�
_backtrack�s
�zResolution._backtrackc
sP�jrtd���j��tt��id�g�_|D]X}z�j|dd�\}}Wn0tyz}zt	|j
j��WYd}~n
d}~00|�jj
|<q0���t|�D]�}�j�|��fdd��jj
��D�}|s�j��j��jSt|�jd�\}}	��||	�}
|
�r*���}|�s2dd�|
D�}t	|��n����j�|�j�q�t|��dS)Nzalready resolvedrSr9csg|]}�j|�s|�qSr)rc)rr^r#rrr<Ks
�z&Resolution.resolve.<locals>.<listcomp>)�keycSsg|]}|jD]}|�qqSrr8)r�cr7rrrr<dr)rM�RuntimeErrorrLZstartingrI�collections�OrderedDictr\rrDrr+rPrUrX�rangeZstarting_roundrrZending�minr_rirtZending_roundrG)
rr-�
max_roundsrrZr[rhZround_indexZunsatisfied_criterion_itemsrZfailure_causesrsrErr#r�resolve4s@
"

�
�

zResolution.resolveN)r
rrr
r�propertyrPrXr\r_rcrdrirtr}rrrrrJ�s


!HrJc	Cs�||vrdS||vrdS||��D]b}z|t|�}WntyNYq$Yn0||vrh|�|�dSt||||�r$|�|�dSq$dS)NTF)r:�idrY�add�_has_route_to_root)rUru�all_keys�	connected�p�pkeyrrrr�os 


r��Resultzmapping graph criteriac
s�|j}dd�|��D�}d|td�<t�}|�d�dh�|j��D]�\}}t|j||��s^qD||vrp|�|�|��D]J}z|t|�}Wnty�YqxYn0||vr�|�|�|�	||�qxqDt
�fdd�|��D�||jd�S)NcSsi|]\}}t|�|�qSr)rrkrrr�
<dictcomp>�rz!_build_result.<locals>.<dictcomp>csi|]\}}|�vr||�qSrrrk�r�rrr��r)rT�graphrU)rTrrrrr�rUr�r:rYZconnectr�)rPrTr�r�rurr�r�rr�r�
_build_result�s0



�r�c@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.
        )r|)rJr2rNr}r�)rr-r|Z
resolutionrPrrrr}�szResolver.resolveN)r�)r
rrr
r	Zbase_exceptionr}rrrrr��sr�)rxZ	providersrZstructsrr�
namedtupler�	Exceptionr	rr'�objectr)rCrDrGrIrJr�r�r�r�rrrr�<module>s&�
Fi