403Webshell
Server IP : 162.144.4.212  /  Your IP : 216.73.216.108
Web Server : Apache
System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64
User : cozeellc ( 2980)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/libexec/oracle-cloud-agent/plugins/osms/packaging/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/libexec/oracle-cloud-agent/plugins/osms/packaging/specifiers.pyc
a

i��f"��@s(dZddlmZddlZddlZddlZddlmZmZm	Z	m
Z
mZddlm
Z
ddlmZeeefZe
ded	�ZeeegefZd
dd�d
d�ZGdd�de�ZGdd�dejd�ZGdd�de�Ze�d�Zddd�dd�Zddd�dd�Zddd�d d!�Zddd"d#�d$d%�Z Gd&d'�d'e�Z!dS)(z�
.. testsetup::

    from packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier
    from packaging.version import Version
�)�annotationsN)�Callable�Iterable�Iterator�TypeVar�Union�)�canonicalize_version)�Version�UnparsedVersionVar)�bound�UnparsedVersionr
)�version�returncCst|t�st|�}|S�N)�
isinstancer
)r�r�x/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/packaging/specifiers.py�_coerce_versions
rc@seZdZdZdS)�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__rrrrr src@s�eZdZejdd�dd��Zejdd�dd��Zejdd	d
�dd��Zeejd
d�dd���Z	e	j
d	dd�dd��Z	ejddd
d	d�dd��Zejddd
dd�dd��ZdS)�
BaseSpecifier�str�rcCsdS)z�
        Returns the str representation of this Specifier-like object. This
        should be representative of the Specifier itself.
        Nr��selfrrr�__str__-szBaseSpecifier.__str__�intcCsdS)zF
        Returns a hash value for this Specifier-like object.
        Nrrrrr�__hash__4szBaseSpecifier.__hash__�object�bool��otherrcCsdS)z�
        Returns a boolean representing whether or not the two Specifier-like
        objects are equal.

        :param other: The other object to check against.
        Nr�rr%rrr�__eq__:szBaseSpecifier.__eq__�bool | NonecCsdS)z�Whether 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.
        Nrrrrr�prereleasesCszBaseSpecifier.prereleases�None��valuercCsdS)zQSetter for :attr:`prereleases`.

        :param value: The value to set.
        Nr�rr,rrrr)LsN��itemr)rcCsdS)zR
        Determines if the given item is contained within this specifier.
        Nr)rr/r)rrr�containsSszBaseSpecifier.contains�Iterable[UnparsedVersionVar]�Iterator[UnparsedVersionVar]��iterabler)rcCsdS)z�
        Takes an iterable of items and filters them so that only items which
        are contained within this specifier are allowed in it.
        Nr)rr4r)rrr�filterYszBaseSpecifier.filter)N)N)
rrr�abc�abstractmethodrr!r'�propertyr)�setterr0r5rrrrr,s �r)�	metaclassc	@s�eZdZdZdZdZe�deedejej	B�Z
dddd	d
ddd
d�ZdSdddd�dd�Ze
dd�dd��Zejddd�dd��Ze
dd�dd��Ze
dd�dd ��Zdd�d!d"�Zdd�d#d$�Ze
d%d�d&d'��Zd(d�d)d*�Zd+dd,�d-d.�Zdd/d0�d1d2�Zd3ddd4�d5d6�Zd3ddd4�d7d8�Zd3ddd4�d9d:�Zd3ddd4�d;d<�Zd3ddd4�d=d>�Zd3ddd?�d@dA�Zd3ddd?�dBdC�Zd3ddd4�dDdE�ZdFddG�dHdI�Z dTdJdddK�dLdM�Z!dUdNddOdP�dQdR�Z"dS)V�	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*$�
compatible�equal�	not_equal�less_than_equal�greater_than_equal�	less_than�greater_than�	arbitrary)�~=�==z!=�<=�>=�<�>�===�Nrr(r*)�specr)rcCsH|j�|�}|s td|�d���|�d���|�d���f|_||_dS)a�Initialize 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)�_regex�searchr�group�strip�_spec�_prereleases)rrLr)�matchrrr�__init__�s
�zSpecifier.__init__r#rcCsR|jdur|jS|j\}}|dvrN|dkr@|�d�r@|dd�}t|�jrNdSdS)N)rErGrFrDrJrE�.*���TF)rTrS�endswithr
�
is_prerelease)rrNrrrrr)�s


zSpecifier.prereleasesr+cCs
||_dSr�rTr-rrrr)scCs
|jdS)z`The operator of this specifier.

        >>> Specifier("==1.2.3").operator
        '=='
        r�rSrrrrrNszSpecifier.operatorcCs
|jdS)zaThe version of this specifier.

        >>> Specifier("==1.2.3").version
        '1.2.3'
        rr\rrrrrszSpecifier.versioncCs8|jdurd|j��nd}d|jj�dt|��|�d�S)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=rKrH�(�)>)rTr)�	__class__rr�r�prerrr�__repr__&s
��zSpecifier.__repr__cCsdj|j�S)z�A 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{}{})�formatrSrrrrr8szSpecifier.__str__ztuple[str, str]cCs*t|jd|jddkd�}|jd|fS)NrrrD��strip_trailing_zero)r	rS)r�canonical_versionrrr�_canonical_specBs
�zSpecifier._canonical_specr cCs
t|j�Sr)�hashrhrrrrr!JszSpecifier.__hash__r"r$cCsRt|t�r6z|�t|��}WqFty2tYS0nt||j�sFtS|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
        )rrr`r�NotImplementedrhr&rrrr'Ms
zSpecifier.__eq__�CallableOperator)�oprcCst|d|j|���}|S)N�	_compare_)�getattr�
_operators)rrl�operator_callablerrr�
_get_operatorjs�zSpecifier._get_operatorr
)�prospectiverLrcCsHttt�tt|���dd��}|d7}|�d�||�oF|�d�||�S)N���rWrGrE)�
_version_join�list�	itertools�	takewhile�_is_not_suffix�_version_splitrq)rrrrL�prefixrrr�_compare_compatibleps	��zSpecifier._compare_compatiblecCs�|�d�rbt|jdd�}t|dd�dd�}t|�}t|�}t||�\}}|dt|��}	|	|kSt|�}
|
jszt|j�}||
kSdS)NrWFrerX)rYr	�publicry�_pad_version�lenr
�local)rrrrL�normalized_prospective�normalized_spec�
split_spec�split_prospective�padded_prospective�_�shortened_prospective�spec_versionrrr�_compare_equal�s
�
zSpecifier._compare_equalcCs|�||�Sr)r��rrrrLrrr�_compare_not_equal�szSpecifier._compare_not_equalcCst|j�t|�kSr�r
r|r�rrr�_compare_less_than_equal�sz"Specifier._compare_less_than_equalcCst|j�t|�kSrr�r�rrr�_compare_greater_than_equal�sz%Specifier._compare_greater_than_equal)rr�spec_strrcCs<t|�}||ksdS|js8|jr8t|j�t|j�kr8dSdS�NFT)r
rZ�base_version�rrrr�rLrrr�_compare_less_than�szSpecifier._compare_less_thancCs^t|�}||ksdS|js8|jr8t|j�t|j�kr8dS|jdurZt|j�t|j�krZdSdSr�)r
�is_postreleaser�rr�rrr�_compare_greater_than�s
zSpecifier._compare_greater_thancCst|���t|���kSr)r�lowerr�rrr�_compare_arbitrary�szSpecifier._compare_arbitraryz
str | Version�r/rcCs
|�|�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
        �r0�rr/rrr�__contains__�szSpecifier.__contains__r
r.cCs<|dur|j}t|�}|jr$|s$dS|�|j�}|||j�S)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)rrZrqrNr)rr/r)�normalized_itemrprrrr0	s
zSpecifier.containsr1r2r3ccs�d}g}d|dur|ndi}|D]D}t|�}|j|fi|��r |jrZ|sZ|jsZ|�|�q d}|Vq |s~|r~|D]
}|VqrdS)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)rr0rZr)�append)rr4r)�yielded�found_prereleases�kwr�parsed_versionrrrr55s"��zSpecifier.filter)rKN)N)N)#rrrr�_operator_regex_str�_version_regex_str�re�compile�VERBOSE�
IGNORECASErOrorVr8r)r9rNrrcrrhr!r'rqr{r�r�r�r�r�r�r�r�r0r5rrrrr;csX	^
��
(-�r;z^([0-9]+)((?:a|b|c|rc)[0-9]+)$rz	list[str]cCs^g}|�d�\}}}|�|pd�|�d�D],}t�|�}|rN|�|���q,|�|�q,|S)aSplit version into components.

    The split components are intended for version comparison. The logic does
    not attempt to retain the original version string, so joining the
    components back with :func:`_version_join` may not produce the original
    version string.
    �!�0�.)�
rpartitionr��split�
_prefix_regexrP�extend�groups)r�result�epochr��restr/rUrrrryvs
ry)�
componentsrcCs|^}}|�dd�|���S)z�Join split version components into a version string.

    This function assumes the input came from :func:`_version_split`, where the
    first component must be the epoch (either empty or numeric), and all other
    components numeric.
    r�r�)�join)r�r�r�rrrrt�srtr#)�segmentrcst�fdd�dD��S)Nc3s|]}��|�VqdSr)�
startswith)�.0rz�r�rr�	<genexpr>�sz!_is_not_suffix.<locals>.<genexpr>)�dev�a�b�rc�post)�anyr�rr�rrx�s�rxztuple[list[str], list[str]])�left�rightrc
Cs�gg}}|�tt�dd�|���|�tt�dd�|���|�|t|d�d��|�|t|d�d��|�ddgtdt|d�t|d���|�ddgtdt|d�t|d���ttj�|��ttj�|��fS)NcSs|��Sr��isdigit��xrrr�<lambda>��z_pad_version.<locals>.<lambda>cSs|��Srr�r�rrrr��r�rrr�)	r�rurvrwr~�insert�max�chain�
from_iterable)r�r��
left_split�right_splitrrrr}�s
,,�r}c@s�eZdZdZd/dddd�dd	�Zedd
�dd��Zejd
dd�dd��Zdd
�dd�Zdd
�dd�Z	dd
�dd�Z
ddd�dd�Zdd
d�dd�Zdd
�dd�Z
d d
�d!d"�Zd#d
d$�d%d&�Zd0d#ddd
d'�d(d)�Zd1d*dd+d,�d-d.�ZdS)2�SpecifierSetz�This 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.
    rKNrr(r*)�
specifiersr)rcCs.dd�|�d�D�}ttt|��|_||_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.
        cSsg|]}|��r|���qSr)rR�r��srrr�
<listcomp>�r�z)SpecifierSet.__init__.<locals>.<listcomp>�,N)r��	frozenset�mapr;�_specsrT)rr�r)�split_specifiersrrrrV�szSpecifierSet.__init__rcCs.|jdur|jS|jsdStdd�|jD��S)Ncss|]}|jVqdSr�r)r�rrrr��r�z+SpecifierSet.prereleases.<locals>.<genexpr>)rTr�r�rrrrr)�s

zSpecifierSet.prereleasesr#r+cCs
||_dSrr[r-rrrr)�scCs.|jdurd|j��nd}dt|��|�d�S)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)>
        Nr]rKz<SpecifierSet(r_)rTr)rrarrrrc�s
��zSpecifierSet.__repr__cCsd�tdd�|jD���S)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'
        r�css|]}t|�VqdSr)rr�rrrr�	r�z'SpecifierSet.__str__.<locals>.<genexpr>)r��sortedr�rrrrr�szSpecifierSet.__str__r cCs
t|j�Sr)rir�rrrrr!szSpecifierSet.__hash__zSpecifierSet | strr$cCs�t|t�rt|�}nt|t�s"tSt�}t|j|jB�|_|jdurX|jdurX|j|_n<|jdurv|jdurv|j|_n|j|jkr�|j|_ntd��|S)a�Return 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.)rrr�rjr�r�rT�
ValueError)rr%�	specifierrrr�__and__s 






�zSpecifierSet.__and__r"cCs6t|ttf�rtt|��}nt|t�s*tS|j|jkS)a�Whether 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
        )rrr;r�rjr�r&rrrr'.s

zSpecifierSet.__eq__cCs
t|j�S)z7Returns the number of specifiers in this specifier set.)r~r�rrrr�__len__HszSpecifierSet.__len__zIterator[Specifier]cCs
t|j�S)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')>]
        )�iterr�rrrr�__iter__LszSpecifierSet.__iter__r
r�cCs
|�|�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
        r�r�rrrr�VszSpecifierSet.__contains__)r/r)�	installedrcs\t�t�st����dur |j��s.�jr.dS|rB�jrBt�j��t��fdd�|jD��S)a�Return 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
        NFc3s|]}|j��d�VqdS)r�Nr�r��r/r)rrr��r�z(SpecifierSet.contains.<locals>.<genexpr>)rr
r)rZr��allr�)rr/r)r�rr�rr0ks



zSpecifierSet.containsr1r2r3cCs�|dur|j}|jr:|jD]}|j|t|�d�}qt|�Sg}g}|D]0}t|�}|jrl|sl|sv|�|�qF|�|�qF|s�|r�|dur�t|�St|�SdS)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)r�r5r#r�rrZr�)rr4r)rL�filteredr�r/r�rrrr5�s",

zSpecifierSet.filter)rKN)NN)N)rrrrrVr8r)r9rcrr!r�r'r�r�r�r0r5rrrrr��s&
 
�:�r�)"r�
__future__rr6rvr��typingrrrrr�utilsr	rr
rr
rr#rkrr�r�ABCMetarr;r�r�ryrtrxr}r�rrrr�<module>s07


Youez - 2016 - github.com/yon3zu
LinuXploit