tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
]\¬Qc@s€dZddlmZmZeZdZed„Zd„Z    d„Z
ed„Z edd    ƒZ d
„Z d „Zd „Zd S(sVarious utility functions.iÿÿÿÿ(t
namedtuplet OrderedDictiPcCs\yt|ƒ}Wn tk
r2tj|ƒ}nX| sLt|ƒtkrP|S|t dS(Ns [truncated]...(treprt    Exceptiontobjectt__repr__tlent _MAX_LENGTH(tobjtshorttresult((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/unittest/util.pyt    safe_reprs cCsd|j|jfS(Ns%s.%s(t
__module__t__name__(tcls((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/unittest/util.pytstrclassscCshd}}g}g}xEtr]y||}||}||kr}|j|ƒ|d7}xÆ|||kry|d7}q\Wn¥||krÄ|j|ƒ|d7}x|||krÀ|d7}q£Wn^|d7}z%x|||krñ|d7}qÔWWd|d7}x|||kr |d7}qWXWqtk
rY|j||ƒ|j||ƒPqXqW||fS(srFinds elements in only one or the other of two, sorted input lists.
 
    Returns a two-element tuple of lists.    The first list contains those
    elements in the "expected" list but not in the "actual" list, and the
    second contains those elements in the "actual" list but not in the
    "expected" list.    Duplicate elements in either input list are ignored.
    iiN(tTruetappendt
IndexErrortextend(texpectedtactualtitjtmissingt
unexpectedteta((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/unittest/util.pytsorted_list_differences:
    
 
 
 
 
 
     cCsg}g}xš|r¨|jƒ}y|j|ƒWntk
rR|j|ƒnX|rxI||fD]8}yxtrˆ|j|ƒqrWWqftk
rqfXqfWqqW|rxU|r|jƒ}|j|ƒyxtrí|j|ƒq×WWq²tk
rq²Xq²W||fS||fS(s²Same behavior as sorted_list_difference but
    for lists of unorderable items (like dicts).
 
    As it does a linear search per item (remove) it
    has O(n*n) performance.
    (tpoptremovet
ValueErrorRR(RRtignore_duplicateRRtitemtlst((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/unittest/util.pytunorderable_list_difference>s4                      
tMismatchsactual expected valuecCsÂt|ƒt|ƒ}}t|ƒt|ƒ}}tƒ}g}xåt|ƒD]×\}}    |    |krlqNnd}
} x>t||ƒD]-} || |    kr†|
d7}
||| <q†q†Wx=t|ƒD]/\} } | |    krÄ| d7} ||| <qÄqÄW|
| krNt|
| |    ƒ}|j|ƒqNqNWx’t|ƒD]„\}}    |    |krTq6nd} x>t||ƒD]-} || |    krj| d7} ||| <qjqjWtd| |    ƒ}|j|ƒq6W|S(sHReturns list of (cnt_act, cnt_exp, elem) triples where the counts differii(tlistRRt    enumeratetranget    _MismatchR(RRtstttmtntNULLR
Rtelemtcnt_stcnt_tRt
other_elemtdiff((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/unittest/util.pyt_count_diff_all_purposeds<     
 
 
 
cCs8tƒ}x(|D] }|j|dƒd||<qW|S(s@Return dict of element counts, in the order they were first seenii(Rtget(titerabletcR.((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/unittest/util.pyt_ordered_count‡s     c    CsËt|ƒt|ƒ}}g}xZ|jƒD]L\}}|j|dƒ}||kr,t|||ƒ}|j|ƒq,q,WxH|jƒD]:\}}||kr‰td||ƒ}|j|ƒq‰q‰W|S(sHReturns list of (cnt_act, cnt_exp, elem) triples where the counts differi(R7titemsR4R(R(    RRR)R*R
R.R/R0R2((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/unittest/util.pyt_count_diff_hashableŽs  N(t__doc__t collectionsRRRt
__unittestRtFalseR RRR#R(R3R7R9(((sU/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/unittest/util.pyt<module>s
       ) $    #