e` ddlmZmZmZmZddlmZddlmZddl m Z ddl m Z ddl mZdZdZd Zed ZGd d eeeZGd deeeZdeeeefdeeefdZdeeeefdeeefdZy))SequenceTypeVarUnioncast) BaseMatcher)all_of) Description) wrap_matcher)MatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtTcHeZdZdeeddfdZdeedefdZde ddfdZ y) IsSequenceContainingelement_matcherreturnNc||_yN)r)selfrs S/usr/lib/python3/dist-packages/hamcrest/library/collection/issequence_containing.py__init__zIsSequenceContaining.__init__s .itemcn |D]}|jj|sy y#t$rYywxYw)NTF)rmatches TypeError)rrelements r_matcheszIsSequenceContaining._matchessI  ''//8    s ((( 44 descriptioncX|jdj|jy)Nza sequence containing ) append_textappend_description_ofrrrs r describe_toz IsSequenceContaining.describe_tos% 89OO   r) __name__ __module__ __qualname__r r rrboolrr r"rrrrsC/ /t/Xa[T { t rrcbeZdZdeeddfdZdeedefdZdeede ddfdZ d e ddfd Z y) IsSequenceContainingEveryelement_matchersrNc |Dcgc])}ttttt |+}}t ||_ycc}wr)rr rr has_itemrmatcher)rr*e delegatess rrz"IsSequenceContainingEvery.__init__(s;FVWT'(1+. <W W-3Y-? Xs.Arcj |jjt|S#t$rYywxYw)NF)r-rlistr)rrs rrz"IsSequenceContainingEvery._matches,s2 <<''T 3 3  s #& 22mismatch_descriptionc<|jj||yr)r-describe_mismatch)rrr2s rr4z+IsSequenceContainingEvery.describe_mismatch2s &&t-ABrrc:|jj|yr)r-r"r!s rr"z%IsSequenceContainingEvery.describe_to5s   -r) r#r$r%r r rrr&rr r4r"r'rrr)r)'si@'!*@@Xa[T ChqkCCY]C.{.t.rr)matchrc*tt|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. )rr )r6s rr,r,9s U 3 44ritemscXg}|D]}|jt|t|S)aMatches 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))r8matchersrs r has_itemsr<Ks4H, T*+, $h //rN)typingrrrrhamcrest.core.base_matcherrhamcrest.core.core.allofrhamcrest.core.descriptionr "hamcrest.core.helpers.wrap_matcherr hamcrest.core.matcherr __author__ __copyright__ __license__r rr)r,r<r'rrrFs112+1;)  - $  CL ;x{3 .. HQK 8.$5E'!*a-(5WXa[-A5$0eGAJM*0wx{/C0r