eddlmZmZmZmZmZmZddlmZddl m Z ddl m Z ddl mZdZdZdZed ZGd d eZGd d eeeZdeeeefdeeefdZy))MutableSequenceOptionalSequenceTypeVarUnioncast) BaseMatcher) Description) wrap_matcher)MatcherzJon ReidzCopyright 2011 hamcrest.orgzBSD, see License.txtTcxeZdZdeeedeeddfdZdede fdZ deede fdZ dede fd Z dede fd Z y) MatchInAnyOrdermatchersmismatch_descriptionreturnNc^tttt|dd|_||_yN)rrr r rr)selfrrs ]/usr/lib/python3/dist-packages/hamcrest/library/collection/issequence_containinginanyorder.py__init__zMatchInAnyOrder.__init__s'_WQZ8(1+F $8!itemcJ|j|xr|j|Sr) isnotsurplus ismatchedrrs rmatcheszMatchInAnyOrder.matchess!  &?4>>$+??rc|jsy|jrX|jjdjddd|jjdjddd|y) NTzno item matches: , z in []F)rr append_text append_listrs r isfinishedzMatchInAnyOrder.isfinisheds^}}  $ $  % % 1 12E F R RD"dmm k&!++c4d"Crc|js7|jr*|jjdj|yy)N not matched: FT)rrr$append_description_ofrs rrzMatchInAnyOrder.isnotsurplus"s8}}(())55oF\\]abrct|jD]%\}}|j|s|j|=y|jr*|jj dj |y)NTr(F) enumeraterrrr$r))rrindexmatchers rrzMatchInAnyOrder.ismatched)sg' 6 NE7t$MM%(   $ $  % % 1 1/ B X XY] ^r)__name__ __module__ __qualname__rr r rr rboolrr&rrrrrrs9 ,9DL[DY9 9 @A@$@x{ttaDrrceZdZdeeeddfdZ d deedeede ffd Z deededdfdZ d eddfd Z xZ S) IsSequenceContainingInAnyOrderrrNc||_yr)r)rrs rrz'IsSequenceContainingInAnyOrder.__init__5s   rrrc t|}t|j|}|D]}|j|ry|j |S#t $r|rt t|#||YywxYw)NF) listrrrr& TypeErrorsuperr4describe_mismatch)rrrsequence matchsequenceelement __class__s rrz&IsSequenceContainingInAnyOrder.matches8s DzH+DMM;OPM# !$,,W5  !!++H5 5 #4dM.  s7AAAA10A1c(|j||yr)r)rrrs rr:z0IsSequenceContainingInAnyOrder.describe_mismatchIs T/0r descriptionc||jdjddd|jjdy)Nza sequence over r"r!r#z in any order)r$r%r)rr@s r describe_toz*IsSequenceContainingInAnyOrder.describe_toLs3 23?? sDMM +o &rr)r.r/r0rr r rrr r1rr:rB __classcell__)r>s@rr4r44s~!'!*!5!$!PTQK7? 7L "1hqk11Y]1'{'t'rr4itemsrc^g}|D]}|jt|t|S)aMatches 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 r4)rDrrs rcontains_inanyorderrGRs4$H, T*+, )( 33rN)typingrrrrrrhamcrest.core.base_matcherr hamcrest.core.descriptionr "hamcrest.core.helpers.wrap_matcherr hamcrest.core.matcherr __author__ __copyright__ __license__r objectrr4rGr2rrrQszLL21;)  - $  CL"f"J'[!%='<4gaj!m 44!9M4r