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
M\¬Qc@sdZddlZddlZyddlmZWn!ek
rUddlmZnXdddddd    gZd
j    Z
e Z e ZeZdd d dd „Zd d dd„Zd„Zd„Zd„Zd„Zd    dd„ƒYZd„Zd„Zdd„ZedkreƒndS(s/Support to pretty-print lists, tuples, & dictionaries recursively.
 
Very simple, but useful, especially in debugging data structures.
 
Classes
-------
 
PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.
 
Functions
---------
 
pformat()
    Format a Python object into a pretty-printed representation.
 
pprint()
    Pretty-print a Python object to a stream [default is sys.stdout].
 
saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.
 
iÿÿÿÿN(tStringIOtpprinttpformatt
isreadablet isrecursivetsafereprt PrettyPrinters, iiPc    Cs2td|d|d|d|ƒ}|j|ƒdS(sAPretty-print a Python object to a stream [default is sys.stdout].tstreamtindenttwidthtdepthN(RR(tobjectRRR    R
tprinter((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyR7scCs"td|d|d|ƒj|ƒS(s<Format a Python object into a pretty-printed representation.RR    R
(RR(R RR    R
((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyR=scCst|iddƒdS(s=Version of repr() which can handle recursive data structures.iN(t
_safe_reprtNone(R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyRAscCst|iddƒdS(s4Determine if saferepr(object) is readable by eval().iiN(R R(R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyREscCst|iddƒdS(s8Determine if object requires a recursive representation.iiN(R R(R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyRIscCs@tjƒ.tjr,tjddtƒnt|ƒSWdQXdS(Ntignores%comparing unequal types not supported(twarningstcatch_warningst_syst py3kwarningtfilterwarningstDeprecationWarningtsorted(titerable((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyt_sortedMs
      
cBs\eZddd
d
d„Zd„Zd„Zd„Zd„Zd„Zd„Z    d    „Z
RS( iiPcCs©t|ƒ}t|ƒ}|dks0tdƒ‚|dksT|dksTtdƒ‚|sftdƒ‚||_||_||_|dk    r™||_n tj|_dS(sòHandle pretty printing operations onto a stream using a set of
        configured parameters.
 
        indent
            Number of spaces to indent for each level of nesting.
 
        width
            Attempted maximum number of columns in the output.
 
        depth
            The maximum depth to print out nested structures.
 
        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.
 
        isindent must be >= 0sdepth must be > 0swidth must be != 0N(    tinttAssertionErrorRt_deptht_indent_per_levelt_widtht_streamRtstdout(tselfRR    R
R((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyt__init__Us  $              cCs3|j||jddidƒ|jjdƒdS(Nis
(t_formatRtwrite(R R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyRtscCs/tƒ}|j||ddidƒ|jƒS(Ni(t    _StringIOR"tgetvalue(R R tsio((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyRxs    cCs|j|iddƒdS(Nii(tformat(R R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyR}scCs,|j|iddƒ\}}}|o+| S(Ni(R'(R R tstreadablet    recursive((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyR€s!cCs|d}t|ƒ}||krK|jt|ƒƒt|_t|_dS|j|||dƒ}t|ƒ}    t    |ƒ|j
d||k}
|j} |j rÀ||j krÀ| |ƒdSt |    ddƒ} t|    tƒr„| tjkr„| dƒ|jdkr!| |jddƒnt    |ƒ} | rvd||<||j}t|jƒƒ}|d\}}|j|||ƒ}| |ƒ| dƒ|j|||t    |ƒd|d||ƒ| dkr_x|dD]~\}}|j|||ƒ}|
r| dd||fƒn| d    |ƒ|j|||t    |ƒd|d||ƒqÚWn||j}||=n| d
ƒdSt|    tƒr¢| tjksüt|    tƒrÀ| tjksüt|    tƒrÞ| tjksüt|    tƒrö| tjkröt    |ƒ} t|    tƒr*| d ƒd }n¨t|    tƒrv| sM| d ƒdS| dƒd}t|ƒ}|d7}n\t|    tƒrÂ| s™| dƒdS| dƒd}t|ƒ}|d7}n| dƒd}|jdkrÿ|
rÿ| |jddƒn| rÀd||<||j}|j|d|||d||ƒ| dkr©xZ|dD]K}|
rx| dd|ƒn
| dƒ|j||||d||ƒqWWn||j}||=nt|    tƒrè| dkrè| dƒn| |ƒdS| |ƒdS(Nit__repr__t{t is: is,
%s%s: s, %s: t}t[t]sset()sset([s])is frozenset()s frozenset([i
t(t)s,
s, t,(t_idR#t
_recursiontTruet
_recursivetFalset    _readablet_reprt_typet_lenRRtgetattrRt
issubclasstdictR+RRtitemsR"tlistttupletsett    frozenset(R R RRt    allowancetcontexttleveltobjidtrepttyptsepLinesR#trtlengthR@tkeytenttendchar((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyR"„s²
           !    
 
 
 
 
 
 
 
    
 
 
 
 
 
 
 
 
 
cCsR|j||jƒ|j|ƒ\}}}|s<t|_n|rNt|_n|S(N(R'tcopyRR8R9R6R7(R R RFRGtreprR)R*((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyR:çs  cCst||||ƒS(sÈFormat object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        (R (R R RFt    maxlevelsRG((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyR'ðsN( t__name__t
__module__RR!RRRRR"R:R'(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyRTs                    c        c  Cs<t|ƒ}|tkrdtjkr:t|ƒttfSd|krhd|krhd}idd6}nd}idd6}|j}tƒ}|j    }    xG|D]?}
|
j
ƒr¼|    |
ƒq|    ||
t|
ƒdd!ƒƒqWd||j ƒ|fttfSt |d    dƒ} t|tƒr€| tjkr€|sCd
ttfSt|ƒ} |rt||krtd t| |kfS| |kr“t|ƒttfSd|| <t} t}g}|j}|d7}t}x—t|jƒƒD]ƒ\}}|||||ƒ\}}}|||||ƒ\}}}|d ||fƒ| oF|oF|} |sU|rÛt}qÛqÛW|| =d t|ƒ| |fSt|tƒrž| tjks¼t|tƒr| tjkrt|tƒrç|sÞdttfSd}n4t|ƒdkrd}n|sdttfSd}t|ƒ} |rP||krP|dt| |kfS| |krot|ƒttfSd|| <t} t}g}|j}|d7}xT|D]L}t||||ƒ\}}}||ƒ|sât} n|r¥t}q¥q¥W|| =|t|ƒ| |fSt|ƒ}||o5|jdƒ tfS(Ntlocalet't"s\"s\'iiÿÿÿÿs%s%s%sR+s{}s{...}s%s: %ss{%s}s[]s[%s]s(%s,)s()s(%s)s...t<(R;tstrRtmodulesRRR6R8tgetR$R#tisalphaR%R=RR>R?R+R4R5tappendR RR@t
_commajoinRARBR<t
startswith( R RFRSRGRJtclosuretquotestqgetR&R#tcharRLRHR)R*t
componentsR^Rtktvtkreprt    kreadabletkrecurtvreprt    vreadabletvrecurR'totoreprt    oreadabletorecurRI((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyR ús–                  $    
    
              
    
 
      cCsdt|ƒjt|ƒfS(Ns<Recursion on %s with id=%s>(R;RTR4(R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyR5NscCs³ddl}|dkrHddddgidd6d    d
6fgd }ntƒ}|jƒ}t|idd ƒ|jƒ}|j|ƒ|jƒ}d G||GHdG||GHdS(Niÿÿÿÿtstringiiiiiiiii †is _safe_repr:spformat:(ii(ttimeRRR R(R Rstptt1tt2tt3((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyt
_perfcheckSs  0         t__main__((t__doc__tsysRRt    cStringIORR$t ImportErrort__all__tjoinR_tidR4tlenR<ttypeR;RRRRRRRRR R5RxRT(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/pprint.pyt<module>#s0                           ¦    T