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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
L\¬Qc @s¥dZddddddddd    d
d g Zd d lZd dlmZd dlmZed dƒZd„Z    dfd„ƒYZ
ddd„Z d„Z dfd„ƒYZ d d lZejdƒjd„Zdd„Zd„Zddddddd„Zd „Zddddddd!„Zeed"„Zeeed#„Zd$Zd%Zd&Zd'Zd
efd(„ƒYZ[d)„Z d*„Z!e"d+kr¡e!ƒnd S(,se
Module difflib -- helpers for computing deltas between objects.
 
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
    Use SequenceMatcher to return list of the best "good enough" matches.
 
Function context_diff(a, b):
    For two lists of strings, return a delta in context diff format.
 
Function ndiff(a, b):
    Return a delta: the difference between `a` and `b` (lists of strings).
 
Function restore(delta, which):
    Return one of the two sequences that generated an ndiff delta.
 
Function unified_diff(a, b):
    For two lists of strings, return a delta in unified diff format.
 
Class SequenceMatcher:
    A flexible class for comparing pairs of sequences of any type.
 
Class Differ:
    For producing human-readable deltas from sequences of lines of text.
 
Class HtmlDiff:
    For producing HTML side by side comparison with change highlights.
tget_close_matchestndifftrestoretSequenceMatchertDiffertIS_CHARACTER_JUNKt IS_LINE_JUNKt context_difft unified_difftHtmlDifftMatchiÿÿÿÿN(t
namedtuple(treducesa b sizecCs|rd||SdS(Ng@gð?((tmatchestlength((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_calculate_ratio)s cBs‰eZdZddded„Zd„Zd„Zd„Zd„Z    d„Z
d„Z d    „Z d
d „Z d „Zd „Zd„ZRS(s
    SequenceMatcher is a flexible class for comparing pairs of sequences of
    any type, so long as the sequence elements are hashable.  The basic
    algorithm predates, and is a little fancier than, an algorithm
    published in the late 1980's by Ratcliff and Obershelp under the
    hyperbolic name "gestalt pattern matching".  The basic idea is to find
    the longest contiguous matching subsequence that contains no "junk"
    elements (R-O doesn't address junk).  The same idea is then applied
    recursively to the pieces of the sequences to the left and to the right
    of the matching subsequence.  This does not yield minimal edit
    sequences, but does tend to yield matches that "look right" to people.
 
    SequenceMatcher tries to compute a "human-friendly diff" between two
    sequences.  Unlike e.g. UNIX(tm) diff, the fundamental notion is the
    longest *contiguous* & junk-free matching subsequence.  That's what
    catches peoples' eyes.  The Windows(tm) windiff has another interesting
    notion, pairing up elements that appear uniquely in each sequence.
    That, and the method here, appear to yield more intuitive difference
    reports than does diff.  This method appears to be the least vulnerable
    to synching up on blocks of "junk lines", though (like blank lines in
    ordinary text files, or maybe "<P>" lines in HTML files).  That may be
    because this is the only method of the 3 that has a *concept* of
    "junk" <wink>.
 
    Example, comparing two strings, and considering blanks to be "junk":
 
    >>> s = SequenceMatcher(lambda x: x == " ",
    ...                     "private Thread currentThread;",
    ...                     "private volatile Thread currentThread;")
    >>>
 
    .ratio() returns a float in [0, 1], measuring the "similarity" of the
    sequences.  As a rule of thumb, a .ratio() value over 0.6 means the
    sequences are close matches:
 
    >>> print round(s.ratio(), 3)
    0.866
    >>>
 
    If you're only interested in where the sequences match,
    .get_matching_blocks() is handy:
 
    >>> for block in s.get_matching_blocks():
    ...     print "a[%d] and b[%d] match for %d elements" % block
    a[0] and b[0] match for 8 elements
    a[8] and b[17] match for 21 elements
    a[29] and b[38] match for 0 elements
 
    Note that the last tuple returned by .get_matching_blocks() is always a
    dummy, (len(a), len(b), 0), and this is the only case in which the last
    tuple element (number of elements matched) is 0.
 
    If you want to know how to change the first sequence into the second,
    use .get_opcodes():
 
    >>> for opcode in s.get_opcodes():
    ...     print "%6s a[%d:%d] b[%d:%d]" % opcode
     equal a[0:8] b[0:8]
    insert a[8:8] b[8:17]
     equal a[8:29] b[17:38]
 
    See the Differ class for a fancy human-friendly file differencer, which
    uses SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.
 
    See also function get_close_matches() in this module, which shows how
    simple code building on SequenceMatcher can be used to do useful work.
 
    Timing:  Basic R-O is cubic time worst case and quadratic time expected
    case.  SequenceMatcher is quadratic time for the worst case and has
    expected-case behavior dependent in a complicated way on how many
    elements the sequences have in common; best case time is linear.
 
    Methods:
 
    __init__(isjunk=None, a='', b='')
        Construct a SequenceMatcher.
 
    set_seqs(a, b)
        Set the two sequences to be compared.
 
    set_seq1(a)
        Set the first sequence to be compared.
 
    set_seq2(b)
        Set the second sequence to be compared.
 
    find_longest_match(alo, ahi, blo, bhi)
        Find longest matching block in a[alo:ahi] and b[blo:bhi].
 
    get_matching_blocks()
        Return list of triples describing matching subsequences.
 
    get_opcodes()
        Return list of 5-tuples describing how to turn a into b.
 
    ratio()
        Return a measure of the sequences' similarity (float in [0,1]).
 
    quick_ratio()
        Return an upper bound on .ratio() relatively quickly.
 
    real_quick_ratio()
        Return an upper bound on ratio() very quickly.
    tcCs6||_d|_|_||_|j||ƒdS(s!Construct a SequenceMatcher.
 
        Optional arg isjunk is None (the default), or a one-argument
        function that takes a sequence element and returns true iff the
        element is junk.  None is equivalent to passing "lambda x: 0", i.e.
        no elements are considered to be junk.  For example, pass
            lambda x: x in " \t"
        if you're comparing lines as sequences of characters, and don't
        want to synch up on blanks or hard tabs.
 
        Optional arg a is the first of two sequences to be compared.  By
        default, an empty string.  The elements of a must be hashable.  See
        also .set_seqs() and .set_seq1().
 
        Optional arg b is the second of two sequences to be compared.  By
        default, an empty string.  The elements of b must be hashable. See
        also .set_seqs() and .set_seq2().
 
        Optional arg autojunk should be set to False to disable the
        "automatic junk heuristic" that treats popular elements as junk
        (see module documentation for more information).
        N(tisjunktNonetatbtautojunktset_seqs(tselfRRRR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt__init__šs@        cCs|j|ƒ|j|ƒdS(s›Set the two sequences to be compared.
 
        >>> s = SequenceMatcher()
        >>> s.set_seqs("abcd", "bcde")
        >>> s.ratio()
        0.75
        N(tset_seq1tset_seq2(RRR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRßs     cCs0||jkrdS||_d|_|_dS(sMSet the first sequence to be compared.
 
        The second sequence to be compared is not changed.
 
        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq1("bcde")
        >>> s.ratio()
        1.0
        >>>
 
        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.
 
        See also set_seqs() and set_seq2().
        N(RRtmatching_blockstopcodes(RR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRës    cCsC||jkrdS||_d|_|_d|_|jƒdS(sMSet the second sequence to be compared.
 
        The first sequence to be compared is not changed.
 
        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq2("abcd")
        >>> s.ratio()
        1.0
        >>>
 
        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.
 
        See also set_seqs() and set_seq1().
        N(RRRRt
fullbcountt_SequenceMatcher__chain_b(RR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRs         c CsP|j}i|_}x9t|ƒD]+\}}|j|gƒ}|j|ƒq#Wtƒ}|j}|r­x@t|jƒƒD])}||ƒr}|j    |ƒ||=q}q}Wntƒ}t
|ƒ}    |j r4|    dkr4|    dd}
xLt|j ƒƒD]5\}} t
| ƒ|
krø|j    |ƒ||=qøqøWn|j |_|j |_dS(NiÈidi(Rtb2jt    enumeratet
setdefaulttappendtsetRtlisttkeystaddtlenRtitemst __contains__tisbjunkt
isbpopular( RRRtitelttindicestjunkRtpopulartntntesttidxs((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt    __chain_b2s,                      cCsÀ|j|j|j|jf\}}}}||d}    }
} i} g} xÁt||ƒD]°}| j}i}x’|j||| ƒD]z}||kržq†n||kr®Pn||ddƒd}||<|| kr†||d||d|}    }
} q†q†W|} qZWxm|    |kr}|
|kr}|||
dƒ r}||    d||
dkr}|    d|
d| d}    }
} qWx_|    | |krß|
| |krß|||
| ƒ rß||    | ||
| krß| d7} qWxl|    |krN|
|krN|||
dƒrN||    d||
dkrN|    d|
d| d}    }
} qãWx^|    | |kr¯|
| |kr¯|||
| ƒr¯||    | ||
| kr¯| d} qRWt|    |
| ƒS(sòFind longest matching block in a[alo:ahi] and b[blo:bhi].
 
        If isjunk is not defined:
 
        Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
            alo <= i <= i+k <= ahi
            blo <= j <= j+k <= bhi
        and for all (i',j',k') meeting those conditions,
            k >= k'
            i <= i'
            and if i == i', j <= j'
 
        In other words, of all maximal matching blocks, return one that
        starts earliest in a, and of all those maximal matching blocks that
        start earliest in a, return the one that starts earliest in b.
 
        >>> s = SequenceMatcher(None, " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=0, b=4, size=5)
 
        If isjunk is defined, first the longest matching block is
        determined as above, but with the additional restriction that no
        junk element appears in the block.  Then that block is extended as
        far as possible by matching (only) junk elements on both sides.  So
        the resulting block never matches on junk except as identical junk
        happens to be adjacent to an "interesting" match.
 
        Here's the same example as before, but considering blanks to be
        junk.  That prevents " abcd" from matching the " abcd" at the tail
        end of the second sequence directly.  Instead only the "abcd" can
        match, and matches the leftmost "abcd" in the second sequence:
 
        >>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=1, b=0, size=4)
 
        If no blocks match, return (alo, blo, 0).
 
        >>> s = SequenceMatcher(None, "ab", "c")
        >>> s.find_longest_match(0, 2, 0, 1)
        Match(a=0, b=0, size=0)
        ii(RRRR*txrangetgetR
(RtalotahitblotbhiRRRR*tbestitbestjtbestsizetj2lentnothingR,tj2lengettnewj2lentjtk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pytfind_longest_match^sB8*       +
$#    $#cCs|jdk    r|jSt|jƒt|jƒ}}d|d|fg}g}xÕ|r'|jƒ\}}}}|j||||ƒ\}    }
} } | rS|j| ƒ||    krÝ||
krÝ|j||    ||
fƒn|    | |kr$|
| |kr$|j|    | ||
| |fƒq$qSqSW|jƒd} }}g}xw|D]o\}}}| ||kr‰|||kr‰||7}qM|r¨|j| ||fƒn|||} }}qMW|rß|j| ||fƒn|j||dfƒ||_t    t
j |jƒS(s Return list of triples describing matching subsequences.
 
        Each triple is of the form (i, j, n), and means that
        a[i:i+n] == b[j:j+n].  The triples are monotonically increasing in
        i and in j.  New in Python 2.5, it's also guaranteed that if
        (i, j, n) and (i', j', n') are adjacent triples in the list, and
        the second is not the last triple in the list, then i+n != i' or
        j+n != j'.  IOW, adjacent triples never describe adjacent equal
        blocks.
 
        The last triple is a dummy, (len(a), len(b), 0), and is the only
        triple with n==0.
 
        >>> s = SequenceMatcher(None, "abxcd", "abcd")
        >>> s.get_matching_blocks()
        [Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]
        iN( RRR'RRtpopRDR"tsorttmapR
t_make(RtlatlbtqueueRR7R8R9R:R,RBRCtxti1tj1tk1t non_adjacentti2tj2tk2((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pytget_matching_blocksÌs8    %  +
      cCs|jdk    r|jSd}}g|_}xÍ|jƒD]¿\}}}d}||krp||krpd}n*||kr…d}n||kršd}n|r¿|j|||||fƒn||||}}|r:|jd||||fƒq:q:W|S(sZReturn list of 5-tuples describing how to turn a into b.
 
        Each tuple is of the form (tag, i1, i2, j1, j2).  The first tuple
        has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the
        tuple preceding it, and likewise for j1 == the previous j2.
 
        The tags are strings, with these meanings:
 
        'replace':  a[i1:i2] should be replaced by b[j1:j2]
        'delete':   a[i1:i2] should be deleted.
                    Note that j1==j2 in this case.
        'insert':   b[j1:j2] should be inserted at a[i1:i1].
                    Note that i1==i2 in this case.
        'equal':    a[i1:i2] == b[j1:j2]
 
        >>> a = "qabxcd"
        >>> b = "abycdf"
        >>> s = SequenceMatcher(None, a, b)
        >>> for tag, i1, i2, j1, j2 in s.get_opcodes():
        ...    print ("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %
        ...           (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2]))
         delete a[0:1] (q) b[0:0] ()
          equal a[1:3] (ab) b[0:2] (ab)
        replace a[3:4] (x) b[2:3] (y)
          equal a[4:6] (cd) b[3:5] (cd)
         insert a[6:6] () b[5:6] (f)
        iRtreplacetdeletetinserttequalN(RRRTR"(RR,RBtanswertaitbjtsizettag((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt get_opcodess$
               #ic
csð|jƒ}|sdg}n|dddkr|d\}}}}}|t|||ƒ|t|||ƒ|f|d<n|dddkrä|d\}}}}}||t|||ƒ|t|||ƒf|d<n||}g}    xÀ|D]¸\}}}}}|dkr—|||kr—|    j||t|||ƒ|t|||ƒfƒ|    Vg}    t|||ƒt|||ƒ}}n|    j|||||fƒqûW|    rìt|    ƒdkoà|    dddk rì|    VndS(sÓ Isolate change clusters by eliminating ranges with no changes.
 
        Return a generator of groups with upto n lines of context.
        Each group is in the same format as returned by get_opcodes().
 
        >>> from pprint import pprint
        >>> a = map(str, range(1,40))
        >>> b = a[:]
        >>> b[8:8] = ['i']     # Make an insertion
        >>> b[20] += 'x'       # Make a replacement
        >>> b[23:28] = []      # Make a deletion
        >>> b[30] += 'y'       # Make another replacement
        >>> pprint(list(SequenceMatcher(None,a,b).get_grouped_opcodes()))
        [[('equal', 5, 8, 5, 8), ('insert', 8, 8, 8, 9), ('equal', 8, 11, 9, 12)],
         [('equal', 16, 19, 17, 20),
          ('replace', 19, 20, 20, 21),
          ('equal', 20, 22, 21, 23),
          ('delete', 22, 27, 23, 23),
          ('equal', 27, 30, 23, 26)],
         [('equal', 31, 34, 27, 30),
          ('replace', 34, 35, 30, 31),
          ('equal', 35, 38, 31, 34)]]
        RXiiiÿÿÿÿN(sequaliiii(R^tmaxtminR"R'(
RR1tcodesR]RMRQRNRRtnntgroup((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pytget_grouped_opcodesJs(  66
6* -cCs>td„|jƒdƒ}t|t|jƒt|jƒƒS(sÒReturn a measure of the sequences' similarity (float in [0,1]).
 
        Where T is the total number of elements in both sequences, and
        M is the number of matches, this is 2.0*M / T.
        Note that this is 1 if the sequences are identical, and 0 if
        they have nothing in common.
 
        .ratio() is expensive to compute if you haven't already computed
        .get_matching_blocks() or .get_opcodes(), in which case you may
        want to try .quick_ratio() or .real_quick_ratio() first to get an
        upper bound.
 
        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.quick_ratio()
        0.75
        >>> s.real_quick_ratio()
        1.0
        cSs ||dS(Niÿÿÿÿ((tsumttriple((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt<lambda>’si(R RTRR'RR(RR ((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pytratio|s    cCsõ|jdkrMi|_}x.|jD] }|j|dƒd||<q&Wn|j}i}|jd}}xc|jD]X}||ƒr•||}n|j|dƒ}|d||<|dkrv|d}qvqvWt|t|jƒt|jƒƒS(s©Return an upper bound on ratio() relatively quickly.
 
        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute.
        iiN(RRRR6R)RRR'(RRR-tavailtavailhasR tnumb((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt quick_ratio–s
 !       cCs9t|jƒt|jƒ}}tt||ƒ||ƒS(sÊReturn an upper bound on ratio() very quickly.
 
        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute than either .ratio() or .quick_ratio().
        (R'RRRR`(RRIRJ((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pytreal_quick_ratio³sN(t__name__t
__module__t__doc__RtTrueRRRRRRDRTR^RdRhRlRm(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyR.sjE            -    ,    n    G    7 2        ig333333ã?cCs|dks"td|fƒ‚nd|ko9dknsTtd|fƒ‚ng}tƒ}|j|ƒxm|D]e}|j|ƒ|jƒ|krw|jƒ|krw|jƒ|krw|j|jƒ|fƒqwqwWtj    ||ƒ}g|D]\}}|^qùS(sÇUse SequenceMatcher to return list of the best "good enough" matches.
 
    word is a sequence for which close matches are desired (typically a
    string).
 
    possibilities is a list of sequences against which to match word
    (typically a list of strings).
 
    Optional arg n (default 3) is the maximum number of close matches to
    return.  n must be > 0.
 
    Optional arg cutoff (default 0.6) is a float in [0, 1].  Possibilities
    that don't score at least that similar to word are ignored.
 
    The best (no more than n) matches among the possibilities are returned
    in a list, sorted by similarity score, most similar first.
 
    >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"])
    ['apple', 'ape']
    >>> import keyword as _keyword
    >>> get_close_matches("wheel", _keyword.kwlist)
    ['while']
    >>> get_close_matches("apple", _keyword.kwlist)
    []
    >>> get_close_matches("accept", _keyword.kwlist)
    ['except']
    isn must be > 0: %rggð?s cutoff must be in [0.0, 1.0]: %r(
t
ValueErrorRRRRmRlRhR"theapqtnlargest(twordt possibilitiesR1tcutofftresulttsRLtscore((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyR¿s         cCsDdt|ƒ}}x*||kr?|||kr?|d7}qW|S(s}
    Return number of `ch` characters at the start of `line`.
 
    Example:
 
    >>> _count_leading('   abc', ' ')
    3
    ii(R'(tlinetchR,R1((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_count_leadingïs
cBsSeZdZddd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
RS(    se
    Differ is a class for comparing sequences of lines of text, and
    producing human-readable differences or deltas.  Differ uses
    SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.
 
    Each line of a Differ delta begins with a two-letter code:
 
        '- '    line unique to sequence 1
        '+ '    line unique to sequence 2
        '  '    line common to both sequences
        '? '    line not present in either input sequence
 
    Lines beginning with '? ' attempt to guide the eye to intraline
    differences, and were not present in either input sequence.  These lines
    can be confusing if the sequences contain tab characters.
 
    Note that Differ makes no claim to produce a *minimal* diff.  To the
    contrary, minimal diffs are often counter-intuitive, because they synch
    up anywhere possible, sometimes accidental matches 100 pages apart.
    Restricting synch points to contiguous matches preserves some notion of
    locality, at the occasional cost of producing a longer diff.
 
    Example: Comparing two texts.
 
    First we set up the texts, sequences of individual single-line strings
    ending with newlines (such sequences can also be obtained from the
    `readlines()` method of file-like objects):
 
    >>> text1 = '''  1. Beautiful is better than ugly.
    ...   2. Explicit is better than implicit.
    ...   3. Simple is better than complex.
    ...   4. Complex is better than complicated.
    ... '''.splitlines(1)
    >>> len(text1)
    4
    >>> text1[0][-1]
    '\n'
    >>> text2 = '''  1. Beautiful is better than ugly.
    ...   3.   Simple is better than complex.
    ...   4. Complicated is better than complex.
    ...   5. Flat is better than nested.
    ... '''.splitlines(1)
 
    Next we instantiate a Differ object:
 
    >>> d = Differ()
 
    Note that when instantiating a Differ object we may pass functions to
    filter out line and character 'junk'.  See Differ.__init__ for details.
 
    Finally, we compare the two:
 
    >>> result = list(d.compare(text1, text2))
 
    'result' is a list of strings, so let's pretty-print it:
 
    >>> from pprint import pprint as _pprint
    >>> _pprint(result)
    ['    1. Beautiful is better than ugly.\n',
     '-   2. Explicit is better than implicit.\n',
     '-   3. Simple is better than complex.\n',
     '+   3.   Simple is better than complex.\n',
     '?     ++\n',
     '-   4. Complex is better than complicated.\n',
     '?            ^                     ---- ^\n',
     '+   4. Complicated is better than complex.\n',
     '?           ++++ ^                      ^\n',
     '+   5. Flat is better than nested.\n']
 
    As a single multi-line string it looks like this:
 
    >>> print ''.join(result),
        1. Beautiful is better than ugly.
    -   2. Explicit is better than implicit.
    -   3. Simple is better than complex.
    +   3.   Simple is better than complex.
    ?     ++
    -   4. Complex is better than complicated.
    ?            ^                     ---- ^
    +   4. Complicated is better than complex.
    ?           ++++ ^                      ^
    +   5. Flat is better than nested.
 
    Methods:
 
    __init__(linejunk=None, charjunk=None)
        Construct a text differencer, with optional filters.
 
    compare(a, b)
        Compare two sequences of lines; generate the resulting delta.
    cCs||_||_dS(sç
        Construct a text differencer, with optional filters.
 
        The two optional keyword parameters are for filter functions:
 
        - `linejunk`: A function that should accept a single string argument,
          and return true iff the string is junk. The module-level function
          `IS_LINE_JUNK` may be used to filter out lines without visible
          characters, except for at most one splat ('#').  It is recommended
          to leave linejunk None; as of Python 2.3, the underlying
          SequenceMatcher class has grown an adaptive notion of "noise" lines
          that's better than any static definition the author has ever been
          able to craft.
 
        - `charjunk`: A function that should accept a string of length 1. The
          module-level function `IS_CHARACTER_JUNK` may be used to filter out
          whitespace characters (a blank or tab; **note**: bad idea to include
          newline in this!).  Use of IS_CHARACTER_JUNK is recommended.
        N(tlinejunktcharjunk(RR~R((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyR\s    c cst|j||ƒ}xë|jƒD]Ý\}}}}}|dkrd|j||||||ƒ}    n…|dkr‹|jd|||ƒ}    n^|dkr²|jd|||ƒ}    n7|dkrÙ|jd|||ƒ}    ntd|f‚x|    D] }
|
VqðWq"Wd    S(
sØ
        Compare two sequences of lines; generate the resulting delta.
 
        Each sequence must contain individual single-line strings ending with
        newlines. Such sequences can be obtained from the `readlines()` method
        of file-like objects.  The delta generated also consists of newline-
        terminated strings, ready to be printed as-is via the writeline()
        method of a file-like object.
 
        Example:
 
        >>> print ''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(1),
        ...                                'ore\ntree\nemu\n'.splitlines(1))),
        - one
        ?  ^
        + ore
        ?  ^
        - two
        - three
        ?  -
        + tree
        + emu
        RURVt-RWt+RXt sunknown tag %rN(RR~R^t_fancy_replacet_dumpRr( RRRtcruncherR]R7R8R9R:tgR{((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pytcomparets" !    ccs1x*t||ƒD]}d|||fVqWdS(s4Generate comparison results for a same-tagged range.s%s %sN(R5(RR]RLtlothiR,((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyR„sc csÆ||kr||kst‚||||kre|jd|||ƒ}|jd|||ƒ}n0|jd|||ƒ}|jd|||ƒ}x*||fD]}    x|    D] }
|
Vq¯Wq¢WdS(NRR€(tAssertionErrorR„( RRR7R8RR9R:tfirsttsecondR†R{((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_plain_replace¢s ccs#d\}}t|jƒ}    d\}
} xàt||ƒD]Ï} || } |    j| ƒx¯t||ƒD]ž}||}|| kr¢|
dkrd|| }
} qdqdn|    j|ƒ|    jƒ|krd|    jƒ|krd|    jƒ|krd|    jƒ|| }}}qdqdWq7W||krk|
dkrTx+|j    ||||||ƒD] }|VqAWdS|
| d}}}nd}
x+|j
||||||ƒD] }|VqW||||}}|
dkràd}}|    j ||ƒxØ|    j ƒD]Ê\}}}}}||||}}|dkr<|d|7}|d|7}qç|dkrY|d    |7}qç|d
krv|d |7}qç|d kr¡|d |7}|d |7}qçt d|f‚qçWx1|j||||ƒD] }|VqÎWn    d|Vx3|j
||d|||d|ƒD] }|VqWdS(sD
        When replacing one block of lines with another, search the blocks
        for *similar* lines; the best-matching pair (if any) is used as a
        synch point, and intraline difference marking is done on the
        similar pair. Lots of work, but often worth it.
 
        Example:
 
        >>> d = Differ()
        >>> results = d._fancy_replace(['abcDefghiJkl\n'], 0, 1,
        ...                            ['abcdefGhijkl\n'], 0, 1)
        >>> print ''.join(results),
        - abcDefghiJkl
        ?    ^  ^  ^
        + abcdefGhijkl
        ?    ^  ^  ^
        g®Gáz®ç?gè?Ngð?RRUt^RVR€RWRRXR‚sunknown tag %rs  i(g®Gáz®ç?gè?(NN(RRRR5RRRmRlRhRt _fancy_helperRR^Rrt_qformat(RRR7R8RR9R:t
best_ratioRwR…teqiteqjRBR[R,RZtbest_itbest_jR{taelttbelttatagstbtagsR]tai1tai2tbj1tbj2RIRJ((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRƒ±s`  
 
   %  %    %     
"         -c    cs›g}||krZ||kr?|j||||||ƒ}q|jd|||ƒ}n'||kr|jd|||ƒ}nx|D] }|VqˆWdS(NR€R(RƒR„(    RRR7R8RR9R:R†R{((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRs  !  ccsÇtt|dƒt|dƒƒ}t|t|| dƒƒ}t|t|| dƒƒ}||jƒ}||jƒ}d|V|rždd||fVnd|V|rÃdd||fVndS(s¡
        Format "?" output and deal with leading tabs.
 
        Example:
 
        >>> d = Differ()
        >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
        ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
        >>> for line in results: print repr(line)
        ...
        '- \tabcDefghiJkl\n'
        '? \t ^ ^  ^\n'
        '+ \tabcdefGhijkl\n'
        '? \t ^ ^  ^\n'
        s    R‚s- s? %s%s
s+ N(R`R}trstrip(RtalinetblineR˜R™tcommon((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyR s        N( RnRoRpRRR‡R„RRƒRR(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRþs\    )            b     s    \s*#?\s*$cCs||ƒdk    S(sÜ
    Return 1 for ignorable line: iff `line` is blank or contains a single '#'.
 
    Examples:
 
    >>> IS_LINE_JUNK('\n')
    True
    >>> IS_LINE_JUNK('  #   \n')
    True
    >>> IS_LINE_JUNK('hello\n')
    False
    N(R(R{tpat((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRTss     cCs
||kS(sû
    Return 1 for ignorable character: iff `ch` is a space or tab.
 
    Examples:
 
    >>> IS_CHARACTER_JUNK(' ')
    True
    >>> IS_CHARACTER_JUNK('\t')
    True
    >>> IS_CHARACTER_JUNK('\n')
    False
    >>> IS_CHARACTER_JUNK('x')
    False
    ((R|tws((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRdscCsP|d}||}|dkr-dj|ƒS|s@|d8}ndj||ƒS(s Convert range to the "ed" formatis{}s{},{}(tformat(tstarttstopt    beginningR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_format_range_unified{s
 
   Rs
ccs§t}xštd||ƒj|ƒD]}}    |s•t}|rIdj|ƒnd}
|rddj|ƒnd} dj||
|ƒVdj|| |ƒVn|    d|    d} } t| d| dƒ}t| d    | d
ƒ}d j|||ƒVx°|    D]¨\}}}}}|d kr;x|||!D]}d |Vq"Wqón|dkrkx!|||!D]}d|VqUWn|dkróx!|||!D]}d|Vq…WqóqóWq"WdS(sª
    Compare two sequences of lines; generate the delta as a unified diff.
 
    Unified diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.
 
    By default, the diff control lines (those with ---, +++, or @@) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.
 
    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.
 
    The unidiff format normally has a header for filenames and modification
    times.  Any or all of these may be specified using strings for
    'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.
 
    Example:
 
    >>> for line in unified_diff('one two three four'.split(),
    ...             'zero one tree four'.split(), 'Original', 'Current',
    ...             '2005-01-26 23:30:50', '2010-04-02 10:20:52',
    ...             lineterm=''):
    ...     print line                  # doctest: +NORMALIZE_WHITESPACE
    --- Original        2005-01-26 23:30:50
    +++ Current         2010-04-02 10:20:52
    @@ -1,4 +1,4 @@
    +zero
     one
    -two
    -three
    +tree
     four
    s    {}Rs
--- {}{}{}s
+++ {}{}{}iiÿÿÿÿiiiis@@ -{} +{} @@{}RXR‚RURVR€RWRN(sreplacesdelete(sreplacesinsert(tFalseRRRdRqR¤R¨(RRtfromfilettofilet fromfiledatet
tofiledateR1tlinetermtstartedRctfromdatettodateR‹tlastt file1_ranget file2_rangeR]RMRQRNRRR{((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyR†s.)"    cCsX|d}||}|s'|d8}n|dkr@dj|ƒSdj|||dƒS(s Convert range to the "ed" formatis{}s{},{}(R¤(R¥R¦R§R((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_format_range_contextÎs
 
   c    cstddddddddƒ}t}    xØtd||ƒj|ƒD]»}
|    s¶t}    |rjd    j|ƒnd
} |r…d    j|ƒnd
} d j|| |ƒVd j|| |ƒVn|
d |
d} }d|Vt| d|dƒ}dj||ƒVtd„|
DƒƒrixT|
D]I\}}}}}|dkrx%|||!D]}|||VqHWqqWnt| d|dƒ}dj||ƒVtd„|
DƒƒrCxT|
D]I\}}}}}|dkr®x%|||!D]}|||VqÝWq®q®WqCqCWdS(sL
    Compare two sequences of lines; generate the delta as a context diff.
 
    Context diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.
 
    By default, the diff control lines (those with *** or ---) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.
 
    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.
 
    The context diff format normally has a header for filenames and
    modification times.  Any or all of these may be specified using
    strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.
    If not specified, the strings default to blanks.
 
    Example:
 
    >>> print ''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(1),
    ...       'zero\none\ntree\nfour\n'.splitlines(1), 'Original', 'Current')),
    *** Original
    --- Current
    ***************
    *** 1,4 ****
      one
    ! two
    ! three
      four
    --- 1,4 ----
    + zero
      one
    ! tree
      four
    RWs+ RVs- RUs! RXs  s    {}Rs
*** {}{}{}s
--- {}{}{}iiÿÿÿÿs***************iis *** {} ****{}css*|] \}}}}}|dkVqdS(RURVN(sreplacesdelete((t.0R]t_((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pys    <genexpr>siis --- {} ----{}css*|] \}}}}}|dkVqdS(RURWN(sreplacesinsert((R¶R]R·((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pys    <genexpr>sN(    tdictR©RRRdRqR¤Rµtany(RRRªR«R¬R­R1R®tprefixR¯RcR°R±R‹R²R³R]RMRQR·R{R´RNRR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRÚs2+!"      cCst||ƒj||ƒS(só
    Compare `a` and `b` (lists of strings); return a `Differ`-style delta.
 
    Optional keyword parameters `linejunk` and `charjunk` are for filter
    functions (or None):
 
    - linejunk: A function that should accept a single string argument, and
      return true iff the string is junk.  The default is None, and is
      recommended; as of Python 2.3, an adaptive notion of "noise" lines is
      used that does a good job on its own.
 
    - charjunk: A function that should accept a string of length 1. The
      default is module-level function IS_CHARACTER_JUNK, which filters out
      whitespace characters (a blank or tab; note: bad idea to include newline
      in this!).
 
    Tools/scripts/ndiff.py is a command-line front-end to this function.
 
    Example:
 
    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1),
    ...              'ore\ntree\nemu\n'.splitlines(1))
    >>> print ''.join(diff),
    - one
    ?  ^
    + ore
    ?  ^
    - two
    - three
    ?  -
    + tree
    + emu
    (RR‡(RRR~R((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyR$s"c#sÔddl}|jdƒ‰t||||ƒ‰ddg‡fd†‰‡‡fd†‰‡fd†}|ƒ}|dkr™xOtr•|jƒVqWn7|d7}d}x$trÏddg|}    }
t} xL| tkr|jƒ\} } } |    |}| | | f|
|<|    d7}    qÏW|    |kr5d    V|}n |    }d}    x1|rt|    |}|    d7}    |
|V|d8}qDW|d}xJ|rË|jƒ\} } } | r°|d}n
|d8}| | | fVq‚Wq¬WdS(
sàReturns generator yielding marked up from/to side by side differences.
 
    Arguments:
    fromlines -- list of text lines to compared to tolines
    tolines -- list of text lines to be compared to fromlines
    context -- number of context lines to display on each side of difference,
               if None, all from/to text lines will be generated.
    linejunk -- passed on to ndiff (see ndiff documentation)
    charjunk -- passed on to ndiff (see ndiff documentation)
 
    This function returns an interator which returns a tuple:
    (from line tuple, to line tuple, boolean flag)
 
    from/to line tuple -- (line num, line text)
        line num -- integer or None (to indicate a context separation)
        line text -- original line text with following markers inserted:
            '\0+' -- marks start of added text
            '\0-' -- marks start of deleted text
            '\0^' -- marks start of changed text
            '\1' -- marks end of added/deleted/changed text
 
    boolean flag -- None indicates context separation, True indicates
        either "from" or "to" line contains a change, otherwise False.
 
    This function/iterator was originally developed to generate side by side
    file difference for making HTML pages (see HtmlDiff class for example
    usage).
 
    Note, this function utilizes the ndiff function to generate the side by
    side difference markup.  Optional ndiff arguments may be passed to this
    function and they in turn will be passed to ndiff.
    iÿÿÿÿNs (\++|\-+|\^+)ic s)||cd7<|dkr7|||jdƒdfS|dkrç|jdƒ|jdƒ}}g}|d„}ˆj||ƒxS|ddd…D]>\}\}    }
|d|    !d|||    |
!d    ||
}q˜W|d}n4|jdƒd}|s    d
}nd||d    }|||fS( sReturns line of text with user's change markup and line formatting.
 
        lines -- list of lines from the ndiff generator to produce a line of
                 text from.  When producing the line of text to return, the
                 lines used are removed from this list.
        format_key -- '+' return first line in list with "add" markup around
                          the entire line.
                      '-' return first line in list with "delete" markup around
                          the entire line.
                      '?' return first line in list with add/delete/change
                          intraline markup (indices obtained from second line)
                      None return first line in list with no markup
        side -- indice into the num_lines list (0=from,1=to)
        num_lines -- from/to current line number.  This is NOT intended to be a
                     passed parameter.  It is present as a keyword argument to
                     maintain memory of the current line numbers between calls
                     of this function.
 
        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        iiit?cSs3|j|jdƒd|jƒgƒ|jdƒS(Nii(R"Rctspan(t match_objecttsub_info((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pytrecord_sub_info“s&NiÿÿÿÿtsR‚(RREtsub( tlinest
format_keytsidet    num_linesttexttmarkersR¾R¿tkeytbegintend(t    change_re(sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt
_make_liners    &0     c3swg}d\}}x^trrxNt|ƒdkrky|jˆjƒƒWqtk
rg|jdƒqXqWdjg|D]}|d^qyƒ}|jdƒrª|}nI|jdƒråˆ|ddƒˆ|ddƒtfVqn|jdƒr|d8}ˆ|d    dƒdtfVqnÕ|jdƒrZˆ|d    dƒd}}|dd}}n™|jd ƒr•ˆ|ddƒˆ|ddƒtfVqn^|jdƒrЈ|ddƒˆ|ddƒtfVqn#|jd    ƒr    |d8}ˆ|d    dƒdtfVqnê|jdƒrB|d7}dˆ|ddƒtfVqn±|jdƒr~dˆ|ddƒ}}|dd}}nu|jdƒr·|d7}dˆ|ddƒtfVqn<|jdƒróˆ|ddƒˆ|ddƒtfVqnx(|dkr|d7}ddtfVqöWx(|dkrH|d8}ddtfVq!W|jdƒrat‚q||tfVqWdS(s¡Yields from/to lines of text with a change indication.
 
        This function is an iterator.  It itself pulls lines from a
        differencing iterator, processes them and yields them.  When it can
        it yields both a "from" and a "to" line, otherwise it will yield one
        or the other.  In addition to yielding the lines of from/to text, a
        boolean flag is yielded to indicate if the text line(s) have
        differences in them.
 
        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        iitXRs-?+?R»is--++R€s--?+s--+s- s-+?s-?+s+--Rs+ s+-R‚s
N(ii(s--?+s--+s- (s+ s+-(Rs
(Rs
(    RqR'R"tnextt StopIterationtjoint
startswithRR©(RÂtnum_blanks_pendingtnum_blanks_to_yieldR{Ryt    from_linetto_line(RÌtdiff_lines_iterator(sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_line_iteratorªsl      &    &
&&
 
 
'
 
    c3s鈃}gg}}xÌträxt|ƒdksFt|ƒdkr¢|jƒ\}}}|dk    r}|j||fƒn|dk    r"|j||fƒq"q"W|jdƒ\}}|jdƒ\}}|||pÜ|fVqWdS(stYields from/to lines of text with a change indication.
 
        This function is an iterator.  It itself pulls lines from the line
        iterator.  Its difference from that iterator is that this function
        always yields a pair of from/to text lines (with the change
        indication).  If necessary it will collect single from/to lines
        until it has a matching pair from/to pair to yield.
 
        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        iN(RqR'RÎRR"RE(t line_iteratort    fromlinesttolinesRÔRÕt
found_difftfromDifftto_diff(R×(sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_line_pair_iterators         '  i(NNN(tretcompileRRRqRÎR©(RÙRÚtcontextR~RRßRÞtline_pair_iteratortlines_to_writetindext contextLinesRÛRÔRÕR,((R×RÌRËRÖsO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_mdiffHsJ" 8[         
    
         
 
    
     
sm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html>
 
<head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=ISO-8859-1" />
    <title></title>
    <style type="text/css">%(styles)s
    </style>
</head>
 
<body>
    %(table)s%(legend)s
</body>
 
</html>sH
        table.diff {font-family:Courier; border:medium;}
        .diff_header {background-color:#e0e0e0}
        td.diff_header {text-align:right}
        .diff_next {background-color:#c0c0c0}
        .diff_add {background-color:#aaffaa}
        .diff_chg {background-color:#ffff77}
        .diff_sub {background-color:#ffaaaa}sZ
    <table class="diff" id="difflib_chg_%(prefix)s_top"
           cellspacing="0" cellpadding="0" rules="groups" >
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        %(header_row)s
        <tbody>
%(data_rows)s        </tbody>
    </table>sõ
    <table class="diff" summary="Legends">
        <tr> <th colspan="2"> Legends </th> </tr>
        <tr> <td> <table border="" summary="Colors">
                      <tr><th> Colors </th> </tr>
                      <tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
                      <tr><td class="diff_chg">Changed</td> </tr>
                      <tr><td class="diff_sub">Deleted</td> </tr>
                  </table></td>
             <td> <table border="" summary="Links">
                      <tr><th colspan="2"> Links </th> </tr>
                      <tr><td>(f)irst change</td> </tr>
                      <tr><td>(n)ext change</td> </tr>
                      <tr><td>(t)op</td> </tr>
                  </table></td> </tr>
    </table>cBsªeZdZeZeZeZeZdZddde    d„Z
dde dd„Z d„Z d„Zd    „Zd
„Zd „Zd „Zd „Zdde dd„ZRS(s{For producing HTML side by side comparison with change highlights.
 
    This class can be used to create an HTML table (or a complete HTML file
    containing the table) showing a side by side, line by line comparison
    of text with inter-line and intra-line change highlights.  The table can
    be generated in either full or contextual difference mode.
 
    The following methods are provided for HTML generation:
 
    make_table -- generates HTML for a single side by side table
    make_file -- generates complete HTML file with a single side by side table
 
    See tools/scripts/diff.py for an example usage of this class.
    iicCs(||_||_||_||_dS(sÛHtmlDiff instance initializer
 
        Arguments:
        tabsize -- tab stop spacing, defaults to 8.
        wrapcolumn -- column number where lines are broken and wrapped,
            defaults to None where lines are not wrapped.
        linejunk,charjunk -- keyword arguments passed into ndiff() (used to by
            HtmlDiff() to generate the side by side HTML differences).  See
            ndiff() documentation for argument default values and descriptions.
        N(t_tabsizet _wrapcolumnt    _linejunkt    _charjunk(Rttabsizet
wrapcolumnR~R((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRžs            RicCsD|jtd|jd|jd|j||||d|d|ƒƒS(síReturns HTML file of side by side comparison with change highlights
 
        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        tstylestlegendttableRátnumlines(t_file_templateR¸t_stylest_legendt
make_table(RRÙRÚtfromdescttodescRáRð((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt    make_file¯s
         csW‡fd†}g|D]}||ƒ^q}g|D]}||ƒ^q5}||fS(sReturns from/to line lists with tabs expanded and newlines removed.
 
        Instead of tab characters being replaced by the number of spaces
        needed to fill in to the next tab stop, this function will fill
        the space with tab characters.  This is done so that the difference
        algorithms can identify changes in a file when tabs are replaced by
        spaces and vice versa.  At the end of the HTML generation, the tab
        characters will be replaced with a nonbreakable space.
        csO|jddƒ}|jˆjƒ}|jddƒ}|jddƒjdƒS(NR‚RÀs    s
(RUt
expandtabsRçRž(R{(R(sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt expand_tabsÑs((RRÙRÚRùR{((RsO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_tab_newline_replaceÇs
    c Csj|s|j||fƒdSt|ƒ}|j}||ks[||jdƒd|krr|j||fƒdSd}d}d}x„||kr
||kr
||dkrÐ|d7}||}|d7}q‡||dkró|d7}d}q‡|d7}|d7}q‡W|| }    ||}
|r@|    d}    d||
}
n|j||    fƒ|j|d|
ƒdS(    s¤Builds list of text lines by splitting text lines at wrap point
 
        This function will determine if the input text line needs to be
        wrapped (split) into separate lines.  If so, the first wrap point
        will be determined and the first line appended to the output
        text line list.  This function is used recursively to handle
        the second part of the split line to further split it.
        NRÀiiRist>(R"R'Rètcountt _split_line( Rt    data_listtline_numRÆR\R_R,R1tmarktline1tline2((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRýÞs8
     )
 
 
    
 
 
 
c csçxà|D]Ø\}}}|dkr6|||fVqn||\}}\}}gg}    }
|j|    ||ƒ|j|
||ƒxZ|    s‘|
rÞ|    r©|    jdƒ}nd}|
rÇ|
jdƒ}nd}|||fVq…WqWdS(s5Returns iterator that splits (wraps) mdiff text linesiRR‚N(RR‚(RR‚(RRýRE( Rtdiffstfromdatattodatatflagtfromlinetfromtextttolinettotexttfromlistttolist((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt _line_wrappers   cCs²ggg}}}xŽ|D]†\}}}y<|j|jd||Œƒ|j|jd||ŒƒWn+tk
r“|jdƒ|jdƒnX|j|ƒqW|||fS(s³Collects mdiff output into separate lists
 
        Before storing the mdiff from/to data into a list, it is converted
        into a single line of text with HTML markup.
        iiN(R"t _format_linet    TypeErrorR(RRR R tflaglistRRR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_collect_lines1s   cCs’y%d|}d|j||f}Wntk
r>d}nX|jddƒjddƒjdd    ƒ}|jd
d ƒjƒ}d |||fS( sReturns HTML markup of "from" / "to" text lines
 
        side -- 0 or 1 indicating "from" or "to" text
        flag -- indicates if difference on line
        linenum -- line number (used for line number column)
        text -- line text to be marked up
        s%ds
 id="%s%s"Rt&s&amp;Rûs&gt;t<s&lt;R‚s&nbsp;s<<td class="diff_header"%s>%s</td><td nowrap="nowrap">%s</td>(t_prefixRRURž(RRÄRtlinenumRÆtid((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRFs
 
*cCs<dtj}dtj}tjd7_||g|_dS(sCreate unique anchor prefixessfrom%d_sto%d_iN(R    t_default_prefixR(Rt
fromprefixttoprefix((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt _make_prefix]s  cCsZ|jd}dgt|ƒ}dgt|ƒ}dt}    }
d} x†t|ƒD]x\} } | rÅ|
sËt}
| } td| |gƒ} d||    f|| <|    d7}    d||    f|| <qËqSt}
qSW|stg}dg}dg}d} |rdg}|}qdg}}n|ds9d||d<nd    ||| <|||||fS(
sMakes list of "next" linksiRis id="difflib_chg_%s_%d"s"<a href="#difflib_chg_%s_%d">n</a>s2<td></td><td>&nbsp;No Differences Found&nbsp;</td>s(<td></td><td>&nbsp;Empty File&nbsp;</td>s!<a href="#difflib_chg_%s_0">f</a>s#<a href="#difflib_chg_%s_top">t</a>(RR'R©R RqR_(RR R RRáRðRtnext_idt    next_hreftnum_chgt    in_changeR²R,R((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_convert_flagshs:  
 
                    
c
Csí|jƒ|j||ƒ\}}|r1|}nd}t|||d|jd|jƒ}|jrv|j|ƒ}n|j|ƒ\}    }
} |j    |    |
| ||ƒ\}    }
} } } g}dd}x}t
t | ƒƒD]i}| |dkr|dkrD|j dƒqDqÛ|j || || ||    || ||
|fƒqÛW|sT|ruddd    |dd    |f}nd
}|j td d
j|ƒd |d |jdƒ}|jddƒjddƒjddƒjddƒjddƒS(sîReturns HTML table of side by side comparison with change highlights
 
        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        R~Rs1            <tr><td class="diff_next"%s>%s</td>%ss%<td class="diff_next">%s</td>%s</tr>
is)        </tbody>        
        <tbody>
s <thead><tr>%s%s%s%s</tr></thead>s!<th class="diff_next"><br /></th>s+<th colspan="2" class="diff_header">%s</th>Rt    data_rowst
header_rowRºit+s<span class="diff_add">t-s<span class="diff_sub">t^s<span class="diff_chg">ss</span>s    s&nbsp;N(RRúRRæRéRêRèR RRtrangeR'R"t_table_templateR¸RÐRRU(RRÙRÚRõRöRáRðt context_linesRR R RRRRytfmtR,R!Rï((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRô—sJ
         $      N(RnRoRpRñRòR&RóRRRRR©R÷RúRýR RRRRRô(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyR    ˆs&                  7                    /    ccs€y"idd6dd6t|ƒ}Wntk
rBtd|‚nXd|f}x*|D]"}|d |krV|dVqVqVWdS(s
    Generate one of the two sequences that generated a delta.
 
    Given a `delta` produced by `Differ.compare()` or `ndiff()`, extract
    lines originating from file 1 or 2 (parameter `which`), stripping off line
    prefixes.
 
    Examples:
 
    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(1),
    ...              'ore\ntree\nemu\n'.splitlines(1))
    >>> diff = list(diff)
    >>> print ''.join(restore(diff, 1)),
    one
    two
    three
    >>> print ''.join(restore(diff, 2)),
    ore
    tree
    emu
    s- is+ is)unknown delta choice (must be 1 or 2): %rs  N(tinttKeyErrorRr(tdeltatwhichR]tprefixesR{((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyRæs"    cCs%ddl}ddl}|j|ƒS(Niÿÿÿÿ(tdoctesttdifflibttestmod(R.R/((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt_testst__main__(#Rpt__all__Rst collectionsR t _namedtuplet    functoolsR R
RRRR}RRßRàtmatchRRR¨RRµRRRRæRñRòR&RótobjectR    RR1Rn(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/difflib.pyt<module>sN       ÿÿ“0    ÿU          G     I$ ÿ    
ÿ]