PHP WebShell

Текущая директория: /usr/lib/python3/dist-packages/hamcrest/library/collection/__pycache__

Просмотр файла: issequence_containinginanyorder.cpython-310.pyc

o

(]^�@s�ddlmZmZmZmZmZmZddlmZddl	m
Z
ddlmZddl
mZdZdZdZed	�ZGd
d�de�ZGdd
�d
eee�Zdeeeefdeeefdd�ZdS)�)�MutableSequence�Optional�Sequence�TypeVar�Union�cast)�BaseMatcher)�Description)�wrap_matcher)�MatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txt�Tc@szeZdZdeeedeeddfdd�Zdede	fdd	�Z
deede	fd
d�Zdede	fdd
�Zdede	fdd�Z
dS)�MatchInAnyOrder�matchers�mismatch_description�returnNcCs&tttt|dd��|_||_dS�N)rrrrrr)�selfrr�r�]/usr/lib/python3/dist-packages/hamcrest/library/collection/issequence_containinginanyorder.py�__init__s
zMatchInAnyOrder.__init__�itemcCs|�|�o	|�|�Sr)�isnotsurplus�	ismatched�rrrrr�matchesszMatchInAnyOrder.matchescCs@|jsdS|jr|j�d��ddd|j��d��ddd|�dS)	NTzno item matches: ��, z in �[�]F)rr�append_text�append_listrrrr�
isfinisheds
�zMatchInAnyOrder.isfinishedcCs&|js|jr|j�d��|�dSdS)N�
not matched: FT)rrr�append_description_ofrrrrr"s
zMatchInAnyOrder.isnotsurpluscCsHt|j�D]\}}|�|�r|j|=dSq|jr"|j�d��|�dS)NTr"F)�	enumeraterrrrr#)rr�index�matcherrrrr)s
�zMatchInAnyOrder.ismatched)�__name__�
__module__�__qualname__rrrrr	r�boolrr!rrrrrrr
s
��
�	r
cs|eZdZdeeeddfdd�Z	ddeedeede	f�fdd	�
Z
deededdfd
d�Zdeddfd
d�Z�Z
S)�IsSequenceContainingInAnyOrderrrNcCs
||_dSr)r)rrrrrr5s
z'IsSequenceContainingInAnyOrder.__init__rrcshzt|�}t|j|�}|D]}|�|�sWdSq
|�|�WSty3|r0tt|��||�YdSw)NF)	�listr
rrr!�	TypeError�superr+�describe_mismatch)rrr�sequence�
matchsequence�element��	__class__rrr8s
�
��z&IsSequenceContainingInAnyOrder.matchescCs|�||�dSr)r)rrrrrrr/Isz0IsSequenceContainingInAnyOrder.describe_mismatch�descriptioncCs"|�d��ddd|j��d�dS)Nza sequence over rrrz
 in any order)rr r)rr5rrr�describe_toLs

�z*IsSequenceContainingInAnyOrder.describe_tor)r'r(r)rrrrrr	r*rr/r6�
__classcell__rrr3rr+4s����r+�itemsrcGs$g}|D]	}|�t|��qt|�S)a�Matches if sequences's elements, in any order, satisfy a given list of
    matchers.

    :param match1,...: A comma-separated list of matchers.

    This matcher iterates the evaluated sequence, seeing if each element
    satisfies any of the given matchers. The matchers are tried from left to
    right, and when a satisfied matcher is found, it is no longer a candidate
    for the remaining elements. If a one-to-one correspondence is established
    between elements and matchers, ``contains_inanyorder`` is satisfied.

    Any argument that is not a matcher is implicitly wrapped in an
    :py:func:`~hamcrest.core.core.isequal.equal_to` matcher to check for
    equality.

    )�appendr
r+)r8rrrrr�contains_inanyorderRsr:N)�typingrrrrrr�hamcrest.core.base_matcherr�hamcrest.core.descriptionr	�"hamcrest.core.helpers.wrap_matcherr
�hamcrest.core.matcherr�
__author__�
__copyright__�__license__r�objectr
r+r:rrrr�<module>s %*

Выполнить команду


Для локальной разработки. Не используйте в интернете!