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
3

T'ícÏêã@s2dZddlZddlZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZddlmZddlmZmZddlmZddlmZdd	lmZdd
lmZmZm Z ddl!m"Z"ddl#m$Z$dd
l%m&Z&m'Z'ddl(m)Z)ddl*m+Z+m,Z,m-Z-m.Z.ddl/m0Z0ddl1m2Z2m3Z3ddl4m5Z5ddl4m6Z7ddl8m9Z9ddl:m;Z;ddl<m=Z=m>Z>m?Z?ddl@mAZAddlBmCZCddlDmEZEmFZFmGZGddlHmIZImJZJe;jKeLƒZMejNdejOƒZPe2dƒe2dƒe2dƒe2dƒe2d ƒe2d!ƒe2d"ƒd#œZQGd$d%„d%e
ƒZRGd&d'„d'e
ƒZSdkeTeUeeTeTeTeUfd)œd*d+„ZVdleTe0eUejd,œd-d.„ZWdmeTe0eed/œd0d1„ZXdneTe0ejYd2œd3d4„ZZeeTdd5œd6d7„Z[Gd8d9„d9ƒZ\Gd:d;„d;e\e=ƒZ]Gd<d=„d=e\e>ƒZ^Gd>d?„d?e\e?ƒZ_Gd@dA„dAe)eeTeTfƒZ`GdBdC„dCe`ƒZaGdDdE„dEeaƒZbGdFdG„dGe`ƒZcGdHdI„dIe`ƒZdGdJdK„dKe`ƒZeGdLdM„dMeeƒZfGdNdO„dOeeƒZgGdPdQ„dQeeƒZhGdRdS„dSe`ƒZiGdTdU„dUe`ƒZjGdVdW„dWƒZkGdXdY„dYeAƒZlGdZd[„d[eAƒZmGd\d]„d]e9ƒZne"eTeTedd^œd_d`„ZoGdadb„dbe,ƒZpGdcdd„dde+ƒZqe"e0eeedeœdfdg„Zre"e	eTefdhœdidj„ZsdS)ozThe Python domain.éN)Ú	Parameter)
ÚAnyÚDictÚIterableÚIteratorÚListÚ
NamedTupleÚOptionalÚTupleÚTypeÚcast)Únodes)ÚElementÚNode)Ú
directives)ÚInliner)Úaddnodes)Údesc_signatureÚpending_xrefÚpending_xref_condition)ÚSphinx)ÚBuilder)ÚRemovedInSphinx50WarningÚRemovedInSphinx60Warning)ÚObjectDescription)ÚDomainÚIndexÚ
IndexEntryÚObjType)ÚBuildEnvironment)Ú_Ú__)Úast)Úparse)ÚXRefRole)Úlogging)ÚFieldÚGroupedFieldÚ
TypedField)ÚSphinxDirective)Úsignature_from_str)Úfind_pending_xref_conditionÚmake_idÚmake_refnode)Ú
OptionSpecÚTextlikeNodea^ ([\w.]*\.)?            # class name(s)
          (\w+)  \s*             # thing name
          (?: \(\s*(.*)\s*\)     # optional: arguments
           (?:\s* -> \s* (.*))?  #           return annotation
          )? $                   # and nothing more
          ÚmoduleÚkeywordÚoperatorÚobjectÚ	exceptionÚ	statementzbuilt-in function)r0r1r2r3r4r5Úbuiltinc@seZdZUeeeedS)ÚObjectEntryN)	Ú__name__Ú
__module__Ú__qualname__ÚstrÚdocnameÚnode_idÚobjtypeÚboolÚaliased©rArAú7/tmp/pip-build-gk9425m9/sphinx/sphinx/domains/python.pyr7<s
r7c@s"eZdZUeeeee	dS)ÚModuleEntryN)
r8r9r:r;r<r=ÚsynopsisÚplatformr?Ú
deprecatedrArArArBrCCs

rCF)Ú	reftargetÚsuppress_prefixÚreturncCs¢d}|jdƒr$|dd…}|}d}nV|jdƒrJ|dd…}|jdƒd}n0|r^|jdƒd
}n|jdƒrv|dd…}n|}|d	ksŒ|jdƒr’d
}nd}||||fS)zLParse a type string and return (reftype, reftarget, title, refspecific flag)FÚ.éNTú~ztyping.éÚNoneÚobjÚclasséÿÿÿÿrQ)Ú
startswithÚsplit)rGrHÚrefspecificÚtitleÚreftyperArArBÚparse_reftargetKs"


rW)ÚtargetÚenvrHrIc	Cs’|r |jjdƒ|jjdƒdœ}ni}t||ƒ\}}}}|jjrj|jdƒd}td|ddtd|d	dg}ntj|ƒg}t	d
|žd
|||dœ|—ŽS)z0Convert a type string to a cross reference node.z	py:modulezpy:class)z	py:modulezpy:classrJrKÚÚresolved)Ú	conditionÚ*Úpy)Ú	refdomainrVrGrTrQ)rZ)
Úref_contextÚgetrWÚconfigÚ!python_use_unqualified_type_namesrSrr
ÚTextr)	rXrYrHÚkwargsrVrUrTÚ	shortnameÚ	contnodesrArArBÚtype_to_xreffs
rh)Ú
annotationrYrIc
stjttdœ‡fdd„‰|dkr2tjdtddy¸t|ƒ}g}x¦ˆ|ƒD]š}t|t	j
ƒrj|j|dƒqJt|t	jƒrÚ|j
ƒrÚ|rÄt|d
tjƒrÄ|djƒd
krÄ|jƒ|jtt|ƒ|ddƒqä|jtt|ƒ|ƒƒqJ|j|ƒqJW|Stk
rt||ƒgSXdS)zParse type annotation.)ÚnoderIcsDt|tjƒr,tjdˆ|jƒd|jfƒgSt|tjƒrfˆ|jƒ}|j	ˆ|j
ƒƒ|j	ˆ|jƒƒ|St|tjƒrŒt
jƒt
jddƒt
jƒgSt|tjƒr,|jtkr²t
jddƒgSt|jtƒrÒt
jdt|jƒƒgSt|jtƒrôt
jdt|jƒƒgSt|jtƒrt
jdt|jƒƒgStjt|jƒƒgSnt|tjƒrDˆ|jƒSt|tjƒr\ˆ|jƒSt|tjƒrxt
jddƒgSt|tjƒrt
jddƒg}|jrìx>|jD]4}|j	ˆ|ƒƒ|jt
jddƒƒ|jt
jƒƒq¤W|jƒ|jƒ|jt
jdd	ƒƒ|St|tj ƒr*t!‡fd
d„|j"DƒgƒSt|tj#ƒrFtj|j$ƒgSt|tj%ƒrèˆ|jƒ}|jt
jddƒƒ|j	ˆ|j&ƒƒ|jt
jdd	ƒƒ|ddkräxBt'|dd…ddD]*\}}t|tjƒr¶tj(dd|ƒ||<q¶W|St|tj)ƒr
ˆ|j
ƒˆ|j*ƒSt|tj+ƒr’|jrvg}x>|jD]4}|j	ˆ|ƒƒ|jt
jddƒƒ|jt
jƒƒq,W|jƒ|jƒnt
jddƒt
jddƒg}|St,j-dkr<t|tj.ƒrÀt
jdt|j/ƒƒgSt|tjƒrÜt
jddƒgSt|tj0ƒrøtj|jƒgSt|tj1ƒrt
jdt|j2ƒƒgSt|tj3ƒr<t
jdt|j/ƒƒgSt4‚dS)Nz%s.%srrZú|z...rLú[ú,ú]c3s|]}ˆ|ƒVqdS)NrA)Ú.0Úe)ÚunparserArBú	<genexpr>°sz5_parse_annotation.<locals>.unparse.<locals>.<genexpr>ÚLiteralútyping.LiteralrK)Ústartú(ú)éé)rsrt)rxry)5Ú
isinstancer"Ú	Attributer
rdÚvalueÚattrÚBinOpÚleftÚextendÚopÚrightÚBitOrrÚdesc_sig_spaceÚdesc_sig_punctuationÚConstantÚEllipsisr?Údesc_sig_keywordÚreprÚintZdesc_sig_literal_numberr;Zdesc_sig_literal_stringÚExprrÚInvertrÚeltsÚappendÚpopÚModuleÚsumÚbodyÚNameÚidÚ	SubscriptÚsliceÚ	enumerateÚliteralÚUnaryOpÚoperandr
ÚsysÚversion_infoÚBytesÚsÚNameConstantÚNumÚnÚStrÚSyntaxError)rjÚresultÚelemÚiZsubnode)rqrArBrq‚sœ 








z"_parse_annotation.<locals>.unparseNz=The env parameter for _parse_annotation becomes required now.é)Ú
stacklevelrrKrLT)rHrQrQ)r"ÚASTrrÚwarningsÚwarnrÚ	ast_parserzr
r˜rŽrdÚstriprr…Úastextrrhr;r£)rirYÚtreer¤rjrA)rqrBÚ_parse_annotation€s(\
r°)ÚarglistrYrIcCstj|ƒ}td|ƒ}d}x¼|jjƒD]¬}|j|jkr^||jkr^|tjddtjddƒƒ7}|j|j	kr–||j
|jdfkr–|tjddtjddƒƒ7}tjƒ}|j|jkrÎ|tjddƒ7}|tjd|j
ƒ7}nB|j|jkrþ|tjddƒ7}|tjd|j
ƒ7}n|tjd|j
ƒ7}|j|jk	rXt|j|ƒ}|tjddƒ7}|tjƒ7}|tjd|žŽ7}|j|jk	rÈ|j|jk	rž|tjƒ7}|tjddƒ7}|tjƒ7}n|tjddƒ7}|tjd|jd	gd
d7}||7}|j}q(W|tjkr|tjddtjddƒƒ7}|S)
z*Parse a list of arguments using AST parserz(%s)NrZú/r]z**ú:ú=Ú
default_valueF)ÚclassesZsupport_smartquotes)rZrZ)rÚdesc_parameterlistr*Ú
parametersÚvaluesÚkindÚPOSITIONAL_ONLYÚdesc_parameterZdesc_sig_operatorÚKEYWORD_ONLYÚPOSITIONAL_OR_KEYWORDÚVAR_POSITIONALÚ
desc_sig_nameÚnameÚVAR_KEYWORDriÚemptyr°r…r„Údefaultr
Úinliner)r±rYÚparamsÚsigZ	last_kindÚparamrjÚchildrenrArArBÚ_parse_arglistösH


rÊ)Úsignoder±rIcCsØtjƒ}|g}y„xj|jdƒD]Z}|jƒ}d}}x@|jdƒrv|jtjƒƒ|d
|d7<|dd…jƒ}q8Wx&|jdƒrž|jƒ|dd…jƒ}qzWx2|jdƒrÒ|jdƒrÒ|d7}|dd…jƒ}q¢Wx(|jdƒrü|d7}|dd
…jƒ}qÖW|r&|dtj	d	d	tj
||ƒƒ7<x6|r\|jtjƒƒ|d|d7<|d8}q(Wx|rz|jƒ|d8}q`Wq Wt|ƒdkr’t‚Wn6tk
rÊtjƒ}|tj	||ƒ7}||7}Yn
X||7}dS)zÿ"Parse" a list of arguments separated by commas.

    Arguments can have "optional" annotations given by enclosing them in
    brackets.  Currently, this will split at any comma, even if it's inside a
    string literal (e.g. default argument value).
    rmrrlr§rKNrnz[]rZéþÿÿÿrQrQrQrQrÌrQ)
rr·rSr­rRrŽZ
desc_optionalrÚendswithr¼rÀÚlenÚ
IndexError)rËr±Z	paramlistÚstackÚargumentZ	ends_openZ
ends_closerArArBÚ_pseudo_parse_arglist(sHrÒcsxeZdZejddddfeeeeeee	e
eedœ	‡fdd„
Zejddddfeeeeeee	e
eeedœ	dd„Z
‡ZS)ÚPyXrefMixinN)	ÚrolenameÚdomainrXÚ	innernodeÚcontnoderYÚinlinerÚlocationrIc	
sìtƒj||||||ddd}	t|	tƒrèd|	d<|jjdƒ|	d<|jjdƒ|	d<t|ƒ\}
}}}
||krŽ|
|	d<||	d<|	jƒ|	|||ƒ7}	nZ|jj	rè|	j
}|	jƒ|jdƒd}|d
|ƒ}td
d
|ddtd|žd
diŽg}|	j
|ƒ|	S)N)rØrÙTrTz	py:modulezpy:classrVrGrJrKrZr[)r\r\r]rQ)rZrZ)ÚsuperÚ	make_xrefrzrr`rarWÚclearrbrcrÉrSrr€)ÚselfrÔrÕrXrÖr×rYrØrÙr¤rVrGZreftitler rÉrfZtextnoderg)Ú	__class__rArBrÛ\s,


zPyXrefMixin.make_xrefc	Csªd}	tj|	ƒ}
tj|	|ƒ}t|o*|jƒ|kƒ}d}
g}xntd|ƒD]`}|rTtj|ƒ}|
sb|
j|ƒrx|j	|pr|||ƒƒn|j	|j
||||||||ƒƒ|dkrBd}
qBW|S)Nz8(\s*[\[\]\(\),](?:\s*or\s)?\s*|\s+or\s+|\s*\|\s*|\.\.\.)Frsútyping.LiteralT)rsrß)ÚreÚcompilerSr?r®Úfilterr
rdÚmatchrŽrÛ)rÝrÔrÕrXrÖr×rYrØrÙÚdelimsZ	delims_reZsub_targetsZsplit_contnodeZ
in_literalÚresultsZ
sub_targetrArArBÚ
make_xrefs}s 

zPyXrefMixin.make_xrefs)r8r9r:r
Zemphasisr;rr/rrrrÛrræÚ
__classcell__rArA)rÞrBrÓ[s,rÓc@seZdZdS)ÚPyFieldN)r8r9r:rArArArBrè™srèc@seZdZdS)ÚPyGroupedFieldN)r8r9r:rArArArBrésréc@seZdZdS)ÚPyTypedFieldN)r8r9r:rArArArBrê¡srêc@s.eZdZUdZejejejejejdœZee	de
dƒd<dd=dde	de
dƒd>dd?ddede
dƒdd@ddede
dƒd dAd#e
d$e
d%ƒd dBdd'gZd Zeeejd(œd)d*„Zed+œd,d-„Zeeeeefd.œd/d0„Zeeeefed1œd2d3„Zeeefeed4d5œd6d7„Zd4d+œd8d9„Zd4d+œd:d;„Zd4S)CÚPyObjectz¡
    Description of a general Python object.

    :cvar allow_nesting: Class is an object that allows for nested namespaces
    :vartype allow_nesting: bool
    )ÚnoindexÚnoindexentryr0Ú	canonicalriÚ	parameterZ
ParametersrÈÚargrÑr1ÚkwargÚkwparamrPÚ	paramtypeÚtypeT)ÚlabelÚnamesZtyperolenameZ	typenamesÚcan_collapseÚvariableÚ	VariablesÚvarÚivarÚcvarÚvartypeÚ
exceptionsZRaisesÚexcÚraisesÚraiser4Úexcept)rõrÔrör÷ZreturnvalueZReturnsFÚreturnsrI)rõÚhas_argröZ
returntypezReturn typeÚrtype)rõrröZbodyrolename)rÇrIcCsgS)zTMay return a prefix to put before the object name in the
        signature.
        rA)rÝrÇrArArBÚget_signature_prefixÉszPyObject.get_signature_prefix)rIcCsdS)zqMay return true if an empty argument list is to be generated even if
        the document contains none.
        FrA)rÝrArArBÚ
needs_arglistÏszPyObject.needs_arglist)rÇrËrIcCs tj|ƒ}|dkrt‚|jƒ\}}}}|jjd|jjjdƒƒ}|jjjdƒ}	|	r²d}
|rŽ||	ksn|j|	dƒrŽ||}|t	|	ƒd…j
dƒ}qÖ|r¤|	d||}qÖ|	d|}n$d}
|rÎ|jdƒ}	||}nd}	|}||d<|	|d	<||d
<|j|ƒ}|rRt
|ƒtkr8tjdj|ƒtƒ|tj|dtj|ƒƒ7}n|tjt|ƒdf|žŽ7}|rj|tj||ƒ7}n0|rš|
rš|jjjrš|d}
|tj|
|
ƒ7}|tj||ƒ7}|r&y|t||jƒ7}Wn^tk
rät||ƒYn@tk
r"}z"tj d|||d
t||ƒWYdd}~XnXn|j!ƒr<|tj"ƒ7}|rdt#||jƒ}|tj$|df|žŽ7}|jjdƒ}|r˜|tjd|dtj%ƒtj|ƒƒ7}||fS)aJTransform a Python signature into RST nodes.

        Return (fully qualified name of the thing, classname if any).

        If inside a class, the current class name is handled intelligently:
        * it is stripped from the displayed name if present
        * it is added to the full name (return value) if not present
        Nr0z	py:modulezpy:classFrJTrZrPÚfullnamez‹Python directive method get_signature_prefix() returning a string is deprecated. It must now return a list of nodes. Return value was '{}'.z could not parse arglist (%r): %s)rÙriú )&Ú	py_sig_rerãÚ
ValueErrorÚgroupsÚoptionsrarYr`rRrÎÚlstripÚrstriprrôr;rªr«ÚformatrrÚdesc_annotationr
rdÚdesc_addnamerbÚadd_module_namesZ	desc_namerÊr£rÒÚNotImplementedErrorÚloggerÚwarningrr·r°Zdesc_returnsr„)rÝrÇrËÚmÚprefixrÁr±ZretannÚmodnameÚ	classnameZ
add_modulerZ
sig_prefixZnodetextrÿrÉÚannorArArBÚhandle_signatureÕsx	






zPyObject.handle_signature)rrÁrIcCstdƒ‚dS)z2Return the text for the index entry of the object.z!must be implemented in subclassesN)r)rÝrrÁrArArBÚget_index_text2szPyObject.get_index_textN)Úname_clsrÇrËrIc
Cs|jjd|jjjdƒƒ}|r$|dnd|d}t|j|jjd|ƒ}|dj|ƒ||krv||jjjkrv|dj|ƒ|jjj	|ƒt
t|jjdƒƒ}|j
||j||d|jjd	ƒ}|rÐ|j
||j|d
|dd|jkr|j||ƒ}	|	r|jd
jd|	|ddfƒdS)Nr0z	py:modulerJrZrÚidsr^)rÙrîT)r@rÙríÚentriesÚsingle)r
rarYr`r,ÚstateÚdocumentrŽrÚnote_explicit_targetrÚPythonDomainÚ
get_domainÚnote_objectr>rÚ	indexnode)
rÝrrÇrËrrr=rÕÚcanonical_nameÚ	indextextrArArBÚadd_target_and_index6s"zPyObject.add_target_and_indexcCs¦d}|jr2|jd	\}}|jr$|}n|r2|jdƒ}|rb||jjd<|jrb|jjjdgƒ}|j|ƒd|jkr¢|jjjdgƒ}|j|jjjdƒƒ|jd|jjd<dS)
aHandle object nesting before content

        :py:class:`PyObject` represents Python language constructs. For
        constructs that are nestable, such as a Python classes, this method will
        build up a stack of the nesting hierarchy so that it can be later
        de-nested correctly, in :py:meth:`after_content`.

        For constructs that aren't nestable, the stack is bypassed, and instead
        only the most recent object is tracked. This object prefix name will be
        removed with :py:meth:`after_content`.
        NrKrJzpy:classz
py:classesr0z
py:modulesz	py:modulerQ)	röÚ
allow_nestingr­rYr`Ú
setdefaultrŽr
ra)rÝrrZname_prefixr¶ÚmodulesrArArBÚbefore_contentQs 


zPyObject.before_contentcCsš|jjjdgƒ}|jr8y|jƒWntk
r6YnXt|ƒdkrL|d	nd|jjd<d|jkr–|jjjdgƒ}|rˆ|jƒ|jjd<n|jjjdƒdS)
a^Handle object de-nesting after content

        If this class is a nestable object, removing the last nested class prefix
        ends further nesting in the object.

        If this class is not a nestable object, the list of classes should not
        be altered as we didn't affect the nesting levels in
        :py:meth:`before_content`.
        z
py:classesrrKNzpy:classr0z
py:modulesz	py:modulerQ)rYr`r-r,rrÏrÎr
)rÝr¶r.rArArBÚ
after_contentrs

zPyObject.after_content)rÈrïrðrÑr1rñrò)rórô)rúrûrü)rý)rrr4r)rrI)r)r8r9r:Ú__doc__rÚflagÚ	unchangedÚoption_specr.rêr rér&rèZdoc_field_typesr,r;rr
rrr?rrr
rrr+r/r0rArArArBrë¥s>


]!rëcs’eZdZUdZejjƒZeejde	j
iƒeee
jdœdd„Zedœdd„Zeeefeed	d
œ‡fdd„Zeeeefed
œdd„Z‡ZS)Ú
PyFunctionzDescription of a function.Úasync)rÇrIcCs&d|jkrtjddƒtjƒgSgSdS)Nr6rZ)r
rrˆr„)rÝrÇrArArBr”s


zPyFunction.get_signature_prefix)rIcCsdS)NTrA)rÝrArArBr›szPyFunction.needs_arglistN)rrÇrËrIc	s¤tƒj|||ƒd|jkr |jjd|jjjdƒƒ}|dd}|\}}|rvtdƒ||f}|jdjd||d	dfƒn*d
t	d|f}|jdjd||d	dfƒdS)
Nrír0z	py:modulerrz%s() (in module %s)r r!rZz%s; %s()r6Úpair)
rÚr+r
rarYr`r r(rŽÚpairindextypes)	rÝrrÇrËrr=rÁÚclsÚtext)rÞrArBr+žs
zPyFunction.add_target_and_index)rrrIcCsdS)NrA)rÝrrrArArBr­szPyFunction.get_index_text)r8r9r:r1rër4Úcopyr.Úupdaterr2r;rr
rrr?rr
rr+rrçrArA)rÞrBr5Œs
r5csVeZdZdZeedœ‡fdd„Zeee	eefdœ‡fdd„Z
edœdd	„Z‡Z
S)
ÚPyDecoratorFunctionzDescription of a decorator.)rIcsd|_tƒjƒS)Nzpy:function)rÁrÚÚrun)rÝ)rÞrArBr>µszPyDecoratorFunction.run)rÇrËrIcs&tƒj||ƒ}|jdtjddƒƒ|S)Nrú@)rÚrÚinsertrr)rÝrÇrËÚret)rÞrArBrºsz$PyDecoratorFunction.handle_signaturecCsdS)NFrA)rÝrArArBr¿sz!PyDecoratorFunction.needs_arglist)r8r9r:r1rrr>r;rr
rr?rrçrArA)rÞrBr=²sr=cspeZdZUdZejjƒZeeje	j
e	j
dœƒeee
eefdœ‡fdd„Zee
eefedœdd„Z‡ZS)	Ú
PyVariablezDescription of a variable.)rôr|)rÇrËrIc	sštƒj||ƒ\}}|jjdƒ}|rTt||jƒ}|tj|dtjddƒtj	ƒf|žŽ7}|jjdƒ}|r’|tj|dtj	ƒtjddƒtj	ƒt
j|ƒƒ7}||fS)NrôrZr³r|r´)rÚrr
rar°rYrrr…r„r
rd)rÝrÇrËrrÚtypÚannotationsr|)rÞrArBrÌs



zPyVariable.handle_signature)rrrIcCs,|\}}|rtdƒ||fStdƒ|SdS)Nz%s (in module %s)z%s (built-in variable))r )rÝrrrÁr9rArArBràszPyVariable.get_index_text)r8r9r:r1rër4r;r.r<rr3r;rr
rrrçrArA)rÞrBrBÃs
rBc@sdeZdZUdZejjƒZeejde	j
iƒdZee
ejdœdd„Zeeeefedœdd	„Zd
S)ÚPyClasslikezO
    Description of a class-like object (classes, interfaces, exceptions).
    ÚfinalT)rÇrIcCsDd|jkr,tjdƒtjƒtj|jƒtjƒgStj|jƒtjƒgSdS)NrF)r
r
rdrr„r>)rÝrÇrArArBrôs
z PyClasslike.get_signature_prefix)rrrIcCsL|jdkr2|stdƒ|dStdƒ|d|fS|jdkrD|dSdSdS)NrPz%s (built-in class)rz%s (class in %s)r4rZ)r>r )rÝrrrArArBrûs

zPyClasslike.get_index_textN)r8r9r:r1rër4r;r.r<rr2r,r;rr
rrr
rrArArArBrEès
rEc@s‚eZdZUdZejjƒZeeje	j
e	j
e	j
e	j
e	j
e	j
dœƒedœdd„Ze
eejdœdd„Ze
ee
e
fe
d	œd
d„ZdS)
ÚPyMethodzDescription of a method.)Úabstractmethodr6ÚclassmethodrFÚpropertyÚstaticmethod)rIcCsd|jkrdSdSdS)NrJFT)r
)rÝrArArBrs
zPyMethod.needs_arglist)rÇrIcCsøg}d|jkr,|jtjdƒƒ|jtjƒƒd|jkrT|jtjdƒƒ|jtjƒƒd|jkr||jtjdƒƒ|jtjƒƒd|jkr¤|jtjdƒƒ|jtjƒƒd|jkrÌ|jtjdƒƒ|jtjƒƒd|jkrô|jtjdƒƒ|jtjƒƒ|S)	NrFrHÚabstractr6rIrJrKZstatic)r
rŽr
rdrr„)rÝrÇrrArArBrs(





zPyMethod.get_signature_prefix)rrrIcCsÌ|\}}y0|jddƒ\}}|r6|jjjr6dj||gƒ}Wn0tk
rh|r\tdƒ||fSd|SYnXd|jkr„tdƒ||fSd|jkržtdƒ||fSd	|jkr¸td
ƒ||fStdƒ||fSdS)NrJrKz%s() (in module %s)z%s()rIz%s() (%s class method)rJz%s (%s property)rKz%s() (%s static method)z%s() (%s method))ÚrsplitrYrbrÚjoinrr r
)rÝrrrÁr9ÚclsnameZmethnamerArArBr/s 


zPyMethod.get_index_textN)r8r9r:r1rër4r;r.r<rr2r?rr;rr
rrr
rrArArArBrGs
rGcs:eZdZUdZejjƒZeee	dœ‡fdd„Z
‡ZS)Ú
PyClassMethodzDescription of a classmethod.)rIcsd|_d|jd<tƒjƒS)Nz	py:methodTrI)rÁr
rÚr>)rÝ)rÞrArBr>Js
zPyClassMethod.run)r8r9r:r1rër4r;r.rrr>rçrArA)rÞrBrPEs
rPcs:eZdZUdZejjƒZeee	dœ‡fdd„Z
‡ZS)ÚPyStaticMethodzDescription of a staticmethod.)rIcsd|_d|jd<tƒjƒS)Nz	py:methodTrK)rÁr
rÚr>)rÝ)rÞrArBr>Vs
zPyStaticMethod.run)r8r9r:r1rër4r;r.rrr>rçrArA)rÞrBrQQs
rQcsVeZdZdZeedœ‡fdd„Zeee	eefdœ‡fdd„Z
edœdd	„Z‡Z
S)
ÚPyDecoratorMethodz!Description of a decoratormethod.)rIcsd|_tƒjƒS)Nz	py:method)rÁrÚr>)rÝ)rÞrArBr>`szPyDecoratorMethod.run)rÇrËrIcs&tƒj||ƒ}|jdtjddƒƒ|S)Nrr?)rÚrr@rr)rÝrÇrËrA)rÞrArBrdsz"PyDecoratorMethod.handle_signaturecCsdS)NFrA)rÝrArArBriszPyDecoratorMethod.needs_arglist)r8r9r:r1rrr>r;rr
rr?rrçrArA)rÞrBrR]srRcspeZdZUdZejjƒZeeje	j
e	j
dœƒeee
eefdœ‡fdd„Zee
eefedœdd„Z‡ZS)	ÚPyAttributezDescription of an attribute.)rôr|)rÇrËrIc	sštƒj||ƒ\}}|jjdƒ}|rTt||jƒ}|tj|dtjddƒtj	ƒf|žŽ7}|jjdƒ}|r’|tj|dtj	ƒtjddƒtj	ƒt
j|ƒƒ7}||fS)NrôrZr³r|r´)rÚrr
rar°rYrrr…r„r
rd)rÝrÇrËrrrCrDr|)rÞrArBrvs 




zPyAttribute.handle_signature)rrrIcCsv|\}}y0|jddƒ\}}|r6|jjjr6dj||gƒ}Wn,tk
rd|r\tdƒ||fS|SYnXtdƒ||fS)NrJrKz%s (in module %s)z%s (%s attribute))rMrYrbrrNrr )rÝrrrÁr9rOÚattrnamerArArBr‹s
zPyAttribute.get_index_text)r8r9r:r1rër4r;r.r<rr3r;rr
rrrçrArA)rÞrBrSms
rScs„eZdZdZejjƒZejej	ej	ej
dœƒeee
eefdœ‡fdd„Zeeejdœdd„Zee
eefed	œd
d„Z‡ZS)Ú
PyPropertyzDescription of an attribute.)rHrIrô)rÇrËrIcs\tƒj||ƒ\}}|jjdƒ}|rTt||jƒ}|tj|dtjddƒtj	ƒf|žŽ7}||fS)NrôrZr³)
rÚrr
rar°rYrrr…r„)rÝrÇrËrrrCrD)rÞrArBr¤s


zPyProperty.handle_signature)rÇrIcCsvg}d|jkr,|jtjdƒƒ|jtjƒƒd|jkrT|jtjdƒƒ|jtjƒƒ|jtjdƒƒ|jtjƒƒ|S)NrHrLrIrPrJ)r
rŽr
rdrr„)rÝrÇrrArArBr±s

zPyProperty.get_signature_prefix)rrrIcCsv|\}}y0|jddƒ\}}|r6|jjjr6dj||gƒ}Wn,tk
rd|r\tdƒ||fS|SYnXtdƒ||fS)NrJrKz%s (in module %s)z%s (%s property))rMrYrbrrNrr )rÝrrrÁr9rOrTrArArBr¾s
zPyProperty.get_index_text)r8r9r:r1rër4r;r<rr2r3r;rr
rrr
rrrrçrArA)rÞrBrUšs


rUcs@eZdZdZeeeeefdœ‡fdd„Zedœdd„Z	‡Z
S)ÚPyDecoratorMixinz)
    Mixin for decorator directives.
    )rÇrËrIcshx@|jjD]$}|jdkr
tjd|tddPq
Wtjdtddtƒj||ƒ}|jdt	j
ddƒƒ|S)NZDirectiveAdapterzEPyDecoratorMixin is deprecated. Please check the implementation of %sr§)r¨zPyDecoratorMixin is deprecatedrr?)rÞÚ__mro__r8rªr«rrÚrr@rr)rÝrÇrËr9rA)rÞrArBrÑs


z!PyDecoratorMixin.handle_signature)rIcCsdS)NFrA)rÝrArArBràszPyDecoratorMixin.needs_arglist)r8r9r:r1r;rr
rr?rrçrArA)rÞrBrVÍsrVc@sbeZdZUdZdZdZdZdZdd„dd„ej	ej	dœZ
e
ee
d	œd
d„Zeedœd
d„ZdS)ÚPyModulez8
    Directive to mark description of a new module.
    FrKrcCs|S)NrA)ÚxrArArBÚ<lambda>îszPyModule.<lambda>cCs|S)NrA)rYrArArBrZïs)rErDrìrF)rIc
Cs,tt|jjdƒƒ}|jdjƒ}d|jk}||jjd<g}|s(t|j|j	j
d|ƒ}tjdd|gdd}|j
|ƒ|j|ƒ}||kr ||j	j
jkr |d	j|ƒ|j	j
j|ƒ|j|||jjd
dƒ|jjddƒd|jkƒ|j|d||d
|j|ƒdtd|f}tjd||ddfgd}	|j|	ƒ|S)Nr^rrìz	py:moduler0rZT)rZismodrrDrErF)rÙz%s; %sr7)r )rr%rYr&Ú	argumentsr­r
r`r,r"r#r
rXZset_source_infoÚmake_old_idrrŽr$Únote_modulerar'r8rÚindex)
rÝrÕrrìrAr=rXZold_node_idr*ÚinoderArArBr>ôs0




zPyModule.run)rÁrIcCsd|S)zÚGenerate old styled node_id.

        Old styled node_id is incompatible with docutils' node_id.
        It can contain dots and hyphens.

        .. note:: Old styled node_id was mainly used until Sphinx-3.0.
        z	module-%srA)rÝrÁrArArBr\szPyModule.make_old_idN)r8r9r:r1Úhas_contentÚrequired_argumentsÚoptional_argumentsÚfinal_argument_whitespacerr2r4r.rrr>r;r\rArArArBrXäs
$rXc@s<eZdZUdZdZdZdZdZiZe	e
edœdd„ZdS)	ÚPyCurrentModulezˆ
    This directive is just to tell Sphinx that we're documenting
    stuff in module foo, but links to module foo won't lead here.
    FrKr)rIcCs8|jdjƒ}|dkr(|jjjddƒn||jjd<gS)NrrNz	py:module)r[r­rYr`r)rÝrrArArBr>/s
zPyCurrentModule.runN)
r8r9r:r1r`rarbrcr4r.rrr>rArArArBrd#s
rdc@s,eZdZeeeeeeeefdœdd„ZdS)Ú
PyXRefRole)rYÚrefnodeÚhas_explicit_titlerUrXrIcCs¢|jjdƒ|d<|jjdƒ|d<|sv|jdƒ}|jdƒ}|dd…dkrv|dd…}|jdƒ}|d	krv||dd…}|dd…dkrš|dd…}d|d<||fS)
Nz	py:modulezpy:classrJrLrrKTrTrQ)r`rarÚrfind)rÝrYrfrgrUrXÚdotrArArBÚprocess_link9s


zPyXRefRole.process_linkN)	r8r9r:rrr?r;r
rjrArArArBre8sre)ÚapprÕr>ÚcontentrIcCs~|dkrdSxl|D]d}t|tjƒrtttj|ƒ}xB|D]:}ttj|dƒjƒjƒ}|dksf|j	dƒr8|j
|ƒPq8WqWdS)z+Filter ``:meta:`` field from its docstring.r^NrÚmetazmeta )rzr
Z
field_listrrÚfieldZ
field_bodyr®r­rRÚremove)rkrÕr>rlrjÚfieldsrnÚ
field_namerArArBÚfilter_meta_fieldsOs


rrc@sReZdZdZdZedƒZedƒZd	ee	e
ee
e	eefe
fdœdd„ZdS)
ÚPythonModuleIndexz<
    Index subclass to provide the Python module index.
    ZmodindexzPython Module Indexr.N)ÚdocnamesrIc
Cs¼i}|jjjd}t|tdd}t|jjdjƒdd„d}d}d	}xP|D]F\}\}}	}
}}|rn||krnqLx0|D]$}
|j|
ƒrt|t|
ƒd…}|
}PqtWd}|s®|d}}|j|d	j	ƒgƒ}|j
d
ƒd	}||krT||kr$|rN|d}t|d	d|d|d
|d|d|dƒ|d<n*|j|ƒsN|jt||ddddddƒƒd}n|d7}d	}|rnt
dƒnd}|jt|||||	|||
ƒƒ|}qLWt|ƒ||k}t|jƒƒ}||fS)NZmodindex_common_prefixT)ÚkeyÚreverser.cSs|djƒS)Nr)Úlower)rYrArArBrZosz,PythonModuleIndex.generate.<locals>.<lambda>)rurZrrJrKr§rxéééZ
DeprecatedrQrQ)rÕrYrbÚsortedrÎÚdataÚitemsrRr-rwrSrrŽr )rÝrtrlZignoresr.Zprev_modnameZ
num_toplevelsrr<r=rDÚ	platformsrFÚignoreÚstrippedr ÚpackageÚlastÚsubtypeZ	qualifierZcollapseZsorted_contentrArArBÚgenerategsL




zPythonModuleIndex.generate)N)r8r9r:r1rÁr Ú	localnamerfrr;r
rrr?r„rArArArBrs^srsc@s~eZdZUdZdZdZeedƒddƒeedƒddƒeedƒdd	dƒeed
ƒd	ddƒeedƒddƒeed
ƒddƒeedƒddƒeedƒddƒeedƒdddƒeedƒddƒdœ
Ze	e
efeee
e
eeeeeeeeedœ
Zeƒeƒeddeƒeƒeƒeddeƒeƒdœ	ZiidœZe	e
e	e
eeffegZee	e
e fdœdd„ƒZ!d@e
e
e
e"edd œd!d"„Z#ee	e
e$fdœd#d$„ƒZ%e
e
e
e
e"dd%œd&d'„Z&e
dd(œd)d*„Z'e(e
e	dd+œd,d-„Z)dAe*e
e
e
e
e+e(ee
e fd/œd0d1„Z,e*e
e-e
e
e.e/e0e/d2œd3d4„Z1e*e
e-e
e.e/e(ee
e/fd5œd6d7„Z2e-e
e
e3e/d8œd9d:„Z4e5ee
e
e
e
e
e+fdœd;d<„Z6e/e0e
d=œd>d?„Z7dS)Br%zPython language domain.r^ÚPythonÚfunctionÚfuncrOr|rPrÿr4ÚmethodÚmethzclass methodz
static methodÚ	attributer}rJÚ_propr0Úmod)
r‡r|rPr4r‰rIrKr‹rJr0)
r‡r|rPr4r‰rIrKr‹rJr0Z
currentmoduleZ	decoratorZdecoratormethodT)Z
fix_parens)	r|rÿrˆrPÚconstr}rŠrrO)Úobjectsr.)rIcCs|jjdiƒS)Nr)r|r-)rÝrArArBrÙszPythonDomain.objectsFN)rÁr>r=r@rÙrIcCsj||jkrN|j|}|jr$|dkr$n*|jdkr6|r6dStjtdƒ||j|dt|jj|||ƒ|j|<dS)zQNote a python object for cross reference.

        .. versionadded:: 2.1
        FNzWduplicate object description of %s, other instance in %s, use :noindex: for one of them)rÙ)rr@rrr!r<r7rY)rÝrÁr>r=r@rÙÚotherrArArBr'Ýs


zPythonDomain.note_objectcCs|jjdiƒS)Nr.)r|r-)rÝrArArBr.òszPythonDomain.modules)rÁr=rDrErFrIcCst|jj||||ƒ|j|<dS)zQNote a python module for cross reference.

        .. versionadded:: 2.1
        N)rCrYr<r.)rÝrÁr=rDrErFrArArBr]ös
zPythonDomain.note_module)r<rIcCs`x,t|jjƒƒD]\}}|j|kr|j|=qWx,t|jjƒƒD]\}}|j|kr>|j|=q>WdS)N)Úlistrr}r<r.)rÝr<rrOrrrArArBÚ	clear_docÿs

zPythonDomain.clear_doc)rtÚ	otherdatarIcCs`x,|djƒD]\}}|j|kr||j|<qWx,|djƒD]\}}|j|kr<||j|<q<WdS)Nrr.)r}r<rr.)rÝrtr“rrOrrrArArBÚmerge_domaindatas

zPythonDomain.merge_domaindatar)rYrrrÁrôÚ
searchmoderIc
sì|d	d…dkr|dd
…}|s$gSg}d}|dkr|dkrJtˆjƒ‰n
ˆj|ƒ‰ˆdk	rÊ|r˜|r˜|d|d|}	|	ˆjkr˜ˆj|	jˆkr˜|	}|sÊ|rÚ|d|ˆjkrڈj|d|jˆkrÚ|d|}nB|ˆjkoòˆj|jˆkrü|}n d|‰‡‡‡fdd„ˆjDƒ}n¬|ˆjkr0|}nš|dkr>gS|rf|d|ˆjkrf|d|}nd|rŽ|d|ˆjkrŽ|d|}n<|rÊ|rÊ|d|d|ˆjkrÊ|d|d|}|dk	rè|j|ˆj|fƒ|S)z’Find a Python object for "name", perhaps using the given module
        and/or classname.  Returns a list of (name, object entry) tuples.
        r§Nz()rKrJcs4g|],}|jˆƒrˆj|jˆkr|ˆj|f‘qSrA)rÍrr>)roZoname)ÚobjtypesÚ
searchnamerÝrArBú
<listcomp>3s
z)PythonDomain.find_obj.<locals>.<listcomp>rrÌrÌ)r‘Úobject_typesZobjtypes_for_rolerr>rŽ)
rÝrYrrrÁrôr•ÚmatchesZnewnamerrA)r–r—rÝrBÚfind_objsJ




zPythonDomain.find_obj)rYÚfromdocnameÚbuilderrôrXrjr×rIcCsB|jdƒ}|jdƒ}	|jdƒr"dnd}
|j|||	|||
ƒ}|r\|dkr\|j|||	|d|
ƒ}|r~|dkr~|j|||	|d|
ƒ}|s†dSt|ƒdkrÜd	d
„|Dƒ}t|ƒdkr²|}n*tjtdƒ|djd
d„|Dƒƒdd|d|d\}
}|ddkr|j|||
|ƒSt	|dƒ}|r|j
}n|g}t|||d|d||
ƒSdS)Nz	py:modulezpy:classrTrKrr}rŠrŒcSsg|]}|djs|‘qS)rK)r@)rorrArArBr˜asz-PythonDomain.resolve_xref.<locals>.<listcomp>z5more than one target found for cross-reference %r: %sz, css|]}|dVqdS)rNrA)rorãrArArBrrfsz,PythonDomain.resolve_xref.<locals>.<genexpr>ÚrefÚpython)rôrƒrÙr§r0r[)raÚhasattrr›rÎrrr!rNÚ_make_module_refnoder+rÉr-)rÝrYrœrrôrXrjr×rrOr•ršZ
canonicalsrÁrOrlrÉrArArBÚresolve_xrefHs4



zPythonDomain.resolve_xref)rYrœrrXrjr×rIc
Cs¸|jdƒ}|jdƒ}g}	|j||||ddƒ}
x†|
D]~\}}|ddkrb|	jd|j||||ƒfƒq2t|dƒ}
|
rx|
j}n|g}|	jd|j|dƒt|||d	|d||ƒfƒq2W|	S)
Nz	py:modulezpy:classrKr§r0zpy:modr[zpy:r)rar›rŽr¡r+rÉZrole_for_objtyper-)rÝrYrœrrXrjr×rrOråršrÁrOrlrÉrArArBÚresolve_any_xrefws"


zPythonDomain.resolve_any_xref)rrœrÁr×rIcCsb|j|}|}|jr"|d|j7}|jr4|tdƒ7}|jrL|d|jd7}t|||j|j||ƒS)Nz: z
 (deprecated)z (rw)r.rDrFr rEr-r<r=)rÝrrœrÁr×r0rUrArArBr¡“s
z!PythonDomain._make_module_refnodeccsŒx,|jjƒD]\}}||d|j|jdfVqWxX|jjƒD]J\}}|jdkr:|jrl|||j|j|jdfVq:|||j|j|jdfVq:WdS)Nr0rrKrQ)r.r}r<r=rr>r@)rÝrrZrefnamerOrArArBÚget_objects¡s
zPythonDomain.get_objects)rjrIcCsD|jdƒ}|jdƒ}|jdƒ}|dkr*dSdjtd|||gƒƒSdS)Nz	py:modulezpy:classrGrJ)rarNrâ)rÝrjrrOrXrArArBÚget_full_qualified_name¬s


z$PythonDomain.get_full_qualified_name)FN)r)8r8r9r:r1rÁrõrr r™rr;r5rBrErGrPrQrSrUrXrdr=rRrreZrolesZinitial_datar
rrsÚindicesrJr7rr?r'rCr.r]r’rr”rrŠr›rrrr	r¢r£rr¡rr¤r¥rArArArBr%¦sv
 
 
6-
"r%)rkrYrjr×rIcCs€ttdœdd„}|jdƒdkr"dS|jdƒd
krB|jd
ƒdkrB|S|jdƒdkr||jd
ƒ}tjtt|dƒƒrp|S||ƒr||SdS)z1Do not emit nitpicky warnings for built-in types.)ržrIcSs$|jdƒr|jddƒd}|tjkS)Nztyping.rJrK)rRrSÚtypingÚ__all__)ržrArArBÚistyping¹s
z"builtin_resolver.<locals>.istypingr_r^NrVrPrOrGrNrÿ)rPrO)rPrOrÿ)r;r?raÚinspectÚisclassÚgetattrÚbuiltins)rkrYrjr×r©rGrArArBÚbuiltin_resolver¶s
r®)rkrIcCsL|jdƒ|jtƒ|jdddƒ|jdtƒ|jdtddd	d
dddœS)
Nzsphinx.directivesrcFrYzobject-description-transformzmissing-referencei„)Úpriorityr6rxT)ÚversionZenv_versionZparallel_read_safeZparallel_write_safe)Zsetup_extensionZ
add_domainr%Zadd_config_valueÚconnectrrr®)rkrArArBÚsetupÏs

r²)F)NF)N)N)tr1r­rªràr›r§rªrrrrrrrr	r
rrZdocutilsr
Zdocutils.nodesrrZdocutils.parsers.rstrZdocutils.parsers.rst.statesrZsphinxrZsphinx.addnodesrrrZsphinx.applicationrZsphinx.buildersrZsphinx.deprecationrrZsphinx.directivesrZsphinx.domainsrrrrZsphinx.environmentrZ
sphinx.localer r!Zsphinx.pycode.astr"r#r¬Zsphinx.rolesr$Zsphinx.utilr%Zsphinx.util.docfieldsr&r'r(Zsphinx.util.docutilsr)Zsphinx.util.inspectr*Zsphinx.util.nodesr+r,r-Zsphinx.util.typingr.r/Ú	getLoggerr8rráÚVERBOSEr
r8r7rCr;r?rWrhr°r·rÊrÒrÓrèrérêrër5r=rBrErGrPrQrRrSrUrVrXrdrerrrsr%r®r²rArArArBÚ<module>sš0

v23>h&%?-3?H