Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 18.117.101.22
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : specifiers.cpython-36.pyc
3

���eym�@s�ddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZm
Z
mZGdd�de�ZGdd	�d	e
eje��ZGd
d�de�ZGdd
�d
e�Zdd�ZGdd�de�Zejd�Zdd�Zdd�ZGdd�de�ZdS)�)�absolute_import�division�print_functionN�)�string_types�with_metaclass)�Version�
LegacyVersion�parsec@seZdZdZdS)�InvalidSpecifierzH
    An invalid specifier was found, users should refer to PEP 440.
    N)�__name__�
__module__�__qualname__�__doc__�rr� /usr/lib/python3.6/specifiers.pyrsrc@s�eZdZejdd��Zejdd��Zejdd��Zejdd��Zej	d	d
��Z
e
jdd
��Z
ejdd
d��Zejddd��Z
dS)�
BaseSpecifiercCsdS)z�
        Returns the str representation of this Specifier like object. This
        should be representative of the Specifier itself.
        Nr)�selfrrr�__str__szBaseSpecifier.__str__cCsdS)zF
        Returns a hash value for this Specifier like object.
        Nr)rrrr�__hash__szBaseSpecifier.__hash__cCsdS)zq
        Returns a boolean representing whether or not the two Specifier like
        objects are equal.
        Nr)r�otherrrr�__eq__$szBaseSpecifier.__eq__cCsdS)zu
        Returns a boolean representing whether or not the two Specifier like
        objects are not equal.
        Nr)rrrrr�__ne__+szBaseSpecifier.__ne__cCsdS)zg
        Returns whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr)rrrr�prereleases2szBaseSpecifier.prereleasescCsdS)zd
        Sets whether or not pre-releases as a whole are allowed by this
        specifier.
        Nr)r�valuerrrr9sNcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nr)r�itemrrrr�contains@szBaseSpecifier.containscCsdS)z�
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)r�iterablerrrr�filterFszBaseSpecifier.filter)N)N)rr
r�abc�abstractmethodrrrr�abstractpropertyr�setterrrrrrrrsrc@s�eZdZiZd dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zejdd��Zdd�Zd!dd�Zd"dd�ZdS)#�_IndividualSpecifier�NcCsF|jj|�}|stdj|���|jd�j�|jd�j�f|_||_dS)NzInvalid specifier: '{0}'�operator�version)�_regex�searchr�format�group�strip�_spec�_prereleases)r�specr�matchrrr�__init__Rsz_IndividualSpecifier.__init__cCs0|jdk	rdj|j�nd}dj|jjt|�|�S)Nz, prereleases={0!r}r$z<{0}({1!r}{2})>)r-r)r�	__class__r�str)r�prerrr�__repr___sz_IndividualSpecifier.__repr__cCsdj|j�S)Nz{0}{1})r)r,)rrrrrlsz_IndividualSpecifier.__str__cCs
t|j�S)N)�hashr,)rrrrrosz_IndividualSpecifier.__hash__cCsLt|t�r0y|j|�}Wq@tk
r,tSXnt||j�s@tS|j|jkS)N)�
isinstancerr1r�NotImplementedr,)rrrrrrrs
z_IndividualSpecifier.__eq__cCsLt|t�r0y|j|�}Wq@tk
r,tSXnt||j�s@tS|j|jkS)N)r6rr1rr7r,)rrrrrr}s
z_IndividualSpecifier.__ne__cCst|dj|j|��S)Nz_compare_{0})�getattrr)�
_operators)r�oprrr�
_get_operator�sz"_IndividualSpecifier._get_operatorcCst|ttf�st|�}|S)N)r6r	rr
)rr&rrr�_coerce_version�sz$_IndividualSpecifier._coerce_versioncCs
|jdS)Nr)r,)rrrrr%�sz_IndividualSpecifier.operatorcCs
|jdS)Nr)r,)rrrrr&�sz_IndividualSpecifier.versioncCs|jS)N)r-)rrrrr�sz _IndividualSpecifier.prereleasescCs
||_dS)N)r-)rrrrrr�scCs
|j|�S)N)r)rrrrr�__contains__�sz!_IndividualSpecifier.__contains__cCs<|dkr|j}|j|�}|jr(|r(dS|j|j�||j�S)NF)rr<�
is_prereleaser;r%r&)rrrrrrr�s
z_IndividualSpecifier.containsccs�d}g}d|dk	r|ndi}xL|D]D}|j|�}|j|f|�r"|jr\|pL|jr\|j|�q"d}|Vq"W|r�|r�x|D]
}|VqzWdS)NFrT)r<rr>r�append)rrrZyielded�found_prereleases�kwr&�parsed_versionrrrr�s




z_IndividualSpecifier.filter)r$N)N)N)rr
rr9r0r4rrrrr;r<�propertyr%r&rr"r=rrrrrrr#Ns 



r#c@sveZdZdZejdedejejB�Zdddddd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�LegacySpecifiera�
        (?P<operator>(==|!=|<=|>=|<|>))
        \s*
        (?P<version>
            [^,;\s)]* # Since this is a "legacy" specifier, and the version
                      # string can be just about anything, we match everything
                      # except for whitespace, a semi-colon for marker support,
                      # a closing paren since versions can be enclosed in
                      # them, and a comma since it's a version separator.
        )
        z^\s*z\s*$�equal�	not_equal�less_than_equal�greater_than_equal�	less_than�greater_than)z==z!=z<=z>=�<�>cCst|t�stt|��}|S)N)r6r	r2)rr&rrrr<�s
zLegacySpecifier._coerce_versioncCs||j|�kS)N)r<)r�prospectiver.rrr�_compare_equal�szLegacySpecifier._compare_equalcCs||j|�kS)N)r<)rrMr.rrr�_compare_not_equal�sz"LegacySpecifier._compare_not_equalcCs||j|�kS)N)r<)rrMr.rrr�_compare_less_than_equal�sz(LegacySpecifier._compare_less_than_equalcCs||j|�kS)N)r<)rrMr.rrr�_compare_greater_than_equalsz+LegacySpecifier._compare_greater_than_equalcCs||j|�kS)N)r<)rrMr.rrr�_compare_less_thansz"LegacySpecifier._compare_less_thancCs||j|�kS)N)r<)rrMr.rrr�_compare_greater_thansz%LegacySpecifier._compare_greater_thanN)rr
r�
_regex_str�re�compile�VERBOSE�
IGNORECASEr'r9r<rNrOrPrQrRrSrrrrrD�s 
rDcstj���fdd��}|S)Ncst|t�sdS�|||�S)NF)r6r)rrMr.)�fnrr�wrappeds
z)_require_version_compare.<locals>.wrapped)�	functools�wraps)rYrZr)rYr�_require_version_compare
sr]c	@s�eZdZdZejdedejejB�Zdddddd	d
dd�Z	e
d
d��Ze
dd��Ze
dd��Z
e
dd��Ze
dd��Ze
dd��Ze
dd��Zdd�Zedd��Zejdd��Zd S)!�	Specifiera
        (?P<operator>(~=|==|!=|<=|>=|<|>|===))
        (?P<version>
            (?:
                # The identity operators allow for an escape hatch that will
                # do an exact string match of the version you wish to install.
                # This will not be parsed by PEP 440 and we cannot determine
                # any semantic meaning from it. This operator is discouraged
                # but included entirely as an escape hatch.
                (?<====)  # Only match for the identity operator
                \s*
                [^\s]*    # We just match everything, except for whitespace
                          # since we are only testing for strict identity.
            )
            |
            (?:
                # The (non)equality operators allow for wild card and local
                # versions to be specified so we have to define these two
                # operators separately to enable that.
                (?<===|!=)            # Only match for equals and not equals

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?

                # You cannot use a wild card and a dev or local version
                # together so group them with a | and make them optional.
                (?:
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                    |
                    \.\*  # Wild card syntax of .*
                )?
            )
            |
            (?:
                # The compatible operator requires at least two digits in the
                # release segment.
                (?<=~=)               # Only match for the compatible operator

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)+   # release  (We have a + instead of a *)
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
            |
            (?:
                # All other operators only allow a sub set of what the
                # (non)equality operators do. Specifically they do not allow
                # local versions to be specified nor do they allow the prefix
                # matching wild cards.
                (?<!==|!=|~=)         # We have special cases for these
                                      # operators so we want to make sure they
                                      # don't match here.

                \s*
                v?
                (?:[0-9]+!)?          # epoch
                [0-9]+(?:\.[0-9]+)*   # release
                (?:                   # pre release
                    [-_\.]?
                    (a|b|c|rc|alpha|beta|pre|preview)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        z^\s*z\s*$Z
compatiblerErFrGrHrIrJZ	arbitrary)z~=z==z!=z<=z>=rKrLz===cCsNdjttjdd�t|���dd��}|d7}|jd�||�oL|jd�||�S)	N�.cSs|jd�o|jd�S)NZpostZdev)�
startswith)�xrrr�<lambda>�sz/Specifier._compare_compatible.<locals>.<lambda>rz.*z>=z==���)�join�list�	itertools�	takewhile�_version_splitr;)rrMr.�prefixrrr�_compare_compatible�s
zSpecifier._compare_compatiblecCsp|jd�rPt|j�}t|dd��}tt|��}|dt|��}t||�\}}nt|�}|jsht|j�}||kS)Nz.*����)�endswithrZpublicrhr2�len�_pad_version�local)rrMr.rrrrN�s


zSpecifier._compare_equalcCs|j||�S)N)rN)rrMr.rrrrO�szSpecifier._compare_not_equalcCs|t|�kS)N)r)rrMr.rrrrP�sz"Specifier._compare_less_than_equalcCs|t|�kS)N)r)rrMr.rrrrQ�sz%Specifier._compare_greater_than_equalcCs>t|�}||ksdS|jr:|jr:t|j�t|j�kr:dSdS)NFT)rr>�base_version)rrMr.rrrrR�szSpecifier._compare_less_thancCs`t|�}||ksdS|jr:|jr:t|j�t|j�kr:dS|jdk	r\t|j�t|j�kr\dSdS)NFT)rZis_postreleaserqrp)rrMr.rrrrS�s
zSpecifier._compare_greater_thancCst|�j�t|�j�kS)N)r2�lower)rrMr.rrr�_compare_arbitraryszSpecifier._compare_arbitrarycCsR|jdk	r|jS|j\}}|d
krN|dkr@|jd�r@|dd�}t|�jrNdSd	S)N�==�>=�<=�~=�===z.*rkTF)rtrurvrwrxrl)r-r,rmr
r>)rr%r&rrrrs


zSpecifier.prereleasescCs
||_dS)N)r-)rrrrrrsN)rr
rrTrUrVrWrXr'r9r]rjrNrOrPrQrRrSrsrCrr"rrrrr^s*^#r^z^([0-9]+)((?:a|b|c|rc)[0-9]+)$cCsDg}x:|jd�D],}tj|�}|r2|j|j��q|j|�qW|S)Nr_)�split�
_prefix_regexr(�extend�groupsr?)r&�resultrr/rrrrh's
rhc	Cs�gg}}|jttjdd�|���|jttjdd�|���|j|t|d�d��|j|t|d�d��|jddgtdt|d�t|d���|jddgtdt|d�t|d���ttj|��ttj|��fS)NcSs|j�S)N)�isdigit)rarrrrb6sz_pad_version.<locals>.<lambda>cSs|j�S)N)r~)rarrrrb7srr�0)r?rerfrgrn�insert�max�chain)�left�rightZ
left_splitZright_splitrrrro2s
&&roc@s�eZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zedd��Z
e
jdd��Z
dd�Zddd�Zd dd�ZdS)!�SpecifierSetr$NcCsrdd�|jd�D�}t�}xB|D]:}y|jt|��Wq tk
rX|jt|��Yq Xq Wt|�|_||_dS)NcSsg|]}|j�r|j��qSr)r+)�.0�srrr�
<listcomp>Rsz)SpecifierSet.__init__.<locals>.<listcomp>�,)	ry�set�addr^rrD�	frozenset�_specsr-)rZ
specifiersrZparsed�	specifierrrrr0Os

zSpecifierSet.__init__cCs*|jdk	rdj|j�nd}djt|�|�S)Nz, prereleases={0!r}r$z<SpecifierSet({0!r}{1})>)r-r)rr2)rr3rrrr4dszSpecifierSet.__repr__cCsdjtdd�|jD���S)Nr�css|]}t|�VqdS)N)r2)r�r�rrr�	<genexpr>nsz'SpecifierSet.__str__.<locals>.<genexpr>)rd�sortedr�)rrrrrmszSpecifierSet.__str__cCs
t|j�S)N)r5r�)rrrrrpszSpecifierSet.__hash__cCs�t|t�rt|�}nt|t�s"tSt�}t|j|jB�|_|jdkrX|jdk	rX|j|_n<|jdk	rv|jdkrv|j|_n|j|jkr�|j|_ntd��|S)NzFCannot combine SpecifierSets with True and False prerelease overrides.)r6rr�r7r�r�r-�
ValueError)rrr�rrr�__and__ss





zSpecifierSet.__and__cCsFt|t�rt|�}n&t|t�r,tt|��}nt|t�s:tS|j|jkS)N)r6rr�r#r2r7r�)rrrrrr�s



zSpecifierSet.__eq__cCsFt|t�rt|�}n&t|t�r,tt|��}nt|t�s:tS|j|jkS)N)r6rr�r#r2r7r�)rrrrrr�s



zSpecifierSet.__ne__cCs
t|j�S)N)rnr�)rrrr�__len__�szSpecifierSet.__len__cCs
t|j�S)N)�iterr�)rrrr�__iter__�szSpecifierSet.__iter__cCs.|jdk	r|jS|jsdStdd�|jD��S)Ncss|]}|jVqdS)N)r)r�r�rrrr��sz+SpecifierSet.prereleases.<locals>.<genexpr>)r-r��any)rrrrr�s

zSpecifierSet.prereleasescCs
||_dS)N)r-)rrrrrr�scCs
|j|�S)N)r)rrrrrr=�szSpecifierSet.__contains__csNt�ttf�st����dkr$|j��r4�jr4dSt��fdd�|jD��S)NFc3s|]}|j��d�VqdS))rN)r)r�r�)rrrrr��sz(SpecifierSet.contains.<locals>.<genexpr>)r6r	rr
rr>�allr�)rrrr)rrrr�szSpecifierSet.containscCs�|dkr|j}|jr:x |jD]}|j|t|�d�}qW|Sg}g}xZ|D]R}t|ttf�sdt|�}n|}t|t�rtqH|jr�|r�|s�|j	|�qH|j	|�qHW|r�|r�|dkr�|S|SdS)N)r)
rr�r�boolr6r	rr
r>r?)rrrr.Zfilteredr@rrBrrrr�s*


zSpecifierSet.filter)r$N)N)N)rr
rr0r4rrr�rrr�r�rCrr"r=rrrrrrr�Ms
	


r�)Z
__future__rrrrr[rfrUZ_compatrrr&rr	r
r�r�ABCMeta�objectrr#rDr]r^rVrzrhror�rrrr�<module>s&9	4	

© 2025 GrazzMean