
    e`                        d dl mZmZmZmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ dZdZd	Z ed
      Z G d deee            Z G d deee            Zdeee   ef   deee      fdZdeee   ef   deee      fdZy)    )SequenceTypeVarUnioncast)BaseMatcher)all_of)Description)wrap_matcher)MatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtTc                   H    e Zd Zdee   ddfdZdee   defdZde	ddfdZ
y)	IsSequenceContainingelement_matcherreturnNc                     || _         y N)r   )selfr   s     S/usr/lib/python3/dist-packages/hamcrest/library/collection/issequence_containing.py__init__zIsSequenceContaining.__init__   s
    .    itemc                 n    	 |D ]  }| j                   j                  |      s y 	 y# t        $ r Y yw xY w)NTF)r   matches	TypeError)r   r   elements      r   _matcheszIsSequenceContaining._matches   sI    	  ''//8 
   		s    ( ( ( 	44descriptionc                 X    |j                  d      j                  | j                         y )Nza sequence containing )append_textappend_description_ofr   r   r   s     r   describe_toz IsSequenceContaining.describe_to   s%     89OO  	
r   )__name__
__module____qualname__r   r   r   r   boolr   r	   r"    r   r   r   r      sC    /
 /t /Xa[ T 
{ 
t 
r   r   c                   b    e Zd Zdee   ddfdZdee   defdZdee   de	ddfdZ
d	e	ddfd
Zy)IsSequenceContainingEveryelement_matchersr   Nc           	          |D cg c])  }t        t        t        t              t	        |            + }}t        | | _        y c c}w r   )r   r   r   r   has_itemr   matcher)r   r*   e	delegatess       r   r   z"IsSequenceContainingEvery.__init__(   s;    FVWT'(1+.<W	W-3Y-? Xs   .Ar   c                 j    	 | j                   j                  t        |            S # t        $ r Y yw xY w)NF)r-   r   listr   )r   r   s     r   r   z"IsSequenceContainingEvery._matches,   s2    	<<''T
33 		s   #& 	22mismatch_descriptionc                 <    | j                   j                  ||       y r   )r-   describe_mismatch)r   r   r2   s      r   r4   z+IsSequenceContainingEvery.describe_mismatch2   s    &&t-ABr   r   c                 :    | j                   j                  |       y r   )r-   r"   r!   s     r   r"   z%IsSequenceContainingEvery.describe_to5   s      -r   )r#   r$   r%   r   r   r   r   r&   r   r	   r4   r"   r'   r   r   r)   r)   '   si    @'!* @ @Xa[ T Chqk C CY] C.{ .t .r   r)   matchr   c                 *    t        t        |             S )a   Matches if any element of sequence satisfies a given matcher.

    :param match: The matcher to satisfy, or an expected value for
        :py:func:`~hamcrest.core.core.isequal.equal_to` matching.

    This matcher iterates the evaluated sequence, searching for any element
    that satisfies a given matcher. If a matching element is found,
    ``has_item`` is satisfied.

    If the ``match`` argument is not a matcher, it is implicitly wrapped in an
    :py:func:`~hamcrest.core.core.isequal.equal_to` matcher to check for
    equality.

    )r   r
   )r6   s    r   r,   r,   9   s      U 344r   itemsc                  X    g }| D ]  }|j                  t        |              t        | S )a  Matches if all of the given matchers are satisfied by any elements of
    the sequence.

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

    This matcher iterates the given matchers, searching for any elements in the
    evaluated sequence that satisfy them. If each matcher is satisfied, then
    ``has_items`` 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)   )r8   matchersr   s      r   	has_itemsr<   K   s4     H ,T*+,$h//r   N)typingr   r   r   r   hamcrest.core.base_matcherr   hamcrest.core.core.allofr   hamcrest.core.descriptionr	   "hamcrest.core.helpers.wrap_matcherr
   hamcrest.core.matcherr   
__author____copyright____license__r   r   r)   r,   r<   r'   r   r   <module>rF      s    1 1 2 + 1 ; )
-$CL
;x{3 
..HQK 8 .$5E'!*a-( 5WXa[-A 5$0eGAJM* 0wx{/C 0r   