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
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
L\¬Qc!@södZdZdddddddd    d
d d d ddddddddddddddddddd d!d"g!Zd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$l    Z    d#d$l
Z
d#d$l Z d#d$l Z d#d$l Z d#d$lZd#d%lmZd#d&lmZed'd(ƒZiZd)„ZedƒZedƒZedƒZedƒZedƒZedƒZeeBeBeBeBeBZed
ƒZed ƒZed ƒZed ƒZeeBeBeBZ d*Z!d+Z"d,„Z#d-d.„Z$d/„Z%e&ej'd0e(ƒp)d1Z)d2d3„Z*d4„Z+d5efd6„ƒYZ,d7„Z-d8„Z.d9e j/fd:„ƒYZ0d;„Z1dfd<„ƒYZ2dfd=„ƒYZ3dfd>„ƒYZ4dfd?„ƒYZ5dfd@„ƒYZ6dfdA„ƒYZ7de8fdB„ƒYZ9de8fdC„ƒYZ:de6fdD„ƒYZ;e(a<e(e(e(e(e=dEe(e>e>dF„    Z?e=e(e(e(e(e=dEe(e>e4ƒe(dG„ Z@e>dHe(dEdI„ZAdfdJ„ƒYZBdEaCdK„ZDdLe
jEfdM„ƒYZFdNeFfdO„ƒYZGe(e(e(e(dP„ZHdQeFfdR„ƒYZIe=e(e(e4ƒe(dS„ZJdT„ZKdU„ZLdV„ZMe>e(dW„ZNe>e(dX„ZOe>dY„ZPdZfd[„ƒYZQieQdZ6d\d]6d^d_6d`da6dbdc6ddde6ZRdf„ZSeTdgkròejUeSƒƒnd$S(hsÅModule doctest -- a framework for running examples in docstrings.
 
In simplest use, end each module M to be tested with:
 
def _test():
    import doctest
    doctest.testmod()
 
if __name__ == "__main__":
    _test()
 
Then running the module as a script will cause the examples in the
docstrings to get executed and verified:
 
python M.py
 
This won't display anything unless an example fails, in which case the
failing example(s) and the cause(s) of the failure(s) are printed to stdout
(why not stderr? because stderr is a lame hack <0.2 wink>), and the final
line of output is "Test failed.".
 
Run it with the -v switch instead:
 
python M.py -v
 
and a detailed report of all examples tried is printed to stdout, along
with assorted summaries at the end.
 
You can force verbose mode by passing "verbose=True" to testmod, or prohibit
it by passing "verbose=False".  In either of those cases, sys.argv is not
examined by testmod.
 
There are a variety of other ways to run doctests, including integration
with the unittest framework, and support for running non-Python text
files containing doctests.  There are also many ways to override parts
of doctest's default behaviors.  See the Library Reference Manual for
details.
sreStructuredText entregister_optionflagtDONT_ACCEPT_TRUE_FOR_1tDONT_ACCEPT_BLANKLINEtNORMALIZE_WHITESPACEtELLIPSIStSKIPtIGNORE_EXCEPTION_DETAILtCOMPARISON_FLAGSt REPORT_UDIFFt REPORT_CDIFFt REPORT_NDIFFtREPORT_ONLY_FIRST_FAILUREtREPORTING_FLAGStExampletDocTestt DocTestParsert DocTestFindert DocTestRunnert OutputCheckertDocTestFailuretUnexpectedExceptiont DebugRunnerttestmodttestfiletrun_docstring_examplestTestert DocTestSuitet DocFileSuitetset_unittest_reportflagstscript_from_examplest
testsourcet    debug_srctdebugiÿÿÿÿN(tStringIO(t
namedtuplet TestResultssfailed attemptedcCstj|dttƒ>ƒS(Ni(tOPTIONFLAGS_BY_NAMEt
setdefaulttlen(tname((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR€ss <BLANKLINE>s...cCsUd}xHtjD]=}|j|dƒ}|tt|ƒkr||jO}qqW|S(s…
    Return the compiler-flags associated with the future features that
    have been imported into the given namespace (globs).
    iN(t
__future__tall_feature_namestgettNonetgetattrt compiler_flag(tglobstflagstfnametfeature((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt_extract_future_flags²s icCs{tj|ƒr|St|ttfƒrDt|tƒtƒdgƒS|dkrkt    j
t    j |ƒj dSt dƒ‚dS(s‡
    Return the module specified by `module`.  In particular:
      - If `module` is a module, then return module.
      - If `module` is a string, then import and return the
        module with that name.
      - If `module` is None, then return the calling module.
        The calling module is assumed to be the module of
        the stack frame at the given depth in the call stack.
    t*t__name__s"Expected a module, string, or NoneN(tinspecttismodulet
isinstancetstrtunicodet
__import__tglobalstlocalsR+tsystmodulest    _getframet    f_globalst    TypeError(tmoduletdepth((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt_normalize_module¾s
 cCsŸ|rvt|dƒ}t||ƒ}t|dƒrvt|jdƒrs|jj|ƒ}|jtjdƒ|fSqvnt|ƒ}|j    ƒ|fSWdQXdS(Nit
__loader__tget_datas
(
RDt_module_relative_paththasattrRERFtreplacetostlineseptopentread(tfilenametpackagetmodule_relativet file_contentstf((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt_load_testfileÑstencodingsutf-8icCs;t|tƒr$|jtdƒ}ntjd|d|ƒS(sö
    Add the given number of space characters to the beginning of
    every non-blank line in `s`, and return the result.
    If the string `s` is Unicode, it is encoded using the stdout
    encoding and the `backslashreplace` error handler.
    tbackslashreplaces
(?m)^(?!$)t (R7R9tencodet    _encodingtretsub(tstindent((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt_indentáscCs;tƒ}|\}}}tj|||d|ƒ|jƒS(sz
    Return a string containing a traceback message for the given
    exc_info tuple (as returned by sys.exc_info()).
    tfile(R!t    tracebacktprint_exceptiontgetvalue(texc_infotexcouttexc_typetexc_valtexc_tb((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt_exception_tracebackís    t    _SpoofOutcBseZd„Zdd„ZRS(cCsNtj|ƒ}|r2|jdƒ r2|d7}nt|dƒrJ|`n|S(Ns
t    softspace(R!RatendswithRHRi(tselftresult((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRaús      cCsAtj||ƒt|dƒr(|`n|js=d|_ndS(NRit(R!ttruncateRHRitbuf(Rktsize((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRns
        N(R4t
__module__RaR+Rn(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRhùs     cCs&t|kr||kS|jtƒ}t|ƒdks=t‚dt|ƒ}}|d}|rŒ|j|ƒr…t|ƒ}|d=qŒtSn|d}|rÌ|j|ƒrÅ|t|ƒ8}|d=qÌtSn||krÜtSxC|D];}|j|||ƒ}|dkrtS|t|ƒ7}qãWtS(s_
    Essentially the only subtle case:
    >>> _ellipsis_match('aa...aa', 'aaa')
    False
    iiiÿÿÿÿ(    tELLIPSIS_MARKERtsplitR&tAssertionErrort
startswithtFalseRjtfindtTrue(twanttgottwststartpostendpostw((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt_ellipsis_matchs2 
 
 
 
 
   cCs"|jƒ}|rd|SdSdS(s)Return a commented form of the given lines# t#N(trstrip(tline((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt _comment_lineAs t_OutputRedirectingPdbcBs5eZdZd„Zdd„Zd„Zd„ZRS(sÀ
    A specialized version of the python debugger that redirects stdout
    to a given stream when interacting with the user.  Stdout is *not*
    redirected when traced code is executed.
    cCs5||_t|_tjj|d|ƒd|_dS(Ntstdouti(t_OutputRedirectingPdb__outRvt$_OutputRedirectingPdb__debugger_usedtpdbtPdbt__init__t use_rawinput(Rktout((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠOs        cCs>t|_|dkr'tjƒj}ntjj||ƒdS(N(    RxR‡R+R=R?tf_backRˆR‰t    set_trace(Rktframe((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŽVs     cCs |jrtjj|ƒndS(N(R‡RˆR‰t set_continue(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR\s    cGs=tj}|jt_ztjj||ŒSWd|t_XdS(N(R=R…R†RˆR‰ttrace_dispatch(Rktargst save_stdout((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR‘bs
     N(R4Rqt__doc__RŠR+RŽRR‘(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR„Is
         cCsøtj|ƒstd|‚n|jdƒr:td‚nt|dƒretjj|j    ƒd}nw|j
dkrÈt t j ƒdkr¼t j ddkr¼tjjt j dƒd}qÜtj}ntd|d    ƒ‚tjj||jdƒŒS(
NsExpected a module: %rt/s1Module-relative files may not have absolute pathst__file__it__main__Rms+Can't resolve paths relative to the module s (it has no __file__)(R5R6RARut
ValueErrorRHRJtpathRsR–R4R&R=targvtcurdirtjoin(RBR™tbasedir((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRGms (  cBs>eZdZddddd„Zd„Zd„Zd„ZRS(sn
    A single doctest example, consisting of source code and expected
    output.  `Example` defines the following attributes:
 
      - source: A single Python statement, always ending with a newline.
        The constructor adds a newline if needed.
 
      - want: The expected output from running the source code (either
        from stdout, or a traceback in case of exception).  `want` ends
        with a newline unless it's empty, in which case it's an empty
        string.  The constructor adds a newline if needed.
 
      - exc_msg: The exception message generated by the example, if
        the example is expected to generate an exception; or `None` if
        it is not expected to generate an exception.  This exception
        message is compared against the return value of
        `traceback.format_exception_only()`.  `exc_msg` ends with a
        newline unless it's `None`.  The constructor adds a newline
        if needed.
 
      - lineno: The line number within the DocTest string containing
        this Example where the Example begins.  This line number is
        zero-based, with respect to the beginning of the DocTest.
 
      - indent: The example's indentation in the DocTest string.
        I.e., the number of space characters that preceed the
        example's first prompt.
 
      - options: A dictionary mapping from option flags to True or
        False, which is used to override default options for this
        example.  Any option flags not contained in this dictionary
        are left at their default value (as specified by the
        DocTestRunner's optionflags).  By default, no options are set.
    icCs·|jdƒs|d7}n|r?|jdƒ r?|d7}n|dk    rh|jdƒ rh|d7}n||_||_||_||_|dkr¡i}n||_||_dS(Ns
(RjR+tsourceRytlinenoR\toptionstexc_msg(RkRžRyR¡RŸR\R ((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠ´s                           cCs†t|ƒt|ƒk    rtS|j|jko…|j|jko…|j|jko…|j|jko…|j|jko…|j|jkS(N(ttypetNotImplementedRžRyRŸR\R R¡(Rktother((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt__eq__ÆscCs ||k S(N((RkR¤((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt__ne__ÑscCs(t|j|j|j|j|jfƒS(N(thashRžRyRŸR\R¡(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt__hash__ÔsN(R4RqR”R+RŠR¥R¦R¨(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR ‘s "             cBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(se
    A collection of doctest examples that should be run in a single
    namespace.  Each `DocTest` defines the following attributes:
 
      - examples: the list of examples.
 
      - globs: The namespace (aka globals) that the examples should
        be run in.
 
      - name: A name identifying the DocTest (typically, the name of
        the object whose docstring this DocTest was extracted from).
 
      - filename: The name of the file that this DocTest was extracted
        from, or `None` if the filename is unknown.
 
      - lineno: The line number within filename where this DocTest
        begins, or `None` if the line number is unavailable.  This
        line number is zero-based, with respect to the beginning of
        the file.
 
      - docstring: The string that the examples were extracted from,
        or `None` if the string is unavailable.
    cCs\t|tƒ stdƒ‚||_||_|jƒ|_||_||_||_    dS(sŒ
        Create a new DocTest containing the given examples.  The
        DocTest's globals are initialized with a copy of `globs`.
        s8DocTest no longer accepts str; use DocTestParser insteadN(
R7t
basestringRttexamplest    docstringtcopyR.R'RNRŸ(RkRªR.R'RNRŸR«((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠñs                    cCslt|jƒdkrd}n1t|jƒdkr<d}ndt|jƒ}d|j|j|j|fS(Nis no examplesis    1 examples %d exampless<DocTest %s from %s:%s (%s)>(R&RªR'RNRŸ(RkRª((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt__repr__ÿs        cCs†t|ƒt|ƒk    rtS|j|jko…|j|jko…|j|jko…|j|jko…|j|jko…|j|jkS(N(R¢R£RªR«R.R'RNRŸ(RkR¤((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¥    scCs ||k S(N((RkR¤((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¦scCs"t|j|j|j|jfƒS(N(R§R«R'RNRŸ(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¨scCsVt|tƒsdSt|j|j|jt|ƒf|j|j|jt|ƒfƒS(Niÿÿÿÿ(R7RtcmpR'RNRŸtid(RkR¤((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt__cmp__s!(    R4RqR”RŠR­R¥R¦R¨R°(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRÙs        
           cBs×eZdZejdejejBƒZejdejejBejBƒZ    ejdƒj
Z dd„Z d„Z dd„Zd„Zejd    ejƒZd
„Zejd ejƒZd „Zd „Zd„ZRS(sD
    A class used to parse strings containing doctest examples.
    sú
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .*$\n?       # But any other line
                  )*)
        sß
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        s ^[ ]*(#.*)?$s<string>c Csx|jƒ}|j|ƒ}|dkrYdjg|jdƒD]}||^q=ƒ}ng}d\}}xõ|jj|ƒD]á}|j|||jƒ!ƒ||jd||jƒƒ7}|j    |||ƒ\}    }
} } |j
|    ƒs.|jt |    | | d|d|t |j dƒƒd|
ƒƒn||jd|jƒ|jƒƒ7}|jƒ}q~W|j||ƒ|S(s=
        Divide the given string into examples and intervening text,
        and return them as a list of alternating Examples and strings.
        Line numbers for the Examples are 0-based.  The optional
        argument `name` is a name identifying this string, and is only
        used for error messages.
        is
RŸR\R (ii(t
expandtabst _min_indentRœRst _EXAMPLE_REtfinditertappendtstarttcountt_parse_examplet_IS_BLANK_OR_COMMENTR R&tgrouptend( RktstringR't
min_indenttltoutputtcharnoRŸtmRžR RyR¡((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytparseUs&  2 ! %cCs%t|j||ƒ|||||ƒS(s"
        Extract all doctest examples from the given string, and
        collect them into a `DocTest` object.
 
        `globs`, `name`, `filename`, and `lineno` are attributes for
        the new `DocTest` object.  See the documentation for `DocTest`
        for more information.
        (Rt get_examples(RkR¼R.R'RNRŸ((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt get_doctest|s    cCs2g|j||ƒD]}t|tƒr|^qS(sÑ
        Extract all doctest examples from the given string, and return
        them as a list of `Example` objects.  Line numbers are
        0-based, because it's most common in doctests that nothing
        interesting appears on the same line as opening triple-quote,
        and so the first interesting line is called "line 1" then.
 
        The optional argument `name` is a name identifying this
        string, and is only used for error messages.
        (RÂR7R (RkR¼R'tx((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRÈs c Cs~t|jdƒƒ}|jdƒjdƒ}|j||||ƒ|j|dd|d||ƒdjg|D]}||d^qrƒ}|jdƒ}|jdƒ}    t|    ƒdkrßtjd    |    d
ƒrß|    d
=n|j|    d|||t|ƒƒdjg|    D]}
|
|^qƒ}|jj|ƒ}|rS|jd ƒ} nd } |j
|||ƒ} || || fS( s¼
        Given a regular expression match from `_EXAMPLE_RE` (`m`),
        return a pair `(source, want)`, where `source` is the matched
        example's source code (with prompts and indentation stripped);
        and `want` is the example's expected output (with indentation
        stripped).
 
        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        R\Ržs
iRVt.iRys *$iÿÿÿÿtmsgN( R&RºRst_check_prompt_blankt _check_prefixRœRYtmatcht _EXCEPTION_RER+t _find_options( RkRÁR'RŸR\t source_linestslRžRyt
want_linestwlR¡R ((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¸–s$ "*(
&s#\s*doctest:\s*([^\n\'"]*)$c    Csìi}x®|jj|ƒD]š}|jdƒjddƒjƒ}xp|D]h}|ddksm|dtkrtd|d||fƒ‚nt|d}|ddk||<qGWqW|rè|j|ƒrètd|||fƒ‚n|S(    s
        Return a dictionary containing option overrides extracted from
        option directives in the given source string.
 
        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        it,RVis+-s7line %r of the doctest for %s has an invalid option: %rt+sSline %r of the doctest for %s has an option directive on a line with no example: %r(t_OPTION_DIRECTIVE_RER´RºRIRsR$R˜R¹(    RkRžR'RŸR RÁtoption_stringstoptiontflag((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRÌÌs! s ^([ ]*)(?=\S)cCsOg|jj|ƒD]}t|ƒ^q}t|ƒdkrGt|ƒSdSdS(s;Return the minimum indentation of any non-blank line in `s`iN(t
_INDENT_REtfindallR&tmin(RkR[R\tindents((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR²ês+
c
Cs}xvt|ƒD]h\}}t|ƒ|dkr ||ddkr td||d||||d!|fƒ‚q q WdS(s
 
        Given the lines of a source string (including prompts and
        leading indentation), check to make sure that every prompt is
        followed by a space character.  If any line is not followed by
        a space character, then raise ValueError.
        iiRVs8line %r of the docstring for %s lacks blank after %s: %riN(t    enumerateR&R˜(RktlinesR\R'RŸtiR‚((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRÈòs
*cCs[xTt|ƒD]F\}}|r |j|ƒ r td||d||fƒ‚q q WdS(sŽ
        Check that every line in the given list starts with the given
        prefix; if any line does not, then raise a ValueError.
        sGline %r of the docstring for %s has inconsistent leading whitespace: %riN(RÛRuR˜(RkRÜtprefixR'RŸRÝR‚((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRÉs(R4RqR”RYtcompilet    MULTILINEtVERBOSER³tDOTALLRËRÊR¹RÂRÄRÃR¸RÓRÌR×R²RÈRÉ(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR%s"    '         3                 cBs_eZdZeeƒeed„Zddddd„Zd„Z    d„Z
d„Z d„Z RS(s<
    A class used to extract the DocTests that are relevant to a given
    object, from its docstring and the docstrings of its contained
    objects.  Doctests can currently be extracted from the following
    object types: modules, functions, classes, methods, staticmethods,
    classmethods, and properties.
    cCs(||_||_||_||_dS(st
        Create a new doctest finder.
 
        The optional argument `parser` specifies a class or
        function that should be used to create new DocTest objects (or
        objects that implement the same interface as DocTest).  The
        signature for this factory function should match the signature
        of the DocTest constructor.
 
        If the optional argument `recurse` is false, then `find` will
        only examine the given object, and not any contained objects.
 
        If the optional argument `exclude_empty` is false, then `find`
        will include tests for objects with empty docstrings.
        N(t_parsert_verboset_recurset_exclude_empty(Rktverbosetparsertrecurset exclude_empty((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠs            c        Cs¡|dkrIt|ddƒ}|dkrItdt|ƒfƒ‚qIn|tkr^d}n|dkr|tj|ƒ}nydtj|ƒpštj|ƒ}|dk    rÁt    j
||j ƒ}nt    j
|ƒ}|sßd}nWnt k
rùd}nX|dkr-|dkri}q9|j j ƒ}n |j ƒ}|dk    rU|j|ƒnd|krnd|d<ng}|j||||||iƒ|jƒ|S(sj
        Return a list of the DocTests that are defined by the given
        object's docstring, or by any of its contained objects'
        docstrings.
 
        The optional parameter `module` is the module that contains
        the given object.  If the module is not specified or is None, then
        the test finder will attempt to automatically determine the
        correct module.  The object's module is used:
 
            - As a default namespace, if `globs` is not specified.
            - To prevent the DocTestFinder from extracting DocTests
              from objects that are imported from other modules.
            - To find the name of the file containing the object.
            - To help find the line number of the object within its
              file.
 
        Contained objects whose module does not match `module` are ignored.
 
        If `module` is False, no attempt to find the module will be made.
        This is obscure, of use mostly in tests:  if `module` is False, or
        is None but cannot be found automatically, then all objects are
        considered to belong to the (non-existent) module, so all contained
        objects will (recursively) be searched for doctests.
 
        The globals for each DocTest is formed by combining `globs`
        and `extraglobs` (bindings in `extraglobs` override bindings
        in `globs`).  A new copy of the globals dictionary is created
        for each DocTest.  If `globs` is not specified, then it
        defaults to the module's `__dict__`, if specified, or {}
        otherwise.  If `extraglobs` is not specified, then it defaults
        to {}.
 
        R4sJDocTestFinder.find: name must be given when obj.__name__ doesn't exist: %rR—N(R+R,R˜R¢RvR5t    getmodulet getsourcefiletgetfilet    linecachetgetlinest__dict__RAR¬tupdatet_findtsort(    RktobjR'RBR.t
extraglobsR^RÍttests((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRw/s>$           
          
cCs¸|dkrtStj|ƒdk    r8|tj|ƒkStj|ƒrW|j|jkStj|ƒrv|j|j    kSt
|dƒr•|j|j    kSt |t ƒr¨tSt dƒ‚dS(sY
        Return true if the given object is defined in the given
        module.
        Rqs"object must be a class or functionN(R+RxR5Rët
isfunctionRðt func_globalstisclassR4RqRHR7tpropertyR˜(RkRBtobject((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt _from_moduleŒs c Cs    |jrd|GHnt|ƒ|kr+dSd|t|ƒ<|j|||||ƒ}|dk    rr|j|ƒntj|ƒr|jrx‚|jj    ƒD]n\}    }
d||    f}    tj
|
ƒsÔtj |
ƒrš|j ||
ƒrš|j ||
|    ||||ƒqšqšWntj|ƒr|jrxêt|diƒj    ƒD]Í\}    }
t|    tƒswtdt|    ƒfƒ‚ntj
|
ƒp¿tj |
ƒp¿tj|
ƒp¿tj|
ƒp¿t|
tƒsÞtdt|
ƒfƒ‚nd||    f}    |j ||
|    ||||ƒq@Wntj |ƒr|jrxÖ|jj    ƒD]Â\}    }
t|
tƒrit||    ƒ}
nt|
tƒrt||    ƒj}
ntj
|
ƒsºtj |
ƒsºt|
tƒr<|j ||
ƒr<d||    f}    |j ||
|    ||||ƒq<q<WndS(    sm
        Find tests for the given object and any contained objects, and
        add them to `tests`.
        sFinding tests in %sNis%s.%st__test__s5DocTestFinder.find: __test__ keys must be strings: %rs`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rs%s.__test__.%s(RäR¯t    _get_testR+RµR5R6RåRðtitemsR÷RùRüRòR,R7R©R˜R¢tismethodt staticmethodt classmethodtim_funcRú( RkRöRôR'RBRÍR.tseenttesttvalnametval((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRò sP      %c    Cst|tƒr|}ncyC|jdkr3d}n'|j}t|tƒsZt|ƒ}nWnttfk
rzd}nX|j||ƒ}|jr¡| r¡dS|dkr¶d}n2t    |d|j
ƒ}|ddkrè|d }n|j j |||||ƒS(    ss
        Return a DocTest for the given object, if it defines a docstring;
        otherwise, return None.
        RmR–iüÿÿÿs.pycs.pyoiÿÿÿÿN(s.pycs.pyo( R7R©R”R+R8RAtAttributeErrort _find_linenoRæR,R4RãRÄ(    RkRôR'RBR.RÍR«RŸRN((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRþßs(            
      cCs–d}tj|ƒrd}ntj|ƒr•|dkr=dStjdt|ddƒƒ}x6t|ƒD]%\}}|j|ƒri|}PqiqiWntj    |ƒr°|j
}ntj |ƒrË|j }ntj |ƒræ|j}ntj|ƒr|j}ntj|ƒr)t|ddƒd}n|dk    r’|dkrI|dStjdƒ}x7t|t|ƒƒD]}|j||ƒrn|SqnWndS(    s‹
        Return a line number of the given object's docstring.  Note:
        this method assumes that the object has a docstring.
        is^\s*class\s*%s\bR4t-tco_firstlinenois(^|.*:)\s*\w*("|')N(R+R5R6RùRYRßR,RÛRÊRRR÷t    func_codet istracebackttb_frametisframetf_codetiscodetrangeR&(RkRôRÍRŸtpatRÝR‚((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR    s<                 N( R4RqR”RvRRxRŠR+RwRüRòRþR    (((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRs    ]        ?    %cBs«eZdZddZdddd„Zd„Zd„Zd„Zd„Z    d    „Z
d
„Z d „Z e jd ƒZdd „Zdded„Zdd„Zd„ZRS(s2    
    A class used to run DocTest test cases, and accumulate statistics.
    The `run` method is used to process a single DocTest case.  It
    returns a tuple `(f, t)`, where `t` is the number of test cases
    tried, and `f` is the number of test cases that failed.
 
        >>> tests = DocTestFinder().find(_TestClass)
        >>> runner = DocTestRunner(verbose=False)
        >>> tests.sort(key = lambda test: test.name)
        >>> for test in tests:
        ...     print test.name, '->', runner.run(test)
        _TestClass -> TestResults(failed=0, attempted=2)
        _TestClass.__init__ -> TestResults(failed=0, attempted=2)
        _TestClass.get -> TestResults(failed=0, attempted=2)
        _TestClass.square -> TestResults(failed=0, attempted=1)
 
    The `summarize` method prints a summary of all the test cases that
    have been run by the runner, and returns an aggregated `(f, t)`
    tuple:
 
        >>> runner.summarize(verbose=1)
        4 items passed all tests:
           2 tests in _TestClass
           2 tests in _TestClass.__init__
           2 tests in _TestClass.get
           1 tests in _TestClass.square
        7 tests in 4 items.
        7 passed and 0 failed.
        Test passed.
        TestResults(failed=0, attempted=7)
 
    The aggregated number of tried examples and failed examples is
    also available via the `tries` and `failures` attributes:
 
        >>> runner.tries
        7
        >>> runner.failures
        0
 
    The comparison between expected outputs and actual outputs is done
    by an `OutputChecker`.  This comparison may be customized with a
    number of option flags; see the documentation for `testmod` for
    more information.  If the option flags are insufficient, then the
    comparison may also be customized by passing a subclass of
    `OutputChecker` to the constructor.
 
    The test runner's display output can be controlled in two ways.
    First, an output function (`out) can be passed to
    `TestRunner.run`; this function will be called with strings that
    should be displayed.  It defaults to `sys.stdout.write`.  If
    capturing the output is not sufficient, then the display output
    can be also customized by subclassing DocTestRunner, and
    overriding the methods `report_start`, `report_success`,
    `report_unexpected_exception`, and `report_failure`.
    R3iFicCsv|p tƒ|_|dkr0dtjk}n||_||_||_d|_d|_    i|_
t ƒ|_ dS(sc
        Create a new test runner.
 
        Optional keyword arg `checker` is the `OutputChecker` that
        should be used to compare the expected outputs and actual
        outputs of doctest examples.
 
        Optional keyword arg 'verbose' prints lots of stuff if true,
        only failures if false; by default, it's true iff '-v' is in
        sys.argv.
 
        Optional argument `optionflags` can be used to control how the
        test runner compares expected output to actual output, and how
        it displays failures.  See the documentation for `testmod` for
        more information.
        s-viN( Rt_checkerR+R=RšRät optionflagstoriginal_optionflagsttriestfailurest_name2ftRht_fakeout(RktcheckerRçR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠts                         cCs_|jr[|jr=|dt|jƒdt|jƒƒq[|dt|jƒdƒndS(s‡
        Report that the test runner is about to process the given
        example.  (Only displays a message if verbose=True)
        sTrying:
s Expecting:
sExpecting nothing
N(RäRyR]Rž(RkRŒRtexample((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt report_start˜s         (cCs|jr|dƒndS(st
        Report that the given example ran successfully.  (Only
        displays a message if verbose=True)
        sok
N(Rä(RkRŒRRRz((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytreport_success¥s    cCs3||j||ƒ|jj|||jƒƒdS(s7
        Report that the given example failed.
        N(t_failure_headerRtoutput_differenceR(RkRŒRRRz((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytreport_failure­scCs.||j||ƒdtt|ƒƒƒdS(sO
        Report that the given example raised an unexpected exception.
        sException raised:
N(RR]Rg(RkRŒRRRb((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytreport_unexpected_exception´scCsÊ|jg}|jrs|jdk    rJ|jdk    rJ|j|jd}nd}|jd|j||jfƒn!|jd|jd|jfƒ|jdƒ|j}|jt|ƒƒdj|ƒS(Nit?sFile "%s", line %s, in %ssLine %s, in %ssFailed example:s
(    tDIVIDERRNRŸR+RµR'RžR]Rœ(RkRRRŒRŸRž((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR»s         !     c    BsŸd}}|j}edƒ\}}}    |jj}
x?e|jƒD].\} } |je@of|dk} ||_| jrÆxH| jjƒD]4\}}|r¯|j|O_q‹|j|M_q‹Wn|je    @rÙqDn|d7}| sÿ|j
||| ƒnd|j | f}y7e | j |d|dƒ|jU|jjƒd
}Wn3ek
r_‚n ejƒ}|jjƒnX|jjƒ}|jjdƒ|}|d
krÔ|
| j||jƒr¼|}q¼nèejƒ}ej|d Œd}| s|e|ƒ7}n| jd
kr(|    }n”|
| j||jƒrI|}ns|je@r¼ejd| jƒ}ejd|ƒ}|r¼|r¼|
|j dƒ|j dƒ|jƒr¼|}q¼n||krê| sr|j!||| |ƒqrqD||kr"| s|j"||| |ƒn|d7}qD||    krZ| sM|j#||| |ƒn|d7}qDe$sDt%d    |fƒ‚qDW||_|j&|||ƒe'||ƒS( sÒ
        Run the examples in `test`.  Write the outcome of each example
        with one of the `DocTestRunner.report_*` methods, using the
        writer function `out`.  `compileflags` is the set of compiler
        flags that should be used to execute examples.  Return a tuple
        `(f, t)`, where `t` is the number of examples tried, and `f`
        is the number of examples that failed.  The examples are run
        in the namespace `test.globs`.
        iiis<doctest %s[%d]>tsingleiiÿÿÿÿs(?:[^:]*\.)?([^:]*:)sunknown outcomeN((RRRt check_outputRÛRªR R RÿRRR'RßRžR.tdebuggerRR+tKeyboardInterruptR=RbRRaRnRyR_tformat_exception_onlyRgR¡RRYRÊRºRR!R"RvRtt_DocTestRunner__record_outcomeR#(RkRt compileflagsRŒRRRtSUCCESStFAILUREtBOOMtcheckt
examplenumRtquiett
optionflagRRNt    exceptionRztoutcomeRbR¡tm1tm2((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt__runÏs‚
                
 
              '      
     cCs^|jj|jdƒ\}}||||f|j|j<|j|7_|j|7_dS(s{
        Record the fact that the given DocTest (`test`) generated `f`
        failures out of `t` tried examples.
        iN(ii(RR*R'RR(RkRRRtttf2tt2((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt__record_outcomeKss.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$cCs |jj|ƒ}|rŒ|jdƒ|jjkrŒ|jjt|jdƒƒ}|j}t|t    ƒr|j
ddƒ}n|j t ƒS|j ||ƒSdS(NR'R0tasciiRU(t%_DocTestRunner__LINECACHE_FILENAME_RERÊRºRR'RªtintRžR7R9RWt
splitlinesRxtsave_linecache_getlines(RkRNtmodule_globalsRÁRRž((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt__patched_linecache_getlinesXs!     cCs||_|dkr't|jƒ}ntj}|dkrH|j}n|jt_tj    }t
|ƒ|_ |j j ƒ|j j    t_    t j|_|jt _tj}tjt_z|j|||ƒSWd|t_|t_    |jt _|t_|r |jjƒnXdS(sJ
        Run the examples in `test`, and display the results using the
        writer function `out`.
 
        The examples are run in the namespace `test.globs`.  If
        `clear_globs` is true (the default), then this namespace will
        be cleared after the test runs, to help with garbage
        collection.  If you would like to examine the namespace after
        the test completes, then use `clear_globs=False`.
 
        `compileflags` gives the set of flags that should be used by
        the Python compiler when running the examples.  If not
        specified, then it will default to the set of future-import
        flags that apply to `globs`.
 
        The output of each example is checked using
        `DocTestRunner.check_output`, and the results are formatted by
        the `DocTestRunner.report_*` methods.
        N(RR+R2R.R=R…twriteRRˆRŽR„R'tresetRîRïR@t*_DocTestRunner__patched_linecache_getlinest displayhookt__displayhook__t_DocTestRunner__runtclear(RkRR+RŒt clear_globsR“tsave_set_tracetsave_displayhook((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytruncs.                                     c Cs |dkr|j}ng}g}g}d}}xš|jjƒD]‰}|\}\}    }
|    |
ksnt‚||
7}||    7}|
dkrž|j|ƒqD|    dkrÀ|j||
fƒqD|j|ƒqDW|r^|rt|ƒGdGH|jƒx|D]} dG| GHqýWn|r^t|ƒGdGH|jƒx&|D]\} } d| | fGHq9Wq^n|r·|jGHt|ƒGdGH|jƒx/|D]$\} \}    }
d|    |
| fGHqŒWn|rï|GdGt|jƒGd    GH||Gd
G|Gd GHn|rd G|Gd GHn|rdGHnt    ||ƒS(s¦
        Print a summary of all the test cases that have been run by
        this DocTestRunner, and return a tuple `(f, t)`, where `f` is
        the total number of failed examples, and `t` is the total
        number of tried examples.
 
        The optional `verbose` argument controls how detailed the
        summary is.  If the verbosity is not specified, then the
        DocTestRunner's verbosity is used.
        isitems had no tests:s   sitems passed all tests:s %3d tests in %ssitems had failures:s %3d of %3d in %sstests insitems.s
passed andsfailed.s***Test Failed***s    failures.s Test passed.N(
R+RäRRÿRtRµR&RóR$R#( RkRçtnoteststpassedtfailedttotaltttotalfRÅR'RRR8tthingR·((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt    summarize¡sR  
 
 
 
 
 
cCsv|j}xf|jjƒD]U\}\}}||kr^||\}}||}||}n||f||<qWdS(N(RRÿ(RkR¤tdR'RRR8R9R:((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytmergeÚs    " 
 N(R4RqR”R$R+RŠRRR!R"RRHR*RYRßR=RERxRMRTRV(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR8s7
$                        |    
 > 9cBs)eZdZd„Zd„Zd„ZRS(s_
    A class used to check the whether the actual output from a doctest
    example matches the expected output.  `OutputChecker` defines two
    methods: `check_output`, which compares a given pair of outputs,
    and returns true if they match; and `output_difference`, which
    returns a string describing the differences between two outputs.
    cCs||krtS|t@sI||fd    kr0tS||fd
krItSn|t@stjdtjtƒd|ƒ}tjdd|ƒ}||krtSn|t@rädj|j    ƒƒ}dj|j    ƒƒ}||krätSn|t
@rt ||ƒrtSnt S( s¥
        Return True iff the actual output from an example (`got`)
        matches the expected output (`want`).  These strings are
        always considered to match if they are identical; but
        depending on what option flags the test runner is using,
        several non-exact match types are also possible.  See the
        documentation for `TestRunner` for more information about
        option flags.
        sTrue
s1
sFalse
s0
s (?m)^%s\s*?$Rms
(?m)^\s*?$RV(sTrue
s1
(sFalse
s0
( RxRRRYRZtescapetBLANKLINE_MARKERRRœRsRRRv(RkRyRzR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR&ïs, 
 
 
 
cCsL|ttBtB@stS|t@r$tS|jdƒdkoK|jdƒdkS(Ns
i(RR    R
RvRxR·(RkRyRzR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt_do_a_fancy_diff%s
c Csº|j}|t@s+tjdt|ƒ}n|j|||ƒrd|jtƒ}|jtƒ}|t@r™t    j
||ddƒ}t |ƒd}d}n|t @rÔt    j ||ddƒ}t |ƒd}d}nR|t@rt    jdt    jƒ}    t |    j||ƒƒ}d}nds&td    ƒ‚g|D]}
|
jƒd
^q-}d |td j|ƒƒS|rŠ|rŠd t|ƒt|ƒfS|rždt|ƒS|r²dt|ƒSdSdS(sû
        Return a string describing the differences between the
        expected output for a given example (`example`) and the actual
        output (`got`).  `optionflags` is the set of option flags used
        to compare `want` and `got`.
        s(?m)^[ ]*(?=
)tnis#unified diff with -expected +actuals-context diff with expected followed by actualtcharjunksndiff with -expected +actualisBad diff options
sDifferences (%s):
RmsExpected:
%sGot:
%ssExpected:
%sGot nothing
sExpected nothing
Got:
%ssExpected nothing
Got nothing
N(RyRRYRZRXRYR?RxRtdifflibt unified_difftlistR    t context_diffR
tDiffertIS_CHARACTER_JUNKtcompareRtRR]Rœ( RkRRzRRyRÏt    got_linestdifftkindtengineR‚((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR <s8    
 
    
    
    # (R4RqR”R&RYR (((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRçs    6    cBs eZdZd„Zd„ZRS(sÖA DocTest example has failed in debugging mode.
 
    The exception instance has variables:
 
    - test: the DocTest object being run
 
    - example: the Example object that failed
 
    - got: the actual output
    cCs||_||_||_dS(N(RRRz(RkRRRz((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠws        cCs t|jƒS(N(R8R(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt__str__|s(R4RqR”RŠRg(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRls
    cBs eZdZd„Zd„ZRS(sæA DocTest example has encountered an unexpected exception
 
    The exception instance has variables:
 
    - test: the DocTest object being run
 
    - example: the Example object that failed
 
    - exc_info: the exception info
    cCs||_||_||_dS(N(RRRb(RkRRRb((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠŠs        cCs t|jƒS(N(R8R(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRgs(R4RqR”RŠRg(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRs
    cBs2eZdZdded„Zd„Zd„ZRS(s{    Run doc tests but raise an exception as soon as there is a failure.
 
       If an unexpected exception occurs, an UnexpectedException is raised.
       It contains the test, the example, and the original exception:
 
         >>> runner = DebugRunner(verbose=False)
         >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
         ...                                    {}, 'foo', 'foo.py', 0)
         >>> try:
         ...     runner.run(test)
         ... except UnexpectedException, failure:
         ...     pass
 
         >>> failure.test is test
         True
 
         >>> failure.example.want
         '42\n'
 
         >>> exc_info = failure.exc_info
         >>> raise exc_info[0], exc_info[1], exc_info[2]
         Traceback (most recent call last):
         ...
         KeyError
 
       We wrap the original exception to give the calling application
       access to the test and example information.
 
       If the output doesn't match, then a DocTestFailure is raised:
 
         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 1
         ...      >>> x
         ...      2
         ...      ''', {}, 'foo', 'foo.py', 0)
 
         >>> try:
         ...    runner.run(test)
         ... except DocTestFailure, failure:
         ...    pass
 
       DocTestFailure objects provide access to the test:
 
         >>> failure.test is test
         True
 
       As well as to the example:
 
         >>> failure.example.want
         '2\n'
 
       and the actual output:
 
         >>> failure.got
         '1\n'
 
       If a failure or error occurs, the globals are left intact:
 
         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 1}
 
         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      >>> raise KeyError
         ...      ''', {}, 'foo', 'foo.py', 0)
 
         >>> runner.run(test)
         Traceback (most recent call last):
         ...
         UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>
 
         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 2}
 
       But the globals are cleared if there is no error:
 
         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      ''', {}, 'foo', 'foo.py', 0)
 
         >>> runner.run(test)
         TestResults(failed=0, attempted=1)
 
         >>> test.globs
         {}
 
       cCs5tj||||tƒ}|r1|jjƒn|S(N(RRMRvR.RI(RkRR+RŒRJtr((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRMíscCst|||ƒ‚dS(N(R(RkRŒRRRb((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR"óscCst|||ƒ‚dS(N(R(RkRŒRRRz((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR!ösN(R4RqR”R+RxRMR"R!(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR’sY    ic     Cs|dkr!tjjdƒ}ntj|ƒsFtd|fƒ‚n|dkr^|j}ntd|ƒ}    |r‹t    d|d|ƒ}
nt
d|d|ƒ}
x3|    j ||d|d|ƒD]} |
j | ƒq¿W|ré|
j ƒntdkrþ|
an tj|
ƒt|
j|
jƒS(    s*
m=None, name=None, globs=None, verbose=None, report=True,
       optionflags=0, extraglobs=None, raise_on_error=False,
       exclude_empty=False
 
    Test examples in docstrings in functions and classes reachable
    from module m (or the current module if m is not supplied), starting
    with m.__doc__.
 
    Also test examples reachable from dict m.__test__ if it exists and is
    not None.  m.__test__ maps names to functions, classes and strings;
    function and class docstrings are tested even if the name is private;
    strings are tested directly, as if they were docstrings.
 
    Return (#failures, #tests).
 
    See help(doctest) for an overview.
 
    Optional keyword arg "name" gives the name of the module; by default
    use m.__name__.
 
    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use m.__dict__.  A copy of this
    dict is actually used for each docstring, so that each docstring's
    examples start with a clean slate.
 
    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.  This is new in 2.4.
 
    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.
 
    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).
 
    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  This is new in 2.3.  Possible values (see the
    docs for details):
 
        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE
 
    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.
 
    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    R—stestmod: module required; %rRêRçRR.RõN(R+R=R>R*R5R6RAR4RRRRwRMRTtmasterRVR#RR( RÁR'R.RçtreportRRõtraise_on_errorRêtfindertrunnerR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRs$E   %       c Csl|r| rtdƒ‚nt|||ƒ\} }|dkrUtjj|ƒ}n|dkrji}n |jƒ}|dk    r’|j|ƒnd|kr«d|d<n|    rÉtd|d|ƒ} nt    d|d|ƒ} | dk    rü| j
| ƒ} n|
j | |||dƒ}| j |ƒ|r7| j ƒntdkrL| an tj| ƒt| j| jƒS(s
    Test examples in the given file.  Return (#failures, #tests).
 
    Optional keyword arg "module_relative" specifies how filenames
    should be interpreted:
 
      - If "module_relative" is True (the default), then "filename"
         specifies a module-relative path.  By default, this path is
         relative to the calling module's directory; but if the
         "package" argument is specified, then it is relative to that
         package.  To ensure os-independence, "filename" should use
         "/" characters to separate path segments, and should not
         be an absolute path (i.e., it may not begin with "/").
 
      - If "module_relative" is False, then "filename" specifies an
        os-specific path.  The path may be absolute or relative (to
        the current working directory).
 
    Optional keyword arg "name" gives the name of the test; by default
    use the file's basename.
 
    Optional keyword argument "package" is a Python package or the
    name of a Python package whose directory should be used as the
    base directory for a module relative filename.  If no package is
    specified, then the calling module's directory is used as the base
    directory for module relative filenames.  It is an error to
    specify "package" if "module_relative" is False.
 
    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use {}.  A copy of this dict
    is actually used for each docstring, so that each docstring's
    examples start with a clean slate.
 
    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.
 
    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.
 
    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).
 
    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  Possible values (see the docs for details):
 
        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE
 
    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.
 
    Optional keyword arg "parser" specifies a DocTestParser (or
    subclass) that should be used to extract tests from the files.
 
    Optional keyword arg "encoding" specifies an encoding that should
    be used to convert the file to unicode.
 
    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    s8Package may only be specified for module-relative paths.R4R—RçRiN(R˜RSR+RJR™tbasenameR¬RñRRtdecodeRÄRMRTRiRVR#RR(RNRPR'ROR.RçRjRRõRkRèRTttextRmR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRjs2R                    tNoNamec    Csdtd|dtƒ}td|d|ƒ}x3|j||d|ƒD]}|j|d|ƒqCWdS(sr
    Test examples in the given object's docstring (`f`), using `globs`
    as globals.  Optional argument `name` is used in failure messages.
    If the optional argument `verbose` is true, then generate output
    even if there are no failures.
 
    `compileflags` gives the set of flags that should be used by the
    Python compiler when running the examples.  If not specified, then
    it will default to the set of future-import flags that apply to
    `globs`.
 
    Optional keyword arg `optionflags` specifies options for the
    testing and output.  See the documentation for `testmod` for more
    information.
    RçRéRR.R+N(RRvRRwRM(    RRR.RçR'R+RRlRmR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRçscBs_eZddddd„Zd„Zddd„Zdd„Zd„Zdd„Zd„Z    RS(    icCsÊtjdtddƒ|dkr=|dkr=tdƒ‚n|dk    rotj|ƒ rotd|fƒ‚n|dkr‡|j}n||_||_    ||_
t ƒ|_ t d|d|ƒ|_dS(NsCclass Tester is deprecated; use class doctest.DocTestRunner insteadt
stacklevelis*Tester.__init__: must specify mod or globss)Tester.__init__: mod must be a module; %rRçR(twarningstwarntDeprecationWarningR+RAR5R6RðR.RçRRt
testfinderRt
testrunner(RktmodR.RçR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠs                     cCs|tƒj||j|ddƒ}|jr6dG|GHn|jj|ƒ\}}|jro|GdG|GdG|GHnt||ƒS(NsRunning stringtofsexamples failed in string(RRÄR.R+RçRwRMR#(RkR[R'RRRR8((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt    runstrings!         c
Csyd}}|jj||d|d|jƒ}x;|D]3}|jj|ƒ\}}    ||||    }}q5Wt||ƒS(NiRBR.(RvRwR.RwRMR#(
RkRûR'RBRRR8RöRR9R:((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytrundoc"s
  cCsSddl}|j|ƒ}|jj|ƒ|dkr@t}n|j|||ƒS(Niÿÿÿÿ(ttypest
ModuleTypeRðRñR+RvR{(RkRUR'RBR|RÁ((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytrundict+s       cCs4ddl}|j|ƒ}||_|j||ƒS(Niÿÿÿÿ(R|R}RýR{(RkRUR'R|RÁ((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt run__test__3s     cCs|jj|ƒS(N(RwRT(RkRç((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRT9scCs|jj|jƒdS(N(RwRV(RkR¤((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRV<sN(
R4RqR+RŠRzR{R~RRTRV(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRs                  cCs2|t@|kr"td|ƒ‚nt}|a|S(s?Sets the unittest option flags.
 
    The old flag is returned so that a runner could restore the old
    value if it wished to:
 
      >>> import doctest
      >>> old = doctest._unittest_reportflags
      >>> doctest.set_unittest_reportflags(REPORT_NDIFF |
      ...                          REPORT_ONLY_FIRST_FAILURE) == old
      True
 
      >>> doctest._unittest_reportflags == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True
 
    Only reporting flags can be set:
 
      >>> doctest.set_unittest_reportflags(ELLIPSIS)
      Traceback (most recent call last):
      ...
      ValueError: ('Only reporting flags allowed', 8)
 
      >>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True
    sOnly reporting flags allowed(R R˜t_unittest_reportflags(R/told((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyREs
t DocTestCasecBs†eZdd d d d„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z e Zd „ZRS(icCsAtjj|ƒ||_||_||_||_||_dS(N(tunittesttTestCaseRŠt_dt_optionflagst _dt_checkert_dt_testt    _dt_setUpt _dt_tearDown(RkRRtsetUpttearDownR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠks                 cCs,|j}|jdk    r(|j|ƒndS(N(R‡RˆR+(RkR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠus    cCs9|j}|jdk    r(|j|ƒn|jjƒdS(N(R‡R‰R+R.RI(RkR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR‹{s    cCsÆ|j}tj}tƒ}|j}|t@s;|tO}ntd|d|jdt    ƒ}z5dd|_
|j |d|j dt    ƒ\}}Wd|t_X|rÂ|j |j|jƒƒƒ‚ndS(NRRRçR
iFRŒRJ(R‡R=R…R!R…R R€RR†RvR$RMRCtfailureExceptiontformat_failureRa(RkRRtnewRRmRR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytrunTestƒs                
   "
cCsj|j}|jdkr!d}n d|j}dj|jjdƒdƒ}d|j|j|||fS(Nsunknown line numbers%sRÆiÿÿÿÿs:Failed doctest test for %s
  File "%s", line %s, in %s
 
%s(R‡RŸR+RœR'RsRN(RkterrRRŸtlname((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR›s         cCsO|jƒtd|jd|jdtƒ}|j|jdtƒ|jƒdS(sÊRun the test case without results and without catching exceptions
 
           The unit test framework includes a debug method on test cases
           and test suites to support post-mortem debugging.  The test code
           is run in such a way that errors are not caught.  This way a
           caller can catch the errors and initiate post-mortem debugging.
 
           The DocTestCase provides a debug method that raises
           UnexpectedException errors if there is an unexpected
           exception:
 
             >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
             ...                {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)
             >>> try:
             ...     case.debug()
             ... except UnexpectedException, failure:
             ...     pass
 
           The UnexpectedException contains the test, the example, and
           the original exception:
 
             >>> failure.test is test
             True
 
             >>> failure.example.want
             '42\n'
 
             >>> exc_info = failure.exc_info
             >>> raise exc_info[0], exc_info[1], exc_info[2]
             Traceback (most recent call last):
             ...
             KeyError
 
           If the output doesn't match, then a DocTestFailure is raised:
 
             >>> test = DocTestParser().get_doctest('''
             ...      >>> x = 1
             ...      >>> x
             ...      2
             ...      ''', {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)
 
             >>> try:
             ...    case.debug()
             ... except DocTestFailure, failure:
             ...    pass
 
           DocTestFailure objects provide access to the test:
 
             >>> failure.test is test
             True
 
           As well as to the example:
 
             >>> failure.example.want
             '2\n'
 
           and the actual output:
 
             >>> failure.got
             '1\n'
 
           RRRçRJN(RŠRR…R†RvRMR‡R‹(RkRm((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR §s
B
cCs
|jjS(N(R‡R'(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¯ïscCstt|ƒt|ƒk    rtS|j|jkos|j|jkos|j|jkos|j|jkos|j|jkS(N(R¢R£R‡R…RˆR‰R†(RkR¤((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¥òscCs ||k S(N((RkR¤((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¦üscCs"t|j|j|j|jfƒS(N(R§R…RˆR‰R†(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¨ÿscCs4|jjjdƒ}d|ddj|d ƒfS(NRÆs%s (%s)iÿÿÿÿ(R‡R'RsRœ(RkR'((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR­    scCsd|jjS(Ns    Doctest: (R‡R'(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytshortDescription        sN(R4RqR+RŠRŠR‹RRR R¯R¥R¦R¨R­RgR’(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR‚is                            H        
           tSkipDocTestCasecBs2eZd„Zd„Zd„Zd„ZeZRS(cCs||_tj|dƒdS(N(RBR‚RŠR+(RkRB((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠ    s    cCs|jdƒdS(Ns-DocTestSuite will not work with -O2 and above(tskipTest(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠ    scCsdS(N((Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt    test_skip    scCsd|jjS(NsSkipping tests from %s(RBR4(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR’    s(R4RqRŠRŠR•R’Rg(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR“    s
                c    Ks*|d
krtƒ}nt|ƒ}|j|d|d|ƒ}| r{tjjdkr{tjƒ}|j    t
|ƒƒ|S|s“t |dƒ‚n|j ƒtjƒ}xz|D]r}t |jƒdkrÑq°n|js |j}|dd kr|d     }n||_n|j    t||ƒq°W|S( s
    Convert doctest tests for a module to a unittest test suite.
 
    This converts each documentation string in a module that
    contains doctest tests to a unittest test case.  If any of the
    tests in a doc string fail, then the test case fails.  An exception
    is raised showing the name of the file containing the test and a
    (sometimes approximate) line number.
 
    The `module` argument provides the module to be tested.  The argument
    can be either a module or a module name.
 
    If no argument is given, the calling module is used.
 
    A number of options may be provided as keyword arguments:
 
    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.
 
    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.
 
    globs
      A dictionary containing initial global variables for the tests.
 
    optionflags
       A set of doctest option flags expressed as an integer.
    R.Rõishas no docstringsiiüÿÿÿs.pycs.pyoiÿÿÿÿN(s.pycs.pyo(R+RRDRwR=R/toptimizeRƒt    TestSuitetaddTestR“R˜RóR&RªRNR–R‚(    RBR.Rõt test_finderR RötsuiteRRN((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR    s,%    
            t DocFileCasecBs)eZd„Zd„ZeZd„ZRS(cCsdj|jjjdƒƒS(Nt_RÆ(RœR‡R'Rs(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¯h    scCs
|jjS(N(R‡RN(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR­k    scCsd|jj|jj|fS(Ns2Failed doctest test for %s
  File "%s", line 0
 
%s(R‡R'RN(RkR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRo    s(R4RqR¯R­RgR(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR›f    s        c
KsÆ|dkri}n |jƒ}|r=| r=tdƒ‚nt|||ƒ\}}d|krn||d<ntjj|ƒ}|dk    rž|j|ƒ}n|j||||dƒ}    t    |    |S(Ns8Package may only be specified for module-relative paths.R–i(
R+R¬R˜RSRJR™RnRoRÄR›(
R™RPROR.RèRTR tdocR'R((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt DocFileTestt    s          cOsetjƒ}|jdtƒr:t|jdƒƒ|d<nx$|D]}|jt||ƒqAW|S(s‘A unittest suite for one or more doctest files.
 
    The path to each doctest file is given as a string; the
    interpretation of that string depends on the keyword argument
    "module_relative".
 
    A number of options may be provided as keyword arguments:
 
    module_relative
      If "module_relative" is True, then the given file paths are
      interpreted as os-independent module-relative paths.  By
      default, these paths are relative to the calling module's
      directory; but if the "package" argument is specified, then
      they are relative to that package.  To ensure os-independence,
      "filename" should use "/" characters to separate path
      segments, and may not be an absolute path (i.e., it may not
      begin with "/").
 
      If "module_relative" is False, then the given file paths are
      interpreted as os-specific paths.  These paths may be absolute
      or relative (to the current working directory).
 
    package
      A Python package or the name of a Python package whose directory
      should be used as the base directory for module relative paths.
      If "package" is not specified, then the calling module's
      directory is used as the base directory for module relative
      filenames.  It is an error to specify "package" if
      "module_relative" is False.
 
    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.
 
    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.
 
    globs
      A dictionary containing initial global variables for the tests.
 
    optionflags
      A set of doctest option flags expressed as an integer.
 
    parser
      A DocTestParser (or subclass) that should be used to extract
      tests from the files.
 
    encoding
      An encoding that will be used to convert the files to unicode.
    RPRO(RƒR—R*RxRDR˜Rž(tpathstkwRšR™((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR‘    s 8  cCs(g}x½tƒj|ƒD]©}t|tƒr’|j|jd ƒ|j}|rÂ|jdƒ|g|jdƒd D]}d|^qu7}qÂq|g|jdƒd D]}t|ƒ^q©7}qWx$|rì|ddkrì|j    ƒqÉWx'|r|ddkr|j    dƒqðWdj
|ƒdS(svExtract script from text with examples.
 
       Converts text with examples to a Python script.  Example input is
       converted to regular code.  Example output and all other words
       are converted to comments:
 
       >>> text = '''
       ...       Here are examples of simple math.
       ...
       ...           Python has super accurate integer addition
       ...
       ...           >>> 2 + 2
       ...           5
       ...
       ...           And very friendly error messages:
       ...
       ...           >>> 1/0
       ...           To Infinity
       ...           And
       ...           Beyond
       ...
       ...           You can use logic if you want:
       ...
       ...           >>> if 0:
       ...           ...    blah
       ...           ...    blah
       ...           ...
       ...
       ...           Ho hum
       ...           '''
 
       >>> print script_from_examples(text)
       # Here are examples of simple math.
       #
       #     Python has super accurate integer addition
       #
       2 + 2
       # Expected:
       ## 5
       #
       #     And very friendly error messages:
       #
       1/0
       # Expected:
       ## To Infinity
       ## And
       ## Beyond
       #
       #     You can use logic if you want:
       #
       if 0:
          blah
          blah
       #
       #     Ho hum
       <BLANKLINE>
       iÿÿÿÿs # Expected:s
s## R€i( RRÂR7R RµRžRyRsRƒtpopRœ(R[R¿tpieceRyR¾((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRÚ    s:     4.cCs{t|ƒ}tƒj|ƒ}g|D]}|j|kr%|^q%}|s^t|dƒ‚n|d}t|jƒ}|S(sExtract the test sources from a doctest docstring as a script.
 
    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the doc string with tests to be debugged.
    snot found in testsi(RDRRwR'R˜RR«(RBR'RöR8Rttestsrc((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR,
s (
cCs t|ƒ}t|||ƒdS(s4Debug a single doctest docstring, in argument `src`'N(Rt debug_script(tsrctpmR.R£((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR<
s cCsÜddl}tjddƒ}t|dƒ}|j|ƒ|jƒzƒ|r\|jƒ}ni}|r¯yt|||ƒWqÆtj    ƒdGH|j
tj    ƒdƒqÆXn|j d|||ƒWdt j |ƒXdS(    s7Debug a test script.  `src` is the script, as a string.iÿÿÿÿNs.pyt doctestdebugR~iis execfile(%r)(RˆttempfiletmktempRLRCtcloseR¬texecfileR=Rbt post_mortemRMRJtremove(R¥R¦R.Rˆt srcfilenameRR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¤A
s"  
cCs2t|ƒ}t||ƒ}t|||jƒdS(såDebug a single doctest docstring.
 
    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the docstring with tests to be debugged.
    N(RDRR¤Rð(RBR'R¦R£((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR a
s t
_TestClasscBs)eZdZd„Zd„Zd„ZRS(så
    A pointless class, for sanity-checking of docstring testing.
 
    Methods:
        square()
        get()
 
    >>> _TestClass(13).get() + _TestClass(-12).get()
    1
    >>> hex(_TestClass(13).square().get())
    '0xa9'
    cCs ||_dS(sƒval -> _TestClass object with associated value val.
 
        >>> t = _TestClass(123)
        >>> print t.get()
        123
        N(R(RkR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyRŠ}
scCs|jd|_|S(sosquare() -> square TestClass's associated value
 
        >>> _TestClass(13).square().get()
        169
        i(R(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pytsquare‡
scCs|jS(s}get() -> return TestClass's associated value.
 
        >>> x = _TestClass(-42)
        >>> print x.get()
        -42
        (R(Rk((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR*‘
s(R4RqR”RŠR°R*(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyR¯o
s     
   
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      R¼sÜ
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    sbool-int equivalencesæ
                Blank lines can be marked with <BLANKLINE>:
                    >>> print 'foo\n\nbar\n'
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            s blank linessó
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print range(1000) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            tellipsiss|
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print range(30) #doctest: +NORMALIZE_WHITESPACE
                    [0, 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]
            swhitespace normalizationcCs1gtjdD]"}|r|ddkr|^q}|s‘tjjtjdƒ}dtƒkrtjj|ƒ\}}ndj|ƒGHdSx™|D]‘}|jdƒrtjj    |ƒ\}}tjj
d|ƒt |d ƒ}tjd=t |ƒ\}}nt |d    tƒ\}}|r˜dSq˜WdS(
NiiR
REsusage: {0} [-v] file ...is.pyiýÿÿÿRP(R=RšRJR™RnR;tsplitexttformatRjRstinsertR:RRRv(targt    testfilesR'RœRNtdirnameRÁR((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt_testÎ
s$6 
R—(VR”t __docformat__t__all__R(R=R_R5RîRJRYRƒR\RˆR¨RsR!t collectionsR"R#R$RRRRRRRRRR    R
R R RXRrR2RDRSR,t
__stdout__R+RXR]RgRhRRƒR‰R„RGR RRRRRt    ExceptionRRRRiRxRvRRRRR€RR„R‚R“RR›RžRRRRR¤R R¯RýR¸R4texit(((sO/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/doctest.pyt<module>.sê     H0                                  1    $    $HLëÿ)ÿ°…n     f       z?    $£I         I    R      ,