Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/packaging/__pycache__/specifiers.cpython-311.pyc



]j&	dZddlZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
ddlmZddlmZe
eefZedeZeeegefZd	ed
efdZGdd
eZGddejZGddeZejdZd	ed
eefdZded
efdZ deedeed
eeeeeffdZ!GddeZ"dS)z
.. testsetup::

    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from packaging.version import Version
N)	CallableIterableIteratorListOptionalSetTupleTypeVarUnion)canonicalize_version)VersionUnparsedVersionVar)boundversionreturncNt|tst|}|SN)
isinstancer)rs t/builddir/build/BUILD/imunify360-venv-2.6.3/opt/imunify360/venv/lib/python3.11/site-packages/packaging/specifiers.py_coerce_versionr"s&gw''#'""NceZdZdZdS)InvalidSpecifiera
    Raised when attempting to create a :class:`Specifier` with a specifier
    string that is invalid.

    >>> Specifier("lolwat")
    Traceback (most recent call last):
        ...
    packaging.specifiers.InvalidSpecifier: Invalid specifier: 'lolwat'
    N)__name__
__module____qualname____doc__rrrr(srrc	eZdZejdefdZejdefdZejde	de
fdZeejde
e
fdZejde
ddfd	Zejdd
ede
e
de
fdZej	dd
eede
e
deefdZdS)
BaseSpecifierrcdS)z
        Returns the str representation of this Specifier-like object. This
        should be representative of the Specifier itself.
        Nrselfs r__str__zBaseSpecifier.__str__5rcdS)zF
        Returns a hash value for this Specifier-like object.
        Nrr#s r__hash__zBaseSpecifier.__hash__<r&rothercdS)z
        Returns a boolean representing whether or not the two Specifier-like
        objects are equal.

        :param other: The other object to check against.
        Nrr$r)s  r__eq__zBaseSpecifier.__eq__Br&rcdS)zWhether or not pre-releases as a whole are allowed.

        This can be set to either ``True`` or ``False`` to explicitly enable or disable
        prereleases or it can be set to ``None`` (the default) to use default semantics.
        Nrr#s rprereleaseszBaseSpecifier.prereleasesKr&rvalueNcdS)zQSetter for :attr:`prereleases`.

        :param value: The value to set.
        Nrr$r/s  rr.zBaseSpecifier.prereleasesTr&ritemr.cdS)zR
        Determines if the given item is contained within this specifier.
        Nr)r$r2r.s   rcontainszBaseSpecifier.contains[r&riterablecdS)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$r5r.s   rfilterzBaseSpecifier.filterar&rr)rrrabcabstractmethodstrr%intr(objectboolr,propertyrr.setterr4rrrr7rrrr!r!4s	#
	FtXd^X$	Sx~
	TX !34CKD>	$	%rr!)	metaclassc	eZdZdZdZdZejdezezdzejej	zZ
dddd	d
ddd
dZd1dede
eddfdZedefdZejdeddfdZedefdZedefdZdefdZdefdZedeeeffdZdefdZdedefdZd edefd!Zd"ededefd#Z d"ededefd$Z!d"ededefd%Z"d"ededefd&Z#d"ededefd'Z$d"ed(edefd)Z%d"ed(edefd*Z&d"ededefd+Z'd,e(eefdefd-Z)	d2d,e*de
edefd.Z+	d2d/e,e-de
ede.e-fd0Z/dS)3	Specifiera?This class abstracts handling of version specifiers.

    .. tip::

        It is generally not required to instantiate this manually. You should instead
        prefer to work with :class:`SpecifierSet` instead, which can parse
        comma-separated version specifiers (which is what package metadata contains).
    z8
        (?P<operator>(~=|==|!=|<=|>=|<|>|===))
        a
        (?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;)]*  # The arbitrary version can be just about anything,
                          # we match everything except for whitespace, a
                          # semi-colon for marker support, and a closing paren
                          # since versions can be enclosed in them.
            )
            |
            (?:
                # 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

                # You cannot use a wild card and a pre-release, post-release, a dev or
                # local version together so group them with a | and make them optional.
                (?:
                    \.\*  # Wild card syntax of .*
                    |
                    (?:                                  # pre release
                        [-_\.]?
                        (alpha|beta|preview|pre|a|b|c|rc)
                        [-_\.]?
                        [0-9]*
                    )?
                    (?:                                  # post release
                        (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                    )?
                    (?:[-_\.]?dev[-_\.]?[0-9]*)?         # dev release
                    (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
                )?
            )
            |
            (?:
                # 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
                    [-_\.]?
                    (alpha|beta|preview|pre|a|b|c|rc)
                    [-_\.]?
                    [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
                    [-_\.]?
                    (alpha|beta|preview|pre|a|b|c|rc)
                    [-_\.]?
                    [0-9]*
                )?
                (?:                                   # post release
                    (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
                )?
                (?:[-_\.]?dev[-_\.]?[0-9]*)?          # dev release
            )
        )
        z^\s*z\s*$
compatibleequal	not_equalless_than_equalgreater_than_equal	less_thangreater_than	arbitrary)~===z!=<=>=<>===Nspecr.rc|j|}|std|d|d|df|_||_dS)aInitialize a Specifier instance.

        :param spec:
            The string representation of a specifier which will be parsed and
            normalized before use.
        :param prereleases:
            This tells the specifier if it should accept prerelease versions if
            applicable or not. The default of ``None`` will autodetect it from the
            given specifiers.
        :raises InvalidSpecifier:
            If the given specifier is invalid (i.e. bad syntax).
        zInvalid specifier: ''operatorrN)_regexsearchrgroupstrip_spec_prereleases)r$rSr.matchs    r__init__zSpecifier.__init__s""4((	C"#A$#A#A#ABBB
KK
##))++KK	""((**'

(rc|j|jS|j\}}|dvr;|dkr|dr
|dd}t|jrdSdS)N)rLrNrMrKrQrL.*TF)r\r[endswithr
is_prerelease)r$rVrs   rr.zSpecifier.prereleasess|($$
!J'6664G$4$4T$:$:!#2#,w-
turr/c||_dSrr\r1s  rr.zSpecifier.prereleases!rc|jdS)z`The operator of this specifier.

        >>> Specifier("==1.2.3").operator
        '=='
        rr[r#s rrVzSpecifier.operatorz!}rc|jdS)zaThe version of this specifier.

        >>> Specifier("==1.2.3").version
        '1.2.3'
        rrhr#s rrzSpecifier.version%rircl|j
d|jnd}d|jjdt	||dS)aTA representation of the Specifier that shows all internal state.

        >>> Specifier('>=1.0.0')
        <Specifier('>=1.0.0')>
        >>> Specifier('>=1.0.0', prereleases=False)
        <Specifier('>=1.0.0', prereleases=False)>
        >>> Specifier('>=1.0.0', prereleases=True)
        <Specifier('>=1.0.0', prereleases=True)>
        N, prereleases=rRrO()>)r\r.	__class__rr:r$pres  r__repr__zSpecifier.__repr__.sT ,
2T-111	B4>*AASYYA#AAAArc dj|jS)zA string representation of the Specifier that can be round-tripped.

        >>> str(Specifier('>=1.0.0'))
        '>=1.0.0'
        >>> str(Specifier('>=1.0.0', prereleases=False))
        '>=1.0.0'
        z{}{})formatr[r#s rr%zSpecifier.__str__@sv}dj))rcvt|jd|jddk}|jd|fS)NrrrKstrip_trailing_zero)r
r[)r$canonical_versions  r_canonical_speczSpecifier._canonical_specJsB0JqM!%A$!6


z!}///rc*t|jSr)hashryr#s rr(zSpecifier.__hash__RsD()))rr)ct|tr;	|t|}n3#t$r
tcYSwxYwt||jstS|j|jkS)a>Whether or not the two Specifier-like objects are equal.

        :param other: The other object to check against.

        The value of :attr:`prereleases` is ignored.

        >>> Specifier("==1.2.3") == Specifier("== 1.2.3.0")
        True
        >>> (Specifier("==1.2.3", prereleases=False) ==
        ...  Specifier("==1.2.3", prereleases=True))
        True
        >>> Specifier("==1.2.3") == "==1.2.3"
        True
        >>> Specifier("==1.2.3") == Specifier("==1.2.4")
        False
        >>> Specifier("==1.2.3") == Specifier("~=1.2.3")
        False
        )rr:rorNotImplementedryr+s  rr,zSpecifier.__eq__Us&eS!!	"
&s5zz22#
&
&
&%%%%
&E4>22	"!!#u'<<<s":A
AopcBt|d|j|}|S)N	_compare_)getattr
_operators)r$r~operator_callables   r
_get_operatorzSpecifier._get_operatorrs/.53dob133/
/
! rprospectivec
&dttjtt|dd}|dz
}|d||o|d||S)N.r`rNrL)joinlist	itertools	takewhile_is_not_suffix_version_splitr)r$rrSprefixs    r_compare_compatiblezSpecifier._compare_compatiblexs$^^D5I5IJJKKCRCP


	$'t!!$''T::
?Wt?Q?QRV?W?W@
@
	
rc|dr}t|jd}t|ddd}t|}t|}t	||\}}|dt|}	|	|kSt
|}
|
jst
|j}||
kS)Nr`Frvra)rbr
publicr_pad_versionlenrlocal)r$rrSnormalized_prospectivenormalized_spec
split_specsplit_prospectivepadded_prospective_shortened_prospectivespec_versions           r_compare_equalzSpecifier._compare_equals==$	/%9"&&&"349RWXXXO(88J
!//E F F%11BJ$O$O!
%77HZ7H$I!(J66#4==L
 %
:%k&899,..rc0|||Sr)rr$rrSs   r_compare_not_equalzSpecifier._compare_not_equals&&{D9999rcLt|jt|kSrrrrs   r_compare_less_than_equalz"Specifier._compare_less_than_equal 
{)**gdmm;;rcLt|jt|kSrrrs   r_compare_greater_than_equalz%Specifier._compare_greater_than_equalrrspec_strct|}||ksdS|js3|jr,t|jt|jkrdSdSNFT)rrcbase_versionr$rrrSs    r_compare_less_thanzSpecifier._compare_less_thansgx  
T!!5!	k&?	{/00GD<M4N4NNNu
trct|}||ksdS|js3|jr,t|jt|jkrdS|j,t|jt|jkrdSdSr)ris_postreleaserrrs    r_compare_greater_thanzSpecifier._compare_greater_thansx  
T!!5"	{'A	{/00GD<M4N4NNNu({/00GD<M4N4NNNu
trct|t|kSr)r:lowerrs   r_compare_arbitraryzSpecifier._compare_arbitrarys1;%%''3t99??+<+<<<rr2c,||S)a;Return whether or not the item is contained in this specifier.

        :param item: The item to check for.

        This is used for the ``in`` operator and behaves the same as
        :meth:`contains` with no ``prereleases`` argument passed.

        >>> "1.2.3" in Specifier(">=1.2.3")
        True
        >>> Version("1.2.3") in Specifier(">=1.2.3")
        True
        >>> "1.0.0" in Specifier(">=1.2.3")
        False
        >>> "1.3.0a1" in Specifier(">=1.2.3")
        False
        >>> "1.3.0a1" in Specifier(">=1.2.3", prereleases=True)
        True
        r4r$r2s  r__contains__zSpecifier.__contains__&}}T"""rc||j}t|}|jr|sdS||j}|||jS)alReturn whether or not the item is contained in this specifier.

        :param item:
            The item to check for, which can be a version string or a
            :class:`Version` instance.
        :param prereleases:
            Whether or not to match prereleases with this Specifier. If set to
            ``None`` (the default), it uses :attr:`prereleases` to determine
            whether or not prereleases are allowed.

        >>> Specifier(">=1.2.3").contains("1.2.3")
        True
        >>> Specifier(">=1.2.3").contains(Version("1.2.3"))
        True
        >>> Specifier(">=1.2.3").contains("1.0.0")
        False
        >>> Specifier(">=1.2.3").contains("1.3.0a1")
        False
        >>> Specifier(">=1.2.3", prereleases=True).contains("1.3.0a1")
        True
        >>> Specifier(">=1.2.3").contains("1.3.0a1", prereleases=True)
        True
        NF)r.rrcrrVr)r$r2r.normalized_itemrs     rr4zSpecifier.containssg8*K*$//
(		5/3.@.@.O.O  $,???rr5c#Kd}g}d||ndi}|D]K}t|}|j|fi|r,|jr|s|js||Ed}|VL|s|r|D]
}|VdSdSdS)aOFilter items in the given iterable, that match the specifier.

        :param iterable:
            An iterable that can contain version strings and :class:`Version` instances.
            The items in the iterable will be filtered according to the specifier.
        :param prereleases:
            Whether or not to allow prereleases in the returned iterator. If set to
            ``None`` (the default), it will be intelligently decide whether to allow
            prereleases or not (based on the :attr:`prereleases` attribute, and
            whether the only versions matching are prereleases).

        This method is smarter than just ``filter(Specifier().contains, [...])``
        because it implements the rule from :pep:`440` that a prerelease item
        SHOULD be accepted if no other versions match the given specifier.

        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))
        ['1.3']
        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.2.3", "1.3", Version("1.4")]))
        ['1.2.3', '1.3', <Version('1.4')>]
        >>> list(Specifier(">=1.2.3").filter(["1.2", "1.5a1"]))
        ['1.5a1']
        >>> list(Specifier(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))
        ['1.3', '1.5a1']
        >>> list(Specifier(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))
        ['1.3', '1.5a1']
        Fr.NT)rr4rcr.append)r$r5r.yieldedfound_prereleaseskwrparsed_versions        rr7zSpecifier.filterEs<K,C[[
N 	"	"G,W55Nt}^22r22
""/""#'#3"&,,W5555#G!MMM
	,	,





				

rrRNr)0rrrr_operator_regex_str_version_regex_strrecompileVERBOSE
IGNORECASErWrr:rr=r^r>r.r?rVrrrr%r	ryr;r(r<r,CallableOperatorrrrrrrrrrrrrUnparsedVersionr4rrrr7rrrrBrBks/\|RZ%%(::WD

R]"F"

		J((S(HTN(d((((4TX.""$""""#XXB#BBBB$*****0sCx000X0*#****=F=t====:!!(8!!!!
w
c
d



*'/''/'/'/'/'/'/R:g:S:T::::<G<3<4<<<<<w<c<d<<<<g2CD>=g=S=T====#sG|!4#####,DH,@,@#,@2:4.,@	
,@,@,@,@^UY;; !34;CKD>;	$	%;;;;;;rrBz^([0-9]+)((?:a|b|c|rc)[0-9]+)$cg}|dD][}t|}|r(||F||\|S)Nr)split
_prefix_regexrXextendgroupsr)rresultr2r]s    rrrstF

c""  $$T**	 MM%,,..))))MM$Mrsegmentc<tfddDS)Nc3BK|]}|VdSr)
startswith).0rrs  r	<genexpr>z!_is_not_suffix.<locals>.<genexpr>sB'-6""r)devabrcpost)any)rs`rrrs@1PrleftrightcRgg}}|ttjd||ttjd|||t	|dd||t	|dd|ddgt
dt	|dt	|dz
z|ddgt
dt	|dt	|dz
zttj|ttj|fS)Nc*|Srisdigitxs r<lambda>z_pad_version.<locals>.<lambda>src*|Srrrs rrz_pad_version.<locals>.<lambda>s!))++rrr0)rrrrrinsertmaxchain)rr
left_splitright_splits    rrrsr "Jd9./D/DdKKLLMMMtI/0E0EuMMNNOOOd3z!}--//0111uSQ00223444a#QKN(;(;c*Q->P>P(P!Q!QQRRRq3%#aZ]););c+a.>Q>Q)Q"R"RRSSS*-..Y_k5R0S0STTrc	eZdZdZ	ddedeeddfdZedeefdZ	e	j
d	eddfd
Z	defdZdefdZde
fd
ZdedefddfdZdedefdZde
fdZdeefdZdedefdZ		ddedeedeedefdZ	ddeedeedeefdZdS)SpecifierSetzThis class abstracts handling of a set of version specifiers.

    It can be passed a single specifier (``>=3.0``), a comma-separated list of
    specifiers (``>=3.0,!=3.1``), or no specifier at all.
    rRN
specifiersr.rcd|dD}t}|D]$}|t|%t	||_||_dS)aNInitialize a SpecifierSet instance.

        :param specifiers:
            The string representation of a specifier or a comma-separated list of
            specifiers which will be parsed and normalized before use.
        :param prereleases:
            This tells the SpecifierSet if it should accept prerelease versions if
            applicable or not. The default of ``None`` will autodetect it from the
            given specifiers.

        :raises InvalidSpecifier:
            If the given ``specifiers`` are not parseable than this exception will be
            raised.
        c^g|]*}||+Sr)rZrss  r
<listcomp>z)SpecifierSet.__init__.<locals>.<listcomp>s-RRR!		RAGGIIRRRr,N)rsetaddrB	frozenset_specsr\)r$rr.split_specifiersparsed	specifiers      rr^zSpecifierSet.__init__s(SRz/?/?/D/DRRR"%)	-	-IJJy++,,,, ''(rcl|j|jS|jsdStd|jDS)Nc3$K|]}|jVdSrr.rs  rrz+SpecifierSet.prereleases.<locals>.<genexpr>s$66Q1=666666r)r\rrr#s rr.zSpecifierSet.prereleasessH($$
{	466$+666666rr/c||_dSrrer1s  rr.zSpecifierSet.prereleasesrfrcR|j
d|jnd}dt||dS)aA representation of the specifier set that shows all internal state.

        Note that the ordering of the individual specifiers within the set may not
        match the input string.

        >>> SpecifierSet('>=1.0.0,!=2.0.0')
        <SpecifierSet('!=2.0.0,>=1.0.0')>
        >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=False)
        <SpecifierSet('!=2.0.0,>=1.0.0', prereleases=False)>
        >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=True)
        <SpecifierSet('!=2.0.0,>=1.0.0', prereleases=True)>
        NrlrRz<SpecifierSet(rn)r\r.r:rps  rrrzSpecifierSet.__repr__sF ,
2T-111	5D		4S4444rcddtd|jDS)anA string representation of the specifier set that can be round-tripped.

        Note that the ordering of the individual specifiers within the set may not
        match the input string.

        >>> str(SpecifierSet(">=1.0.0,!=1.0.1"))
        '!=1.0.1,>=1.0.0'
        >>> str(SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False))
        '!=1.0.1,>=1.0.0'
        rc34K|]}t|VdSr)r:rs  rrz'SpecifierSet.__str__.<locals>.<genexpr>s(;;!s1vv;;;;;;r)rsortedrr#s rr%zSpecifierSet.__str__s/xx;;t{;;;;;<<<rc*t|jSr)r{rr#s rr(zSpecifierSet.__hash__
sDK   rr)ct|trt|}nt|tstSt}t	|j|jz|_|j|j
|j|_nG|j|j
|j|_n,|j|jkr
|j|_ntd|S)aReturn a SpecifierSet which is a combination of the two sets.

        :param other: The other object to combine with.

        >>> SpecifierSet(">=1.0.0,!=1.0.1") & '<=2.0.0,!=2.0.1'
        <SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')>
        >>> SpecifierSet(">=1.0.0,!=1.0.1") & SpecifierSet('<=2.0.0,!=2.0.1')
        <SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')>
        NzFCannot combine SpecifierSets with True and False prerelease overrides.)rr:rr}rrr\
ValueError)r$r)rs   r__and__zSpecifierSet.__and__
seS!!	" ''EEE<00	"!! NN	$T[5<%?@@	$);)G%*%7I""


*u/A/I%)%6I""

%"4
4
4%)%6I""

rct|ttfrtt|}nt|tstS|j|jkS)aWhether or not the two SpecifierSet-like objects are equal.

        :param other: The other object to check against.

        The value of :attr:`prereleases` is ignored.

        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.1")
        True
        >>> (SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False) ==
        ...  SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True))
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1") == ">=1.0.0,!=1.0.1"
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.2")
        False
        )rr:rBrr}rr+s  rr,zSpecifierSet.__eq__-sW&ec9-..	" U,,EEE<00	"!!{el**rc*t|jS)z7Returns the number of specifiers in this specifier set.)rrr#s r__len__zSpecifierSet.__len__Gs4;rc*t|jS)z
        Returns an iterator over all the underlying :class:`Specifier` instances
        in this specifier set.

        >>> sorted(SpecifierSet(">=1.0.0,!=1.0.1"), key=str)
        [<Specifier('!=1.0.1')>, <Specifier('>=1.0.0')>]
        )iterrr#s r__iter__zSpecifierSet.__iter__KsDK   rr2c,||S)arReturn whether or not the item is contained in this specifier.

        :param item: The item to check for.

        This is used for the ``in`` operator and behaves the same as
        :meth:`contains` with no ``prereleases`` argument passed.

        >>> "1.2.3" in SpecifierSet(">=1.0.0,!=1.0.1")
        True
        >>> Version("1.2.3") in SpecifierSet(">=1.0.0,!=1.0.1")
        True
        >>> "1.0.1" in SpecifierSet(">=1.0.0,!=1.0.1")
        False
        >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1")
        False
        >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True)
        True
        rrs  rrzSpecifierSet.__contains__Urr	installedcttst|js	jrdS|rjrtjtfd|jDS)aReturn whether or not the item is contained in this SpecifierSet.

        :param item:
            The item to check for, which can be a version string or a
            :class:`Version` instance.
        :param prereleases:
            Whether or not to match prereleases with this SpecifierSet. If set to
            ``None`` (the default), it uses :attr:`prereleases` to determine
            whether or not prereleases are allowed.

        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.2.3")
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains(Version("1.2.3"))
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.0.1")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1")
        False
        >>> SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True).contains("1.3.0a1")
        True
        >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1", prereleases=True)
        True
        NFc3FK|]}|VdS)rNr)rrr2r.s  rrz(SpecifierSet.contains.<locals>.<genexpr>s3RR1::d:<<RRRRRRr)rrr.rcrallr)r$r2r.rs `` rr4zSpecifierSet.containsjs<$((	!4==D
*K	t1	5	.+	.4,--DRRRRRdkRRRRRRrr5c||j}|jr=|jD]&}||t|}'t	|Sg}g}|D]G}t|}|jr|s|s||2||H|s|r|t	|St	|S)a.Filter items in the given iterable, that match the specifiers in this set.

        :param iterable:
            An iterable that can contain version strings and :class:`Version` instances.
            The items in the iterable will be filtered according to the specifier.
        :param prereleases:
            Whether or not to allow prereleases in the returned iterator. If set to
            ``None`` (the default), it will be intelligently decide whether to allow
            prereleases or not (based on the :attr:`prereleases` attribute, and
            whether the only versions matching are prereleases).

        This method is smarter than just ``filter(SpecifierSet(...).contains, [...])``
        because it implements the rule from :pep:`440` that a prerelease item
        SHOULD be accepted if no other versions match the given specifier.

        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", "1.5a1"]))
        ['1.3']
        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", Version("1.4")]))
        ['1.3', <Version('1.4')>]
        >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.5a1"]))
        []
        >>> list(SpecifierSet(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True))
        ['1.3', '1.5a1']
        >>> list(SpecifierSet(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"]))
        ['1.3', '1.5a1']

        An "empty" SpecifierSet will filter items based on the presence of prerelease
        versions in the set.

        >>> list(SpecifierSet("").filter(["1.3", "1.5a1"]))
        ['1.3']
        >>> list(SpecifierSet("").filter(["1.5a1"]))
        ['1.5a1']
        >>> list(SpecifierSet("", prereleases=True).filter(["1.3", "1.5a1"]))
        ['1.3', '1.5a1']
        >>> list(SpecifierSet("").filter(["1.3", "1.5a1"], prereleases=True))
        ['1.3', '1.5a1']
        Nr)r.rr7r=rrrcr)r$r5r.rSfilteredrr2rs        rr7zSpecifierSet.filtersX*K
;	"
P
P;;xT+=N=N;OO>>!
24H:< 	
*	
*!0!6!6"/**#7)00666OOD))))
/ 1
/k6I-...>>!rr)NNr)rrrrr:rr=r^r>r.r?rrr%r;r(rrr<r,r
rrBr
rrr4rrr7rrrrrs`CG!(!(!(19$!(	
!(!(!(!(F7Xd^777X7 ""$""""5#5555*=====!#!!!!U>3#67N@+F+t++++4     !(9-!!!!##T####0'+$(	7S7S7Sd^7SD>	7S

7S7S7S7StUYM"M" !34M"CKD>M"	$	%M"M"M"M"M"M"rr)#rr8rrtypingrrrrrrr	r
rutilsr
rrr:rrr=rrrrABCMetar!rBrrrrrrrrr<module>rs


				





















('''''%W1IIIWcND01_					z			44444ck4444nUUUUU
UUUp
<==
CDICDUtCyUcUuT#YS	=Q7RUUUU$G"G"G"G"G"=G"G"G"G"G"r
Back to Directory File Manager