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
M\¬Qc@s–dZdZdZdZeeZeZeZeeZdZeddZ    dZ
dZ eee eZ e eed    ƒƒZed
ƒjeƒZ[dd „Zdad „Zd dlZdd4d„ƒYZdefd„ƒYZdd5d„ƒYZeZeZ eZ!eZ"d„Z#d„Z$d„Z%dd„Z&dd„Z'dd„Z(dd d„Z)e)Z*dd d„Z+dd„ZeZ,d„Z-d „Z.d!„Z/d"„Z0d#„Z1e2Z3e4Z5e6Z7d$„Z8d%d&„Z9d%d'„Z:d(„Z;d)„Z<d*„Z=d+„Z>d,d-„Z?d
d.„Z@d/„ZAd d0„ZBy0d d1lCmZmZmZmZeeZWneDk
r{nXd2eEfd3„ƒYZFdS(6súA collection of string operations (most are no longer used).
 
Warning: most of the code you see here isn't normally used nowadays.
Beginning with Python 1.6, many of these functions are implemented as
methods on the standard string object. They used to be implemented by
a built-in module called strop, but strop is now obsolete itself.
 
Public module variables:
 
whitespace -- a string containing all characters considered whitespace
lowercase -- a string containing all characters considered lowercase letters
uppercase -- a string containing all characters considered uppercase letters
letters -- a string containing all characters considered letters
digits -- a string containing all characters considered decimal digits
hexdigits -- a string containing all characters considered hexadecimal digits
octdigits -- a string containing all characters considered octal digits
punctuation -- a string containing all characters considered punctuation
printable -- a string containing all characters considered printable
 
s     
tabcdefghijklmnopqrstuvwxyztABCDEFGHIJKLMNOPQRSTUVWXYZt
0123456789tabcdeftABCDEFt01234567s !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~itcCs&|p    djd„|j|ƒDƒƒS(s‘capwords(s [,sep]) -> string
 
    Split the argument into words using split, capitalize each
    word using capitalize, and join the capitalized words using
    join.  If the optional second argument sep is absent or None,
    runs of whitespace characters are replaced by a single space
    and leading and trailing whitespace are removed, otherwise
    sep is used to split and join the words.
 
    t css|]}|jƒVqdS(N(t
capitalize(t.0tx((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pys    <genexpr>8s(tjointsplit(tstsep((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pytcapwords-s cCs‹t|ƒt|ƒkr$td‚nts9ttƒant}tt|ƒ}x,tt|ƒƒD]}|||||<qbWdj|ƒS(sÁmaketrans(frm, to) -> string
 
    Return a translation table (a string of 256 bytes long)
    suitable for use in string.translate.  The strings frm and to
    must be of the same length.
 
    s)maketrans arguments must have same lengthR(    tlent
ValueErrort_idmapLtlistt_idmaptmaptordtrangeR (tfromstrttostrtLti((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyt    maketrans=s iÿÿÿÿNt    _multimapcBs eZdZd„Zd„ZRS(s‡Helper class for combining multiple mappings.
 
    Used by .{safe_,}substitute() to combine the mapping and keyword
    arguments.
    cCs||_||_dS(N(t_primaryt
_secondary(tselftprimaryt    secondary((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyt__init__[s    cCs/y|j|SWntk
r*|j|SXdS(N(RtKeyErrorR(R tkey((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyt __getitem___s (t__name__t
__module__t__doc__R#R&(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRUs    t_TemplateMetaclasscBseZdZd„ZRS(s/
    %(delim)s(?:
      (?P<escaped>%(delim)s) |   # Escape sequence of two delimiters
      (?P<named>%(id)s)      |   # delimiter and a Python identifier
      {(?P<braced>%(id)s)}   |   # delimiter and a braced identifier
      (?P<invalid>)              # Other ill-formed delimiter exprs
    )
    cCstt|ƒj|||ƒd|kr4|j}n*tjitj|jƒd6|jd6}tj|tj    tj
Bƒ|_dS(Ntpatterntdelimtid( tsuperR*R#R+t_retescapet    delimitert    idpatterntcompilet
IGNORECASEtVERBOSE(tclstnametbasestdctR+((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR#ps      (R'R(R+R#(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR*fstTemplatecBsDeZdZeZdZdZd„Zd„Zd„Z    d„Z
RS(s.A string class for supporting $-substitutions.t$s[_a-z][_a-z0-9]*cCs ||_dS(N(ttemplate(R R<((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR#ƒscCs}|jdƒ}|j| jtƒ}|s:d}d}n)|tdj|d ƒƒ}t|ƒ}td||fƒ‚dS(NtinvalidiRiÿÿÿÿs.Invalid placeholder in string: line %d, col %d(tstartR<t
splitlinestTrueRR R(R tmoRtlinestcolnotlineno((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyt_invalidˆs     cs~t|ƒdkr!tdƒ‚n|s0|‰n&|rLt||dƒ‰n
|d‰‡‡fd†}ˆjj|ˆjƒS(NisToo many positional argumentsics–|jdƒp|jdƒ}|dk    r?ˆ|}d|fS|jdƒdk    r[ˆjS|jdƒdk    r€ˆj|ƒntdˆjƒ‚dS(Ntnamedtbraceds%stescapedR=s#Unrecognized named group in pattern(tgrouptNoneR1RERR+(RARFtval(tmappingR (sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pytconvertžs 
 (Rt    TypeErrorRR+tsubR<(R targstkwsRM((RLR sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyt
substitute”s    
cs~t|ƒdkr!tdƒ‚n|s0|‰n&|rLt||dƒ‰n
|d‰‡‡fd†}ˆjj|ˆjƒS(NisToo many positional argumentsicsð|jdƒ}|dk    rMydˆ|fSWqMtk
rIˆj|SXn|jdƒ}|dk    r¢ydˆ|fSWq¢tk
ržˆjd|dSXn|jdƒdk    r¾ˆjS|jdƒdk    rڈjStdˆjƒ‚dS(    NRFs%sRGt{t}RHR=s#Unrecognized named group in pattern(RIRJR$R1RR+(RARFRG(RLR (sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRM¸s$    (RRNRR+ROR<(R RPRQRM((RLR sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pytsafe_substitute®s    
( R'R(R)R*t __metaclass__R1R2R#RERRRU(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR:|s            cCs
|jƒS(sSlower(s) -> string
 
    Return a copy of the string s converted to lowercase.
 
    (tlower(R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRWÜscCs
|jƒS(sSupper(s) -> string
 
    Return a copy of the string s converted to uppercase.
 
    (tupper(R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRXåscCs
|jƒS(s„swapcase(s) -> string
 
    Return a copy of the string s with upper case characters
    converted to lowercase and vice versa.
 
    (tswapcase(R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRYîscCs |j|ƒS(sstrip(s [,chars]) -> string
 
    Return a copy of the string s with leading and trailing
    whitespace removed.
    If chars is given and not None, remove characters in chars instead.
    If chars is unicode, S will be converted to unicode before stripping.
 
    (tstrip(R tchars((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRZøs    cCs |j|ƒS(s®lstrip(s [,chars]) -> string
 
    Return a copy of the string s with leading whitespace removed.
    If chars is given and not None, remove characters in chars instead.
 
    (tlstrip(R R[((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR\scCs |j|ƒS(s¯rstrip(s [,chars]) -> string
 
    Return a copy of the string s with trailing whitespace removed.
    If chars is given and not None, remove characters in chars instead.
 
    (trstrip(R R[((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR]scCs|j||ƒS(srsplit(s [,sep [,maxsplit]]) -> list of strings
 
    Return a list of the words in the string s, using sep as the
    delimiter string.  If maxsplit is given, splits at no more than
    maxsplit places (resulting in at most maxsplit+1 words).  If sep
    is not specified or is None, any whitespace string is a separator.
 
    (split and splitfields are synonymous)
 
    (R (R Rtmaxsplit((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR s cCs|j||ƒS(sWrsplit(s [,sep [,maxsplit]]) -> list of strings
 
    Return a list of the words in the string s, using sep as the
    delimiter string, starting at the end of the string and working
    to the front.  If maxsplit is given, at most maxsplit splits are
    done. If sep is not specified or is None, any whitespace string
    is a separator.
    (trsplit(R RR^((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR_(s    RcCs |j|ƒS(sÖjoin(list [,sep]) -> string
 
    Return a string composed of the words in list, with
    intervening occurrences of sep.  The default separator is a
    single space.
 
    (joinfields and join are synonymous)
 
    (R (twordsR((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR 4s
cGs |j|ŒS(spindex(s, sub [,start [,end]]) -> int
 
    Like find but raises ValueError when the substring is not found.
 
    (tindex(R RP((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRaBscGs |j|ŒS(srrindex(s, sub [,start [,end]]) -> int
 
    Like rfind but raises ValueError when the substring is not found.
 
    (trindex(R RP((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRbKscGs |j|ŒS(sÈcount(s, sub[, start[,end]]) -> int
 
    Return the number of occurrences of substring sub in string
    s[start:end].  Optional arguments start and end are
    interpreted as in slice notation.
 
    (tcount(R RP((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRcTscGs |j|ŒS(sfind(s, sub [,start [,end]]) -> in
 
    Return the lowest index in s where substring sub is found,
    such that sub is contained within s[start,end].  Optional
    arguments start and end are interpreted as in slice notation.
 
    Return -1 on failure.
 
    (tfind(R RP((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRd_s
cGs |j|ŒS(srfind(s, sub [,start [,end]]) -> int
 
    Return the highest index in s where substring sub is found,
    such that sub is contained within s[start,end].  Optional
    arguments start and end are interpreted as in slice notation.
 
    Return -1 on failure.
 
    (trfind(R RP((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRels
cCs
t|ƒS(sYatof(s) -> float
 
    Return the floating point number represented by the string s.
 
    (t_float(R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pytatof~si
cCs t||ƒS(ssatoi(s [,base]) -> int
 
    Return the integer represented by the string s in the given
    base, which defaults to 10.  The string s must consist of one
    or more digits, possibly preceded by a sign.  If base is 0, it
    is chosen from the leading characters of s, 0 for octal, 0x or
    0X for hexadecimal.  If base is 16, a preceding 0x or 0X is
    accepted.
 
    (t_int(R tbase((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pytatoiˆs cCs t||ƒS(s³atol(s [,base]) -> long
 
    Return the long integer represented by the string s in the
    given base, which defaults to 10.  The string s must consist
    of one or more digits, possibly preceded by a sign.  If base
    is 0, it is chosen from the leading characters of s, 0 for
    octal, 0x or 0X for hexadecimal.  If base is 16, a preceding
    0x or 0X is accepted.  A trailing L or l is not accepted,
    unless base is 0.
 
    (t_long(R Ri((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pytatol—s cGs|j||ŒS(sõljust(s, width[, fillchar]) -> string
 
    Return a left-justified version of s, in a field of the
    specified width, padded with spaces as needed.  The string is
    never truncated.  If specified the fillchar is used instead of spaces.
 
    (tljust(R twidthRP((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRm§scGs|j||ŒS(sörjust(s, width[, fillchar]) -> string
 
    Return a right-justified version of s, in a field of the
    specified width, padded with spaces as needed.  The string is
    never truncated.  If specified the fillchar is used instead of spaces.
 
    (trjust(R RnRP((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRo²scGs|j||ŒS(sîcenter(s, width[, fillchar]) -> string
 
    Return a center version of s, in a field of the specified
    width. padded with spaces as needed.  The string is never
    truncated.  If specified the fillchar is used instead of spaces.
 
    (tcenter(R RnRP((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRp½scCs+t|tƒst|ƒ}n|j|ƒS(s¡zfill(x, width) -> string
 
    Pad a numeric string x with zeros on the left, to fill a field
    of the specified width.  The string x is never truncated.
 
    (t
isinstancet
basestringtreprtzfill(R
Rn((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRtÊsicCs |j|ƒS(s×expandtabs(s [,tabsize]) -> string
 
    Return a copy of the string s with all tab characters replaced
    by the appropriate number of spaces, depending on the current
    column, and the tabsize (default 8).
 
    (t
expandtabs(R ttabsize((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRu×scCs;|s|dkr"|j||ƒS|j||d ƒSdS(sgtranslate(s,table [,deletions]) -> string
 
    Return a copy of the string s, where all characters occurring
    in the optional argument deletions are removed, and the
    remaining characters have been mapped through the given
    translation table, which must be a string of length 256.  The
    deletions argument is not allowed for Unicode strings.
 
    iN(RJt    translate(R ttablet    deletions((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRwâs
cCs
|jƒS(socapitalize(s) -> string
 
    Return a copy of the string s with only its first character
    capitalized.
 
    (R(R ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRõscCs|j|||ƒS(s÷replace (str, old, new[, maxreplace]) -> string
 
    Return a copy of string str with all occurrences of substring
    old replaced by new. If the optional argument maxreplace is
    given, only the first maxreplace occurrences are replaced.
 
    (treplace(R toldtnewt
maxreplace((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRzÿs(Rt    lowercaset    uppercaset
whitespacet    FormattercBsYeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
RS(    cOs|j|||ƒS(N(tvformat(R t format_stringRPtkwargs((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pytformat scCs;tƒ}|j||||dƒ}|j|||ƒ|S(Ni(tsett_vformattcheck_unused_args(R RƒRPR„t    used_argstresult((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR‚#s    c Csë|dkrtdƒ‚ng}xº|j|ƒD]©\}}}    }
|rY|j|ƒn|dk    r1|j|||ƒ\} } |j| ƒ|j| |
ƒ} |j|    ||||dƒ}    |j|j| |    ƒƒq1q1Wdj    |ƒS(NisMax string recursion exceedediR(
RtparsetappendRJt    get_fieldtaddt convert_fieldR‡t format_fieldR ( R RƒRPR„R‰trecursion_depthRŠt literal_textt
field_namet format_spect
conversiontobjtarg_used((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR‡)s    cCs)t|ttfƒr||S||SdS(N(Rqtinttlong(R R%RPR„((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyt    get_valueKscCsdS(N((R R‰RPR„((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRˆRscCs t||ƒS(N(R…(R tvalueR”((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRVscCsU|dkr|S|dkr&t|ƒS|dkr<t|ƒStdj|ƒƒ‚dS(NR trs"Unknown conversion specifier {0!s}(RJtstrRsRR…(R R›R•((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRZs  
 
cCs
|jƒS(N(t_formatter_parser(R Rƒ((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyR‹lsc    Csj|jƒ\}}|j|||ƒ}x6|D].\}}|rRt||ƒ}q.||}q.W||fS(N(t_formatter_field_name_splitRštgetattr(    R R“RPR„tfirsttrestR–tis_attrR((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRus( R'R(R…R‚R‡RšRˆRRR‹R(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyRs            "                        (((GR)R€R~Rtletterstascii_lowercasetascii_uppercaset ascii_letterstdigitst    hexdigitst    octdigitst punctuationt    printableRtchrtxrangetlRR RRJRRRtreR/RttypeR*R:Rt index_errort
atoi_errort
atof_errort
atol_errorRWRXRYRZR\R]R t splitfieldsR_t
joinfieldsRaRbRcRdRetfloatRfR˜RhR™RkRgRjRlRmRoRpRtRuRwRRztstropt ImportErrortobjectR(((sN/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/string.pyt<module>s|
 
      Z                    
 
                                   
                      
"