zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
U
^±daHã9@s| ddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
dddddddd    d
d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:g9Z d;Z e ZeƒZefd<d=„Zejd>krôd?d@„ZnejdAkr
dBd@„ZndCd@„ZdçdDdE„Ze    jZe     dF¡Ze     dG¡Ze     dH¡Ze    jdId;dJZe    jdKd;dLZejdMkrvddNl    mZn"GdOdP„dPe ƒZGdQd„dedRZe    jZee    dƒrÆejddS…dTkrÆe    j Z n"GdUdV„dVe    j!d;dWZ"e"ddXdYZ ejdMkrüe    j#Z#ndZd%„Z#d[d)„Z$ee    d+ƒr e    j%Z%n"Gd\d]„d]e    j!d;dWZ&e&d+d^dYZ%e    j'Z'ee    d$ƒrhe    j(Z(e    j)Z)e    j*Z*n,e +e ,ej+e-¡¡Z.d_d-„Z(d`d$„Z)dad!„Z*e    j/Z/e    j0Z0e    j1Z1e    j2Z2e    j3Z3e    j4Z4e    j5Z5e    j6Z6e    j7Z7ee    dƒrÞe    j8Z8ne     9ej8eef¡Z8e    j:Z:e    j;Z;e    j<Z<e    j=Z=e    j>Z>e    j?Z?dbddcdddddedfdgdhdiddg Z@djdk„ZAdldm„ZBdndo„ZCee    d/ƒr^e    jDZDn,dpdq„ZEGdrds„dsejFƒZGGdtd/„d/eGdRZDee    d2ƒrže    jHZHndud2„ZHeHZIee    dƒr¾e    jJZJneHGdvd„deDƒƒZJee    d9ƒròe    jKZKe    jLZLe    jMZMnŒdwdx„ZNdydz„ZOd{eO_Pd;d|œd}d~„ZQdeQ_Pd€e Re    jS¡jTkZUGdd‚„d‚e ƒZLeLde-fiƒZKeVeK_WdƒeK_Xee    d‚ƒrpe    jLeLfZYneLfZYd„d*„ZMee    d ƒr’e    jZZZnd…d „ZZee    d9ƒr®e    j[Z[n"ddlZddlZd†d‡„Z\dèd‰d(„Z[ee    dƒrêe    j]Z]e    j^Z^n$GdŠd‹„d‹e    j_d;dWZ^GdŒd„dƒZ]ejddS…d>kr0e    j`Z`e    jaZanlzddl    mbZbWneck
r\e    j_ZbYnXzddŽl    mdZeWneck
rŠe    j_ZeYnXdd'„Z`dd&„Zaee    d4ƒr°e    jfZfnZejddS…dAkrèGd‘d’„d’e    j!d;dWZgegd“d4„ƒZfn"Gd”d’„d’e    j!d;dWZgegd4d•dYZfGd–d—„d—ƒZhGd˜d „d e    jehd;dWZee    dƒrJe    jiZie    jjZjn.Gd™dš„dšƒZkGd›d„dekƒZiGdœd    „d    ekƒZjee    dƒržGdd„de    jlehd;dWZlnGdžd„demehƒZlee    dƒsÌGdŸd „d emƒZne    jod¡d¢„ƒZpee    dƒrôe    jqZqe    jnZnnDejddS…dAkregd£d„ƒZqn"Gd¤d¥„d¥e    j!d;dWZrerdd¦dYZqee    d5ƒrLe    jsZsnZejddS…dAkr„Gd§d¨„d¨e    j!d;dWZtetd©d5„ƒZsn"Gdªd¨„d¨e    j!d;dWZtetd5d«dYZsGd¬d­„d­e    jud;dWZ!ee    dƒrÐe    jvZvn e!d®d„ƒZvee    d
ƒrðe    jwZwn e!d¯d
„ƒZwee    d7ƒre    jxZxn e!d°d7„ƒZxee    d9ƒr6e    jyZye    jzZznrejddS…dAkrzGd±d²„d²e    j!d;dWZ{e{d³d9„ƒZye{d´d:„ƒZzn.Gdµd¶„d¶e    j!d;dWZ|e|d9d·dYZye|d:d¸dYZzee    dƒr¼e    j}Z}n–ejddS…dAk    rGd¹dº„dºe    j!d;dWZ~Gd»d¼„d¼e    j_d;dWZe~d½d„ƒZ}d¾d¿„Z€n@GdÀd¼„d¼e    j_d;dWZGdÁd„dÂe    j!d;dWZeddÃdYZ}dÄd¿„Z€ee    d ƒ    rxGdÅd „d e    j‚ehd;dWZ‚nGdÆd „d ehƒZ‚ee    d0ƒ    rœe    jƒZƒneedǜdÈd0„Zƒee    dƒ    rÀe    j„Z„nexexdɜdÊd„Z„ejdËk    räe    j…Z…n^d;dˆdˆdˆdÌd͜e†e†e†e†e    j‡e    jˆe    j/e    je    j‰dÎe    jffdÎfe    je    j‰egefdϜdÐd"„Z…ee    d.ƒ
rVe    jŠZŠn*e    jdÑe    j‰dÎe    jfdҍZ‹e‹e‹dɜdÓd.„ZŠee    d#ƒ
r”e    jŒZŒn>e     dÔ¡ZeŽdÕd֜ee    je    j/e‘e’e    j‰egefdלdØd#„ZŒee    d ƒ
sêee    _ee    _ejdMk
rþe    j“Z“nzdÙdڄZ”dédÛd܄Z•e    j–Z—e˜dÝdÞdßhƒZ™Gdàdá„dáe ƒZšdêdâd„Z“e    j“jXe“_Xe  ›ešddÌi¡Zœejdãk rjdäe“_Pdådæ„Zee“_ždS)ëéNÚAnyÚClassVarÚ ConcatenateÚFinalÚ LiteralStringÚ    ParamSpecÚ ParamSpecArgsÚParamSpecKwargsÚSelfÚTypeÚTypeVarÚ TypeVarTupleÚUnpackÚ    AwaitableÚ AsyncIteratorÚ AsyncIterableÚ    CoroutineÚAsyncGeneratorÚAsyncContextManagerÚChainMapÚContextManagerÚCounterÚDequeÚ DefaultDictÚ
NamedTupleÚ OrderedDictÚ    TypedDictÚ SupportsIndexÚ    AnnotatedÚ assert_neverÚ assert_typeÚclear_overloadsÚdataclass_transformÚ
deprecatedÚ get_overloadsÚfinalÚget_argsÚ
get_originÚget_type_hintsÚIntVarÚ is_typeddictÚLiteralÚNewTypeÚoverloadÚoverrideÚProtocolÚ reveal_typeÚruntimeÚruntime_checkableÚTextÚ    TypeAliasÚ    TypeGuardÚ TYPE_CHECKINGÚNeverÚNoReturnÚRequiredÚ NotRequiredTc    CsÆ|st|›dƒ‚|tkrBt|dƒr*|js8t|›dƒ‚t|jƒ}t|ƒ}||krÂt|dƒr–dd„|jDƒ}tdd„|Dƒƒ}|dkr–|||kr–dStd    ||kr¦d
nd ›d |›d |›d|›ƒ‚dS)zŠCheck correct count for parameters of a generic cls (internal helper).
    This gives a nice error message in case of count mismatch.
    z is not a generic classÚ__parameters__cSsg|]}t|ƒs|‘qS©)Ú
_is_unpack©Ú.0Úpr<r<úHd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\typing_extensions.pyÚ
<listcomp>isz"_check_generic.<locals>.<listcomp>css|]}t|tƒVqdS©N)Ú
isinstancer r>r<r<rAÚ    <genexpr>jsz!_check_generic.<locals>.<genexpr>rNzToo ÚmanyÚfewz parameters for z    ; actual z , expected )Ú    TypeErrorÚ_markerÚhasattrr;ÚlenÚsum)ÚclsÚ
parametersÚelenÚalenZ num_tv_tuplesr<r<rAÚ_check_generic\s
 
rQ)éé
cCst|tjtjtjfƒSrC)rDÚtypingÚ _GenericAliasÚ_typesÚ GenericAliasÚ    UnionType©Útr<r<rAÚ_should_collect_from_parametersrsÿr[©rRé    cCst|tjtjfƒSrC)rDrTrUrVrWrYr<r<rAr[wscCst|tjƒo|j SrC)rDrTrUÚ_specialrYr<r<rAr[zscsj|dkrtj}g‰|D]J}t||ƒr>|ˆkr>t|ƒs>ˆ |¡t|ƒrˆ ‡fdd„|jDƒ¡qtˆƒS)z®Collect all type variable contained in types in order of
    first appearance (lexicographic order). For example::
 
        _collect_type_vars((T, List[S, T])) == (T, S)
    Ncsg|]}|ˆkr|‘qSr<r<©r?rZ©Útvarsr<rArBsz&_collect_type_vars.<locals>.<listcomp>)    rTr rDr=Úappendr[Úextendr;Útuple)ÚtypesZ typevar_typesrZr<r`rAÚ_collect_type_vars~sÿþý
rfÚTÚKTÚVTÚT_co)Ú    covariantÚT_contra)Ú contravariant)rRé )rcs(eZdZ‡fdd„Z‡fdd„Z‡ZS)Ú_AnyMetacs|tkrtdƒ‚tƒ |¡S)Nz6typing_extensions.Any cannot be used with isinstance())rrHÚsuperÚ__instancecheck__©ÚselfÚobj©Ú    __class__r<rArq£sz_AnyMeta.__instancecheck__cs|tkr dStƒ ¡S)Nztyping_extensions.Any)rrpÚ__repr__©rsrur<rArw¨sz_AnyMeta.__repr__)Ú__name__Ú
__module__Ú __qualname__rqrwÚ __classcell__r<r<rurAro¢s rocs eZdZdZ‡fdd„Z‡ZS)raqSpecial type indicating an unconstrained type.
        - Any is compatible with every type.
        - Any assumed to have all methods.
        - All values assumed to be instances of Any.
        Note that all the above statements are true from the point of view of
        static type checkers. At runtime, Any should not be used with instance
        checks.
        cs$|tkrtdƒ‚tƒj|f|ž|ŽS)NzAny cannot be instantiated)rrHrpÚ__new__©rMÚargsÚkwargsrur<rAr}¶sz Any.__new__)ryrzr{Ú__doc__r}r|r<r<rurAr­s)Ú    metaclassé)rRéc@seZdZdd„Zdd„ZdS)Ú
_FinalFormcCs
d|jS©Nztyping_extensions.©Ú_namerxr<r<rArwÆsz_FinalForm.__repr__cCs"t ||j›d¡}t ||f¡S©Nú accepts only a single type.©rTÚ _type_checkrˆrU©rsrNÚitemr<r<rAÚ __getitem__És
ÿz_FinalForm.__getitem__N©ryrzr{rwrr<r<r<rAr…Äsr…)Ú_rootaWA special typing construct to indicate that a name
                       cannot be re-assigned or overridden in a subclass.
                       For example:
 
                           MAX_SIZE: Final = 9000
                           MAX_SIZE += 1  # Error reported by type checker
 
                           class Connection:
                               TIMEOUT: Final[int] = 10
                           class FastConnector(Connection):
                               TIMEOUT = 1  # Error reported by type checker
 
                       There is no runtime checking of these properties.)Údocc    Cs(z
d|_Wnttfk
r"YnX|S)aøThis decorator can be used to indicate to type checkers that
        the decorated method cannot be overridden, and decorated class
        cannot be subclassed. For example:
 
            class Base:
                @final
                def done(self) -> None:
                    ...
            class Sub(Base):
                def done(self) -> None:  # Error reported by type checker
                    ...
            @final
            class Leaf:
                ...
            class Other(Leaf):  # Error reported by type checker
                ...
 
        There is no runtime checking of these properties. The decorator
        sets the ``__final__`` attribute to ``True`` on the decorated object
        to allow runtime introspection.
        T)Z    __final__ÚAttributeErrorrH)Úfr<r<rAr%ãs
 
cCs
t |¡SrC)rTr )Únamer<r<rAr)sc@seZdZdd„Zdd„ZdS)Ú _LiteralFormcCs
d|jSr†r‡rxr<r<rArwsz_LiteralForm.__repr__cCs t ||¡SrC)rTrU©rsrNr<r<rArsz_LiteralForm.__getitem__Nrr<r<r<rAr– sr–aoA type that can be used to indicate to type checkers
                           that the corresponding value has a value literally equivalent
                           to the provided parameter. For example:
 
                               var: Literal[4] = 4
 
                           The type checker understands that 'var' is literally equal to
                           the value 4 and no other value.
 
                           Literal[...] cannot be subclassed. There is no runtime
                           checking verifying that the parameter is actually a value
                           instead of a type.cCsBt|d|ƒ}z|t|j|j|jj<Wntk
r<YnXtS)a¬Decorator for overloaded functions/methods.
 
        In a stub file, place two or more stub definitions for the same
        function in a row, each decorated with @overload.  For example:
 
        @overload
        def utf8(value: None) -> None: ...
        @overload
        def utf8(value: bytes) -> bytes: ...
        @overload
        def utf8(value: str) -> bytes: ...
 
        In a non-stub file (i.e. a regular .py file), do the same but
        follow it with an implementation.  The implementation should *not*
        be decorated with @overload.  For example:
 
        @overload
        def utf8(value: None) -> None: ...
        @overload
        def utf8(value: bytes) -> bytes: ...
        @overload
        def utf8(value: str) -> bytes: ...
        def utf8(value):
            # implementation goes here
 
        The overloads for a function can be retrieved at runtime using the
        get_overloads() function.
        Ú__func__)ÚgetattrÚ_overload_registryrzr{Ú__code__Úco_firstlinenor“Ú_overload_dummy)Úfuncr”r<r<rAr-0s þÿcCsDt|d|ƒ}|jtkrgSt|j}|j|kr2gSt||j ¡ƒS)z6Return all defined overloads for *func* as a sequence.r˜)r™rzršr{ÚlistÚvalues)ržr”Úmod_dictr<r<rAr$Xs 
 
 
cCs t ¡dS)z$Clear all overloads in the registry.N)ršÚclearr<r<r<rAr!csÚCallableÚIterableÚIteratorÚHashableÚSizedÚ    ContainerÚ
CollectionÚ
ReversiblecCsrtƒ}|jdd…D]X}|jdkr$qt|diƒ}t|j ¡ƒt| ¡ƒD] }| d¡sJ|dkrJ| |¡qJq|S)Néÿÿÿÿ)r/ÚGenericÚ__annotations__Ú_abc_)Ú__abstractmethods__r­Ú __weakref__Ú _is_protocolÚ_is_runtime_protocolÚ__dict__Ú__args__Ú    __slots__Z__next_in_mro__r;Ú
__origin__Ú__orig_bases__Z    __extra__Z __tree_hash__rÚ__subclasshook__Ú__init__r}rzÚ_MutableMapping__markerZ_gorg)    ÚsetÚ__mro__ryr™rŸr³ÚkeysÚ
startswithÚadd)rMÚattrsÚbaseÚ annotationsÚattrr<r<rAÚ_get_protocol_attrss
 rÄcst‡fdd„tˆƒDƒƒS)Nc3s|]}ttˆ|dƒƒVqdSrC)Úcallabler™©r?rérMr<rArE¡sz,_is_callable_members_only.<locals>.<genexpr>)ÚallrÄrÇr<rÇrAÚ_is_callable_members_only srÉcsäg}d|jkrÖt |j¡}d}|jD]>}t|tjƒr$|jtjtfkr$|jj    }|dk    r\t
dƒ‚|j }q$|dkrr|}ndt |ƒ}t |ƒ‰|ˆksÒd  ‡fdd„|Dƒ¡}d  dd„|Dƒ¡}t
d|›d    |›d
|›d ƒ‚|}t|ƒ|_ dS) zÞHelper function used in Protocol.__init_subclass__ and _TypedDictMeta.__new__.
 
    The contents of this function are very similar
    to logic found in typing.Generic.__init_subclass__
    on the CPython main branch.
    r·NzECannot inherit from Generic[...] and/or Protocol[...] multiple types.ú, c3s|]}|ˆkrt|ƒVqdSrC©Ústrr_©Úgvarsetr<rArEÄsz+_maybe_adjust_parameters.<locals>.<genexpr>css|]}t|ƒVqdSrCrË)r?Úgr<r<rArEÅszSome type variables (z) are not listed in ú[ú])r³rTrfr·rDrUr¶r¬r/ryrHr;r»Újoinrd)rMraÚgvarsrÁZthe_baseÚtvarsetÚs_varsÚs_argsr<rÍrAÚ_maybe_adjust_parameters¤s0
 
 ÿÿr×cOst|ƒjrtdƒ‚dS)Nz Protocols cannot be instantiated)Útyper±rH©rsrr€r<r<rAÚ_no_initÒs
rÚcseZdZ‡fdd„Z‡ZS)Ú _ProtocolMetacsVtˆddƒrtˆƒr$tˆjˆƒr$dSˆjrJt‡‡fdd„tˆƒDƒƒrJdStƒ ˆ¡S)Nr±FTc3s8|]0}tˆ|ƒo.ttˆ|dƒƒ p.tˆ|ƒdk    VqdSrC)rJrÅr™rÆ©rMÚinstancer<rArEásý
z2_ProtocolMeta.__instancecheck__.<locals>.<genexpr>)    r™rÉÚ
issubclassrvr±rÈrÄrprqrÜrurÜrArqÙs ÿ
þýz_ProtocolMeta.__instancecheck__)ryrzr{rqr|r<r<rurArÛÖsrÛcs>eZdZdZdZdZ‡fdd„Zejdd„ƒZ    dd    „Z
‡Z S)
r/a£Base class for protocol classes. Protocol classes are defined as::
 
            class Proto(Protocol):
                def meth(self) -> int:
                    ...
 
        Such classes are primarily used with static type checkers that recognize
        structural subtyping (static duck-typing), for example::
 
            class C:
                def meth(self) -> int:
                    return 0
 
            def func(x: Proto) -> int:
                return x.meth()
 
            func(C())  # Passes static type check
 
        See PEP 544 for details. Protocol classes decorated with
        @typing_extensions.runtime act as simple-minded runtime protocol that checks
        only the presence of given attributes, ignoring their type signatures.
 
        Protocol classes can be generic, they are defined as::
 
            class GenProto(Protocol[T]):
                def meth(self) -> T:
                    ...
        r<Tcs|tkrtdƒ‚tƒ |¡S)NzIType Protocol cannot be instantiated; it can only be used as a base class)r/rHrpr})rMrÚkwdsrur<rAr} szProtocol.__new__csÚt|tƒs|f}|s0|tjk    r0td|j›dƒ‚d‰t‡fdd„|Dƒƒ}|tkr¼tdd„|Dƒƒsžd}t||tjƒr‚|d7}qhtd    |d›d
||›ƒ‚t    t
|ƒƒt    |ƒkrÎtd ƒ‚nt ||t    |j ƒƒt  ||¡S) NzParameter list to z[...] cannot be emptyz*Parameters to generic types must be types.c3s|]}t |ˆ¡VqdSrC©rTrŒr>©Úmsgr<rArEsz-Protocol.__class_getitem__.<locals>.<genexpr>css|]}t|tjƒVqdSrC)rDrTr r>r<r<rArEsrézBParameters to Protocol[...] must all be type variables. Parameter z is z.Parameters to Protocol[...] must all be unique)rDrdrTÚTuplerHr{r/rÈr rKr»rQr;rU)rMÚparamsÚir<rárAÚ__class_getitem__s,
 ÿ
ÿÿzProtocol.__class_getitem__csÜdˆjkrtjˆjk}n tjˆjk}|r0tdƒ‚tˆƒˆj dd¡s\tdd„ˆjDƒƒˆ_    ‡fdd„}dˆjkrx|ˆ_
ˆj    s‚dSˆjD]H}|t tjfksˆ|j d    kr®|j tksˆt|tƒr¾|j    sˆtd
t|ƒ›ƒ‚qˆtˆ_dS) Nr·z!Cannot inherit from plain Genericr±css|]}|tkVqdSrC)r/)r?Úbr<r<rArE6sz-Protocol.__init_subclass__.<locals>.<genexpr>csúˆj dd¡stStˆddƒs>t d¡jddkr6tStdƒ‚tˆƒsft d¡jddkr^tStdƒ‚t    |t
ƒsxtd    ƒ‚t ˆƒD]t}|j D]`}||jkr¶|j|dkr²tSq€t|d
iƒ}t    |t jƒrŠ||krŠt    |tƒrŠ|jrŠq€qŠtSq€d S) Nr±r²Frƒry)ÚabcÚ    functoolszBInstance and class checks can only be used with @runtime protocolsz<Protocols with non-method members don't support issubclass()z"issubclass() arg 1 must be a classr­T)r³ÚgetÚNotImplementedr™ÚsysÚ    _getframeÚ    f_globalsrHrÉrDrØrÄr¼rTÚMappingrÛr±)ÚotherrÃrÁrÂrÇr<rAÚ _proto_hook9s: 
 
 
   ÿþý
z/Protocol.__init_subclass__.<locals>._proto_hookr¸zcollections.abcz5Protocols can only inherit from other protocols, got )r³rTr¬r·Ú    __bases__rHr×rëÚanyr±r¸ÚobjectrzryÚ_PROTO_WHITELISTrDrÛÚreprrÚr¹)rMrr€ÚerrorròrÁr<rÇrAÚ__init_subclass__+s2
 
 
ÿþýýzProtocol.__init_subclass__) ryrzr{rrµr±r}rTÚ    _tp_cacherçrùr|r<r<rurAr/ès 
cCs(t|tƒr|jstd|›ƒ‚d|_|S)a4Mark a protocol class as a runtime protocol, so that it
        can be used with isinstance() and issubclass(). Raise TypeError
        if applied to a non-protocol class.
 
        This allows a simple-minded structural check very similar to the
        one-offs in collections.abc such as Hashable.
        z@@runtime_checkable can be only applied to protocol classes, got T)rDrÛr±rHr²rÇr<r<rAr2osc@s$eZdZdZejedœdd„ƒZdS)rr<)ÚreturncCsdSrCr<rxr<r<rAÚ    __index__‹szSupportsIndex.__index__N)ryrzr{rµréÚabstractmethodÚintrür<r<r<rAr‡sc    Cs>z t d¡jddkrtdƒ‚Wnttfk
r8YnXdS)Nrãry)rérêrTz4TypedDict does not support instance and class checksF)rírîrïrHr“Ú
ValueError)rMrñr<r<rAÚ _check_failsœs  rcOs,|s tdƒ‚|d|dd…}}t||ŽS)Nú)TypedDict.__new__(): not enough argumentsrrã)rHÚdict)rr€Ú_r<r<rAÚ    _dict_new§srz,($cls, _typename, _fields=None, /, **kwargs)©Útotalc    Os\|s tdƒ‚|d|dd…}}|r>|d|dd…}}n4d|krj| d¡}ddl}|jdtddntdƒ‚|r°z
|\}Wqìtk
r¬td    t|ƒd›d
ƒ‚YqìXn<d |krèt|ƒdkrè| d ¡}ddl}|jd tddnd}|dkrú|}n|rtd ƒ‚dt|ƒi}zt     d¡j
  dd¡|d<Wnt tfk
rJYnXt |d||dS)NrrrãZ    _typenamez5Passing '_typename' as keyword argument is deprecatedrƒ)Ú
stacklevelzGTypedDict.__new__() missing 1 required positional argument: '_typename'z?TypedDict.__new__() takes from 2 to 3 positional arguments but z  were givenÚ_fieldsz3Passing '_fields' as keyword argument is deprecatedz@TypedDict takes either a dict or keyword arguments, but not bothr­ryÚ__main__rzr<r)rHÚpopÚwarningsÚwarnÚDeprecationWarningrÿrKrrírîrïrër“Ú_TypedDictMeta)rrr€rÚtypenamer ÚfieldsÚnsr<r<rAÚ_typeddict_new¯sH
ÿ
 
ÿ rz;($cls, _typename, _fields=None, /, *, total=True, **kwargs)Úmodulecs4eZdZd‡fdd„    Zd‡fdd„    ZeZZ‡ZS)rTcstƒ |||¡dSrC)rpr¹)rMr•Úbasesrrrur<rAr¹ász_TypedDictMeta.__init__cs¢|dkr tnt|d<tƒ ||tf|¡}tdd„|DƒƒrNtjtf|_t    |ƒi}| 
di¡}d‰t rpd|j ini‰‡‡fdd    „|  ¡Dƒ}tƒ}tƒ}    |D]@}
| |
j 
di¡¡| |
j 
d
d ¡¡|     |
j 
d d ¡¡qœ| |¡|  ¡D]€\} } t| ƒ} | tkr(t| ƒ}|r(|d } t| ƒ} | tkr>| | ¡qð| tkrT|     | ¡qð|rf| | ¡qð|     | ¡qð||_t|ƒ|_t|    ƒ|_t|dƒsž||_|S)Nrr}css|]}t|tjƒVqdSrC)rÞrTr¬©r?rÁr<r<rArEòsz)_TypedDictMeta.__new__.<locals>.<genexpr>r­z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typercs"i|]\}}|tj|ˆfˆŽ“qSr<rà)r?ÚnÚtp©rßrâr<rAÚ
<dictcomp>úsÿz*_TypedDictMeta.__new__.<locals>.<dictcomp>Ú__required_keys__r<Ú__optional_keys__rÚ    __total__)rrrpr}rrôrTr¬rór×rëÚ _TAKES_MODULErzÚitemsr»Úupdater³r'rr&r9r¿r:r­Ú    frozensetrrrJr)rMr•rrrÚtp_dictrÂZown_annotationsZ required_keysZ optional_keysrÁZannotation_keyZannotation_typeZannotation_originZannotation_argsrurrAr}äsN   þ
 
 
 
 
 
 z_TypedDictMeta.__new__)T)T)    ryrzr{r¹r}rrqÚ__subclasscheck__r|r<r<rurAràs;ra»A simple typed name space. At runtime it is equivalent to a plain dict.
 
        TypedDict creates a dictionary type that expects all of its
        instances to have a certain set of keys, with each key
        associated with a value of a consistent type. This expectation
        is not checked at runtime but is only enforced by type checkers.
        Usage::
 
            class Point2D(TypedDict):
                x: int
                y: int
                label: str
 
            a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
            b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check
 
            assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')
 
        The type info can be accessed via the Point2D.__annotations__ dict, and
        the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets.
        TypedDict supports two additional equivalent forms::
 
            Point2D = TypedDict('Point2D', x=int, y=int, label=str)
            Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})
 
        The class syntax is only supported in Python 3.6+, while two other
        syntax forms work for Python 2.7 and 3.2+
        cCst|ttƒƒS)aCheck if an annotation is a TypedDict class
 
        For example::
            class Film(TypedDict):
                title: str
                year: int
 
            is_typeddict(Film)  # => True
            is_typeddict(Union[list, str])  # => False
        )rDrdÚ_TYPEDDICT_TYPES©rr<r<rAr*Fs cCs|S)aÊAssert (to the type checker) that the value is of the given type.
 
        When the type checker encounters a call to assert_type(), it
        emits an error if the value is not of the specified type::
 
            def greet(name: str) -> None:
                assert_type(name, str)  # ok
                assert_type(name, int)  # type checker error
 
        At runtime this returns the first argument unchanged and otherwise
        does nothing.
        r<)Z__valZ__typr<r<rAr Xs cCst|tƒrt|jƒSt|dƒr:|jttfkr:t|jdƒSt|tj    ƒrrt
dd„|jDƒƒ}||jkrh|S|  |¡Stt dƒr¸t|t j ƒr¸t
dd„|jDƒƒ}||jkrª|St   |j|¡Stt dƒrþt|t jƒrþt
dd„|jDƒƒ}||jkrð|St tj|¡S|S)    z=Strips Annotated, Required and NotRequired from a given type.r¶rcss|]}t|ƒVqdSrC©Ú _strip_extras©r?Úar<r<rArEvsz _strip_extras.<locals>.<genexpr>rWcss|]}t|ƒVqdSrCr%r'r<r<rArE{srXcss|]}t|ƒVqdSrCr%r'r<r<rArE€s)rDÚ_AnnotatedAliasr&r¶rJr9r:r´rTrUrdÚ    copy_withrerWrXrêÚreduceÚoperatorÚor_)rZZ stripped_argsr<r<rAr&os(
 
 
 
 
 
r&FcCsHttdƒrtj|||dd}ntj|||d}|r6|Sdd„| ¡DƒS)aˆReturn type hints for an object.
 
        This is often the same as obj.__annotations__, but it handles
        forward references encoded as string literals, adds Optional[t] if a
        default value equal to None is set and recursively replaces all
        'Annotated[T, ...]', 'Required[T]' or 'NotRequired[T]' with 'T'
        (unless 'include_extras=True').
 
        The argument may be a module, class, method, or function. The annotations
        are returned as a dictionary. For classes, annotations include also
        inherited members.
 
        TypeError is raised if the argument is not of a type that can contain
        annotations, and an empty dictionary is returned if no annotations are
        present.
 
        BEWARE -- the behavior of globalns and localns is counterintuitive
        (unless you are familiar with how eval() and exec() work).  The
        search order is locals first, then globals.
 
        - If no dict arguments are passed, an attempt is made to use the
          globals from obj (or the respective module's globals for classes),
          and these are also used as the locals.  If the object does not appear
          to have globals, an empty dictionary is used.
 
        - If one dict argument is passed, it is used for both globals and
          locals.
 
        - If two dict arguments are passed, they specify globals and
          locals, respectively.
        rT)ÚglobalnsÚlocalnsÚinclude_extras)r.r/cSsi|]\}}|t|ƒ“qSr<r%)r?ÚkrZr<r<rAr¯sz"get_type_hints.<locals>.<dictcomp>)rJrTr(r)rtr.r/r0Úhintr<r<rAr(‡s 
ÿcsHeZdZdZ‡fdd„Zdd„Zdd„Zdd    „Zd
d „Zd d „Z    ‡Z
S)r)aKRuntime representation of an annotated type.
 
        At its core 'Annotated[t, dec1, dec2, ...]' is an alias for the type 't'
        with extra annotations. The alias behaves like a normal typing alias,
        instantiating is the same as instantiating the underlying type, binding
        it to types is also the same.
        cs2t|tƒr|j|}|j}tƒ ||¡||_dSrC)rDr)Ú __metadata__r¶rpr¹)rsÚoriginÚmetadatarur<rAr¹Âs
 
 
z_AnnotatedAlias.__init__cCs$t|ƒdkst‚|d}t||jƒS)Nrãr)rKÚAssertionErrorr)r3)rsråÚnew_typer<r<rAr*Ész_AnnotatedAlias.copy_withcCs,dt |j¡›dd dd„|jDƒ¡›dS)Nztyping_extensions.Annotated[rÊcss|]}t|ƒVqdSrC)r÷r'r<r<rArEÏsz+_AnnotatedAlias.__repr__.<locals>.<genexpr>rÑ)rTÚ
_type_reprr¶rÒr3rxr<r<rArwÎsz_AnnotatedAlias.__repr__cCstjt|jf|jffSrC)r,Úgetitemrr¶r3rxr<r<rAÚ
__reduce__Òs ÿz_AnnotatedAlias.__reduce__cCs*t|tƒstS|j|jkrdS|j|jkS)NF)rDr)rìr¶r3©rsrñr<r<rAÚ__eq__×s
 
 z_AnnotatedAlias.__eq__cCst|j|jfƒSrC)Úhashr¶r3rxr<r<rAÚ__hash__Þsz_AnnotatedAlias.__hash__) ryrzr{rr¹r*rwr:r<r>r|r<r<rurAr)ºs r)c@s2eZdZdZdZdd„Zejdd„ƒZdd„Z    d    S)
ra¡Add context specific metadata to a type.
 
        Example: Annotated[int, runtime_check.Unsigned] indicates to the
        hypothetical runtime_check module that this type is an unsigned int.
        Every other consumer of this type can ignore this metadata and treat
        this type as int.
 
        The first argument to Annotated must be a valid type (and will be in
        the __origin__ field), the remaining arguments are kept as a tuple in
        the __extra__ field.
 
        Details:
 
        - It's an error to call `Annotated` with less than two arguments.
        - Nested Annotated are flattened::
 
            Annotated[Annotated[T, Ann1, Ann2], Ann3] == Annotated[T, Ann1, Ann2, Ann3]
 
        - Instantiating an annotated type is equivalent to instantiating the
        underlying type::
 
            Annotated[C, Ann1](5) == C(5)
 
        - Annotated can be used as a generic type alias::
 
            Optimized = Annotated[T, runtime.Optimize()]
            Optimized[int] == Annotated[int, runtime.Optimize()]
 
            OptimizedList = Annotated[List[T], runtime.Optimize()]
            OptimizedList[int] == Annotated[List[int], runtime.Optimize()]
        r<cOs tdƒ‚dS)Nz&Type Annotated cannot be instantiated.©rHr~r<r<rAr}szAnnotated.__new__cCsnt|tƒrt|ƒdkrtdƒ‚ttf}t|dƒ|kr@|d}nd}t |d|¡}t|dd…ƒ}t    ||ƒS)NrƒzUAnnotated[...] should be used with at least two arguments (a type and an annotation).rz$Annotated[t, ...]: t must be a type.rã)
rDrdrKrHrrr'rTrŒr))rMråZallowed_special_formsr4râr5r<r<rArçs
zAnnotated.__class_getitem__cOstd|j›dƒ‚dS)NúCannot subclass z
.Annotated)rHrzr~r<r<rArùs ÿzAnnotated.__init_subclass__N)
ryrzr{rrµr}rTrúrçrùr<r<r<rArás  
)Ú_BaseGenericAlias)rWcCs>t|tƒrtSt|tjttttfƒr*|j    S|tj
kr:tj
SdS)a6Get the unsubscripted version of a type.
 
        This supports generic types, Callable, Tuple, Union, Literal, Final, ClassVar
        and Annotated. Return None for unsupported types. Examples::
 
            get_origin(Literal[42]) is Literal
            get_origin(int) is None
            get_origin(ClassVar[int]) is ClassVar
            get_origin(Generic) is Generic
            get_origin(Generic[T]) is Generic
            get_origin(Union[T, int]) is Union
            get_origin(List[Tuple[T, T]][int]) == list
            get_origin(P.args) is P
        N) rDr)rrTrUÚ_typing_GenericAliasrArr    r¶r¬r$r<r<rAr'.s
 ÿ
cCszt|tƒr|jf|jSt|tjtfƒrvt|ddƒr8dS|j}t    |ƒt
j j krr|dt k    rrt|dd…ƒ|df}|SdS)aÆGet type arguments with all substitutions performed.
 
        For unions, basic simplifications used by Union constructor are performed.
        Examples::
            get_args(Dict[str, int]) == (str, int)
            get_args(int) == ()
            get_args(Union[int, Union[T, int], str][int]) == (int, str)
            get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
            get_args(Callable[[], T][int]) == ([], int)
        r^Fr<rNr«)rDr)r¶r3rTrUrBr™r´r'Ú collectionsrér£ÚEllipsisrŸ)rÚresr<r<rAr&Fs
 c@seZdZdd„ZdS)Ú_TypeAliasFormcCs
d|jSr†r‡rxr<r<rArwcsú_TypeAliasForm.__repr__N©ryrzr{rwr<r<r<rArFbsrFcCst|›dƒ‚dS)a&Special marker indicating that an assignment should
        be recognized as a proper type alias definition by type
        checkers.
 
        For example::
 
            Predicate: TypeAlias = Callable[..., bool]
 
        It's invalid when used anywhere except as in the example above.
        ú is not subscriptableNr?r—r<r<rAr4fs c@seZdZdd„ZdS)rFcCs
d|jSr†r‡rxr<r<rArwvsrGNrHr<r<r<rArFusa¯Special marker indicating that an assignment should
                               be recognized as a proper type alias definition by type
                               checkers.
 
                               For example::
 
                                   Predicate: TypeAlias = Callable[..., bool]
 
                               It's invalid when used anywhere except as in the example
                               above.c@seZdZdZdZdd„ZdS)Ú _DefaultMixinzMixin for TypeVarLike defaults.r<cCsFt|ttfƒr$tdd„|Dƒƒ|_n|tkr<t |d¡|_nd|_dS)Ncss|]}t |d¡VqdS)úDefault must be a typeNrà)r?Údr<r<rArEsÿz)_DefaultMixin.__init__.<locals>.<genexpr>rK)rDrdrŸZ __default__rIrTrŒ)rsÚdefaultr<r<rAr¹‹sÿ z_DefaultMixin.__init__N)ryrzr{rrµr¹r<r<r<rArJ†srJcs2eZdZdZdZdddeddœ‡fdd„
Z‡ZS)r zType variable.rTNF)ÚboundrkrmrMÚinfer_variancec        svtƒj|f|ž|||dœŽt ||¡||_zt d¡j dd¡}Wntt    fk
rbd}YnX|dkrr||_
dS©N)rNrkrmrãryr    Útyping_extensions) rpr¹rJZ__infer_variance__rírîrïrër“rÿrz)    rsr•rNrkrmrMrOÚ constraintsÚdef_modrur<rAr¹›sÿ 
zTypeVar.__init__©ryrzr{rrIr¹r|r<r<rurAr –sþc@s$eZdZdZdZdd„Zdd„ZdS)Ú
_Immutablez3Mixin to indicate that object should not be copied.r<cCs|SrCr<rxr<r<rAÚ__copy__¶sz_Immutable.__copy__cCs|SrCr<)rsÚmemor<r<rAÚ __deepcopy__¹sz_Immutable.__deepcopy__N)ryrzr{rrµrVrXr<r<r<rArU²srUc@s(eZdZdZdd„Zdd„Zdd„ZdS)    raQThe args for a ParamSpec object.
 
        Given a ParamSpec object P, P.args is an instance of ParamSpecArgs.
 
        ParamSpecArgs objects have a reference back to their ParamSpec:
 
        P.args.__origin__ is P
 
        This type is meant for runtime introspection and has no special meaning to
        static type checkers.
        cCs
||_dSrC©r¶©rsr4r<r<rAr¹ÈszParamSpecArgs.__init__cCs|jj›dS)Nz.args©r¶ryrxr<r<rArwËszParamSpecArgs.__repr__cCst|tƒstS|j|jkSrC)rDrrìr¶r;r<r<rAr<Îs
zParamSpecArgs.__eq__N©ryrzr{rr¹rwr<r<r<r<rAr¼s c@s(eZdZdZdd„Zdd„Zdd„ZdS)    r    a[The kwargs for a ParamSpec object.
 
        Given a ParamSpec object P, P.kwargs is an instance of ParamSpecKwargs.
 
        ParamSpecKwargs objects have a reference back to their ParamSpec:
 
        P.kwargs.__origin__ is P
 
        This type is meant for runtime introspection and has no special meaning to
        static type checkers.
        cCs
||_dSrCrYrZr<r<rAr¹ßszParamSpecKwargs.__init__cCs|jj›dS)Nz.kwargsr[rxr<r<rArwâszParamSpecKwargs.__repr__cCst|tƒstS|j|jkSrC)rDr    rìr¶r;r<r<rAr<ås
zParamSpecKwargs.__eq__Nr\r<r<r<rAr    Ós cs0eZdZdZdZdddedœ‡fdd„
Z‡ZS)rz!Parameter specification variable.rTNF©rNrkrmrMc    shtƒj||||dt ||¡zt d¡j dd¡}Wnttfk
rTd}YnX|dkrd||_    dSrP©
rpr¹rJrírîrïrër“rÿrz©rsr•rNrkrmrMrSrur<rAr¹ós ÿ 
úParamSpec.__init__rTr<r<rurArîs
ÿcsreZdZdZejZedd„ƒZedd„ƒZ    ddde
dœ‡fd    d
„
Z d d „Z d d„Z dd„Zdd„Zdd„Z‡ZS)ra'Parameter specification variable.
 
        Usage::
 
           P = ParamSpec('P')
 
        Parameter specification variables exist primarily for the benefit of static
        type checkers.  They are used to forward the parameter types of one
        callable to another callable, a pattern commonly found in higher order
        functions and decorators.  They are only valid when used in ``Concatenate``,
        or s the first argument to ``Callable``. In Python 3.10 and higher,
        they are also supported in user-defined Generics at runtime.
        See class Generic for more information on generic types.  An
        example for annotating a decorator::
 
           T = TypeVar('T')
           P = ParamSpec('P')
 
           def add_logging(f: Callable[P, T]) -> Callable[P, T]:
               '''A type-safe decorator to add logging to a function.'''
               def inner(*args: P.args, **kwargs: P.kwargs) -> T:
                   logging.info(f'{f.__name__} was called')
                   return f(*args, **kwargs)
               return inner
 
           @add_logging
           def add_two(x: float, y: float) -> float:
               '''Add two numbers together.'''
               return x + y
 
        Parameter specification variables defined with covariant=True or
        contravariant=True can be used to declare covariant or contravariant
        generic types.  These keyword arguments are valid, but their actual semantics
        are yet to be decided.  See PEP 612 for details.
 
        Parameter specification variables can be introspected. e.g.:
 
           P.__name__ == 'T'
           P.__bound__ == None
           P.__covariant__ == False
           P.__contravariant__ == False
 
        Note that only parameter specification variables defined in global scope can
        be pickled.
        cCst|ƒSrC)rrxr<r<rAr7szParamSpec.argscCst|ƒSrC)r    rxr<r<rAr€;szParamSpec.kwargsNFr]c    s–tƒ |g¡||_t|ƒ|_t|ƒ|_|r<t |d¡|_nd|_t     ||¡zt
  d¡j   dd¡}Wnttfk
r‚d}YnX|dkr’||_dS)NzBound must be a type.rãryr    rQ)rpr¹ryÚboolÚ __covariant__Ú__contravariant__rTrŒÚ    __bound__rJrírîrïrër“rÿrzr_rur<rAr¹?s
 
 
r`cCs&|jr d}n|jrd}nd}||jS)Nú+ú-ú~)rbrcry)rsÚprefixr<r<rArwSs zParamSpec.__repr__cCs
t |¡SrC©rõr>rxr<r<rAr>\szParamSpec.__hash__cCs||kSrCr<r;r<r<rAr<_szParamSpec.__eq__cCs|jSrC©ryrxr<r<rAr:bszParamSpec.__reduce__cOsdSrCr<rÙr<r<rAÚ__call__fszParamSpec.__call__)ryrzr{rrTr rvÚpropertyrr€rIr¹rwr>r<r:rkr|r<r<rurArs/
 
ÿ    csJeZdZejZdZ‡fdd„Zdd„Zdd„Z    dd    „Z
e d
d „ƒZ ‡Z S) Ú_ConcatenateGenericAliasFcstƒ |¡||_||_dSrC)rpr¹r¶r´)rsr4rrur<rAr¹us z!_ConcatenateGenericAlias.__init__cs2tj‰ˆ|jƒ›dd ‡fdd„|jDƒ¡›dS)NrÐrÊc3s|]}ˆ|ƒVqdSrCr<)r?Úarg©r8r<rArE|sz4_ConcatenateGenericAlias.__repr__.<locals>.<genexpr>rÑ)rTr8r¶rÒr´rxr<rorArwzsz!_ConcatenateGenericAlias.__repr__cCst|j|jfƒSrC)r=r¶r´rxr<r<rAr>sz!_ConcatenateGenericAlias.__hash__cOsdSrCr<rÙr<r<rArkƒsz!_ConcatenateGenericAlias.__call__cCstdd„|jDƒƒS)Ncss"|]}t|tjtfƒr|VqdSrC)rDrTr r)r?rr<r<rArEˆsz:_ConcatenateGenericAlias.__parameters__.<locals>.<genexpr>)rdr´rxr<r<rAr;†sÿz'_ConcatenateGenericAlias.__parameters__)ryrzr{rTrUrvr^r¹rwr>rkrlr;r|r<r<rurArmms rmcsZ|dkrtdƒ‚t|tƒs |f}t|dtƒs6tdƒ‚d‰t‡fdd„|Dƒƒ}t||ƒS)Nr<z&Cannot take a Concatenate of no types.r«zAThe last parameter to Concatenate should be a ParamSpec variable.z/Concatenate[arg, ...]: each arg must be a type.c3s|]}t |ˆ¡VqdSrCràr>rár<rArE˜sz'_concatenate_getitem.<locals>.<genexpr>)rHrDrdrrmr—r<rárAÚ_concatenate_getitemŽs
rpcCs
t||ƒS)á&Used in conjunction with ``ParamSpec`` and ``Callable`` to represent a
        higher order function which adds, removes or transforms parameters of a
        callable.
 
        For example::
 
           Callable[Concatenate[int, P], int]
 
        See PEP 612 for detailed information.
        ©rpr—r<r<rAr¢s c@seZdZdd„Zdd„ZdS)Ú_ConcatenateFormcCs
d|jSr†r‡rxr<r<rArw²sz_ConcatenateForm.__repr__cCs
t||ƒSrCrrr—r<r<rArµsz_ConcatenateForm.__getitem__Nrr<r<r<rArs±srsrqc@seZdZdd„ZdS)Ú_TypeGuardFormcCs
d|jSr†r‡rxr<r<rArwËsú_TypeGuardForm.__repr__NrHr<r<r<rArtÊsrtcCs t ||›d¡}t ||f¡S)á    Special typing form used to annotate the return type of a user-defined
        type guard function.  ``TypeGuard`` only accepts a single type argument.
        At runtime, functions marked this way should return a boolean.
 
        ``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static
        type checkers to determine a more precise type of an expression within a
        program's code flow.  Usually type narrowing is done by analyzing
        conditional code flow and applying the narrowing to a block of code.  The
        conditional expression here is sometimes referred to as a "type guard".
 
        Sometimes it would be convenient to use a user-defined boolean function
        as a type guard.  Such a function should use ``TypeGuard[...]`` as its
        return type to alert static type checkers to this intention.
 
        Using  ``-> TypeGuard`` tells the static type checker that for a given
        function:
 
        1. The return value is a boolean.
        2. If the return value is ``True``, the type of its argument
        is the type inside ``TypeGuard``.
 
        For example::
 
            def is_str(val: Union[str, float]):
                # "isinstance" type guard
                if isinstance(val, str):
                    # Type of ``val`` is narrowed to ``str``
                    ...
                else:
                    # Else, type of ``val`` is narrowed to ``float``.
                    ...
 
        Strict type narrowing is not enforced -- ``TypeB`` need not be a narrower
        form of ``TypeA`` (it can even be a wider form) and this may lead to
        type-unsafe results.  The main reason is to allow for things like
        narrowing ``List[object]`` to ``List[str]`` even though the latter is not
        a subtype of the former, since ``List`` is invariant.  The responsibility of
        writing type-safe type guards is left to the user.
 
        ``TypeGuard`` also works with type variables.  For more information, see
        PEP 647 (User-Defined Type Guards).
        rŠ)rTrŒrUrr<r<rAr5Îs,c@seZdZdd„Zdd„ZdS)rtcCs
d|jSr†r‡rxr<r<rArwsrucCs"t ||j›d¡}t ||f¡S)Nz accepts only a single typer‹rr<r<rArs
ÿz_TypeGuardForm.__getitem__Nrr<r<r<rArtþsrvc@sneZdZdZdd„Zdd„Zdd„Zdd    „Zd
d „Zd d „Z    dd„Z
dd„Z dd„Z dd„Z ejdd„ƒZdS)Ú _SpecialForm)rˆrÚ_getitemcCs||_|j|_|j|_dSrC)rxryrˆr)rsr9r<r<rAr¹:sz_SpecialForm.__init__cCs|dkr|jSt|ƒ‚dS)N>ryr{)rˆr“)rsrŽr<r<rAÚ __getattr__?sz_SpecialForm.__getattr__cCstd|›ƒ‚dS)Nr@r?)rsrr<r<rAÚ__mro_entries__Esz_SpecialForm.__mro_entries__cCs d|j›Sr†r‡rxr<r<rArwHsz_SpecialForm.__repr__cCs|jSrCr‡rxr<r<rAr:Ksz_SpecialForm.__reduce__cOstd|›ƒ‚dS)NzCannot instantiate r?©rsrrßr<r<rArkNsz_SpecialForm.__call__cCstj||fSrC©rTÚUnionr;r<r<rAÚ__or__Qsz_SpecialForm.__or__cCstj||fSrCr|r;r<r<rAÚ__ror__Tsz_SpecialForm.__ror__cCst|›dƒ‚dS)Nz! cannot be used with isinstance()r?rrr<r<rArqWsz_SpecialForm.__instancecheck__cCst|›dƒ‚dS)Nz! cannot be used with issubclass()r?)rsrMr<r<rAr"Zsz_SpecialForm.__subclasscheck__cCs | ||¡SrC)rxr—r<r<rAr]sz_SpecialForm.__getitem__N)ryrzr{rµr¹ryrzrwr:rkr~rrqr"rTrúrr<r<r<rArw7srwcCst|›dƒ‚dS)aDRepresents an arbitrary literal string.
 
        Example::
 
          from typing_extensions import LiteralString
 
          def query(sql: LiteralString) -> ...:
              ...
 
          query("SELECT * FROM table")  # ok
          query(f"SELECT * FROM {input()}")  # not ok
 
        See PEP 675 for details.
 
        rINr?©rsrår<r<rArescCst|›dƒ‚dS)zòUsed to spell the type of "self" in classes.
 
        Example::
 
          from typing import Self
 
          class ReturnsSelf:
              def parse(self, data: bytes) -> Self:
                  ...
                  return self
 
        rINr?r€r<r<rAr
|scCst|›dƒ‚dS)a¬The bottom type, a type that has no members.
 
        This can be used to define a function that should never be
        called, or a function that never returns::
 
            from typing_extensions import Never
 
            def never_call_me(arg: Never) -> None:
                pass
 
            def int_or_str(arg: int | str) -> None:
                never_call_me(arg)  # type checker error
                match arg:
                    case int():
                        print("It's an int")
                    case str():
                        print("It's a str")
                    case _:
                        never_call_me(arg)  # ok, arg is of type Never
 
        rINr?r€r<r<rAr7‘sc@seZdZdd„ZdS)Ú_ExtensionsSpecialFormcCs
d|jSr†r‡rxr<r<rArw±sz_ExtensionsSpecialForm.__repr__NrHr<r<r<rAr°srcCs"t ||j›d¡}t ||f¡S)áêA special typing construct to mark a key of a total=False TypedDict
        as required. For example:
 
            class Movie(TypedDict, total=False):
                title: Required[str]
                year: int
 
            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )
 
        There is no runtime checking that a required key is actually provided
        when instantiating a related TypedDict.
        rŠr‹rr<r<rAr9´scCs"t ||j›d¡}t ||f¡S)á`A special typing construct to mark a key of a TypedDict as
        potentially missing. For example:
 
            class Movie(TypedDict):
                title: str
                year: NotRequired[int]
 
            m = Movie(
                title='The Matrix',  # typechecker error if key is omitted
                year=1999,
            )
        rŠr‹rr<r<rAr:Èsc@seZdZdd„Zdd„ZdS)Ú _RequiredFormcCs
d|jSr†r‡rxr<r<rArwÛsz_RequiredForm.__repr__cCs"t ||j›d¡}t ||f¡Sr‰r‹rr<r<rArÞs
ÿz_RequiredForm.__getitem__Nrr<r<r<rAr„Úsr„r‚rƒc@seZdZdd„ZdS)Ú_UnpackSpecialFormcCs
d|jSr†r‡rxr<r<rArwsz_UnpackSpecialForm.__repr__NrHr<r<r<rAr…sr…c@seZdZejZdS©Ú _UnpackAliasN©ryrzr{rTr rvr<r<r<rAr‡ sr‡cCs t ||j›d¡}t||fƒS)áA special typing construct to unpack a variadic type. For example:
 
            Shape = TypeVarTuple('Shape')
            Batch = NewType('Batch', int)
 
            def add_batch_axis(
                x: Array[Unpack[Shape]]
            ) -> Array[Batch, Unpack[Shape]]: ...
 
        rŠ©rTrŒrˆr‡rr<r<rArs cCs
t|tƒSrC©rDr‡©rtr<r<rAr=sr=c@seZdZejZdSr†rˆr<r<r<rAr‡!sc@seZdZdd„Zdd„ZdS)Ú _UnpackFormcCs
d|jSr†r‡rxr<r<rArw%sz_UnpackForm.__repr__cCs t ||j›d¡}t||fƒSr‰rŠrr<r<rAr(s
ÿz_UnpackForm.__getitem__Nrr<r<r<rAr$srr‰cCs
t|tƒSrCr‹rŒr<r<rAr=:scs&eZdZdZedœ‡fdd„
Z‡ZS)r zType variable tuple.©rMc    s`tƒ |¡t ||¡zt d¡j dd¡}Wnttfk
rLd}YnX|dkr\||_    dS©Nrãryr    rQr^©rsr•rMrSrur<rAr¹Ds  
úTypeVarTuple.__init__rTr<r<rurAr Asc@sTeZdZdZejZdd„Zedœdd„Z    dd„Z
d    d
„Z d d „Z d d„Z dd„ZdS)r aÅType variable tuple.
 
        Usage::
 
            Ts = TypeVarTuple('Ts')
 
        In the same way that a normal type variable is a stand-in for a single
        type such as ``int``, a type variable *tuple* is a stand-in for a *tuple*
        type such as ``Tuple[int, str]``.
 
        Type variable tuples can be used in ``Generic`` declarations.
        Consider the following example::
 
            class Array(Generic[*Ts]): ...
 
        The ``Ts`` type variable tuple here behaves like ``tuple[T1, T2]``,
        where ``T1`` and ``T2`` are type variables. To use these type variables
        as type parameters of ``Array``, we must *unpack* the type variable tuple using
        the star operator: ``*Ts``. The signature of ``Array`` then behaves
        as if we had simply written ``class Array(Generic[T1, T2]): ...``.
        In contrast to ``Generic[T1, T2]``, however, ``Generic[*Shape]`` allows
        us to parameterise the class with an *arbitrary* number of type parameters.
 
        Type variable tuples can be used anywhere a normal ``TypeVar`` can.
        This includes class definitions, as shown above, as well as function
        signatures and variable annotations::
 
            class Array(Generic[*Ts]):
 
                def __init__(self, shape: Tuple[*Ts]):
                    self._shape: Tuple[*Ts] = shape
 
                def get_shape(self) -> Tuple[*Ts]:
                    return self._shape
 
            shape = (Height(480), Width(640))
            x: Array[Height, Width] = Array(shape)
            y = abs(x)  # Inferred type is Array[Height, Width]
            z = x + x   #        ...    is Array[Height, Width]
            x.get_shape()  #     ...    is tuple[Height, Width]
 
        ccs |jVdSrC)Ú __unpacked__rxr<r<rAÚ__iter__€szTypeVarTuple.__iter__rŽc    Csd||_t ||¡zt d¡j dd¡}Wnttfk
rFd}YnX|dkrV||_    t
||_ dSr) ryrJr¹rírîrïrër“rÿrzrr’rr<r<rAr¹ƒs 
r‘cCs|jSrCrjrxr<r<rArw‘szTypeVarTuple.__repr__cCs
t |¡SrCrirxr<r<rAr>”szTypeVarTuple.__hash__cCs||kSrCr<r;r<r<rAr<—szTypeVarTuple.__eq__cCs|jSrCrjrxr<r<rAr:šszTypeVarTuple.__reduce__cOsd|krtdƒ‚dS)Nr‘z&Cannot subclass special typing classesr?r{r<r<rArùszTypeVarTuple.__init_subclass__N)ryrzr{rrTr rvr“rIr¹rwr>r<r:rùr<r<r<rAr Qs,)Ú__objrûcCstdt|ƒj›tjd|S)açReveal the inferred type of a variable.
 
        When a static type checker encounters a call to ``reveal_type()``,
        it will emit the inferred type of the argument::
 
            x: int = 1
            reveal_type(x)
 
        Running a static type checker (e.g., ``mypy``) on this example
        will produce output similar to 'Revealed type is "builtins.int"'.
 
        At runtime, the function prints the runtime type of the
        argument and returns it unchanged.
 
        zRuntime type is )Úfile)ÚprintrØryríÚstderr)r”r<r<rAr0¥s©Ú__argrûcCs tdƒ‚dS)a1Assert to the type checker that a line of code is unreachable.
 
        Example::
 
            def int_or_str(arg: int | str) -> None:
                match arg:
                    case int():
                        print("It's an int")
                    case str():
                        print("It's a str")
                    case _:
                        assert_never(arg)
 
        If a type checker finds that a call to assert_never() is
        reachable, it will emit an error.
 
        At runtime, this throws an exception when called.
 
        zExpected code to be unreachableN)r6©r™r<r<rAr¼s)rRé r<)Ú
eq_defaultÚ order_defaultÚkw_only_defaultÚfrozen_defaultÚfield_specifiers.)rœrržrŸr r€rûc s‡‡‡‡‡‡fdd„}|S)a¥Decorator that marks a function, class, or metaclass as providing
        dataclass-like behavior.
 
        Example:
 
            from typing_extensions import dataclass_transform
 
            _T = TypeVar("_T")
 
            # Used on a decorator function
            @dataclass_transform()
            def create_model(cls: type[_T]) -> type[_T]:
                ...
                return cls
 
            @create_model
            class CustomerModel:
                id: int
                name: str
 
            # Used on a base class
            @dataclass_transform()
            class ModelBase: ...
 
            class CustomerModel(ModelBase):
                id: int
                name: str
 
            # Used on a metaclass
            @dataclass_transform()
            class ModelMeta(type): ...
 
            class ModelBase(metaclass=ModelMeta): ...
 
            class CustomerModel(ModelBase):
                id: int
                name: str
 
        Each of the ``CustomerModel`` classes defined in this example will now
        behave similarly to a dataclass created with the ``@dataclasses.dataclass``
        decorator. For example, the type checker will synthesize an ``__init__``
        method.
 
        The arguments to this decorator can be used to customize this behavior:
        - ``eq_default`` indicates whether the ``eq`` parameter is assumed to be
          True or False if it is omitted by the caller.
        - ``order_default`` indicates whether the ``order`` parameter is
          assumed to be True or False if it is omitted by the caller.
        - ``kw_only_default`` indicates whether the ``kw_only`` parameter is
          assumed to be True or False if it is omitted by the caller.
        - ``frozen_default`` indicates whether the ``frozen`` parameter is
          assumed to be True or False if it is omitted by the caller.
        - ``field_specifiers`` specifies a static list of supported classes
          or functions that describe fields, similar to ``dataclasses.field()``.
 
        At runtime, this decorator records its arguments in the
        ``__dataclass_transform__`` attribute on the decorated object.
 
        See PEP 681 for details.
 
        csˆˆˆˆˆˆdœ|_|S)N)rœrržrŸr r€)Z__dataclass_transform__)Z    cls_or_fn©rœr rŸržr€rr<rAÚ    decorator súz&dataclass_transform.<locals>.decoratorr<)rœrržrŸr r€r¢r<r¡rAr"×sI
Ú_F)rNc    Cs(z
d|_Wnttfk
r"YnX|S)aLIndicate that a method is intended to override a method in a base class.
 
        Usage:
 
            class Base:
                def method(self) -> None: ...
                    pass
 
            class Child(Base):
                @override
                def method(self) -> None:
                    super().method()
 
        When this decorator is applied to a method, the type checker will
        validate that it overrides a method with the same name on a base class.
        This helps prevent bugs that may occur when a base class is changed
        without an equivalent change to a child class.
 
        There is no runtime checking of these properties. The decorator
        sets the ``__override__`` attribute to ``True`` on the decorated object
        to allow runtime introspection.
 
        See PEP 698 for details.
 
        T)Z __override__r“rHršr<r<rAr.2s
 
Ú_Trã©Úcategoryr)Ú__msgr¦rrûcsttdœ‡‡‡fdd„ }|S)aÂIndicate that a class, function or overload is deprecated.
 
        Usage:
 
            @deprecated("Use B instead")
            class A:
                pass
 
            @deprecated("Use g instead")
            def f():
                pass
 
            @overload
            @deprecated("int support is deprecated")
            def g(x: int) -> int: ...
            @overload
            def g(x: str) -> int: ...
 
        When this decorator is applied to an object, the type checker
        will generate a diagnostic on usage of the deprecated object.
 
        No runtime warning is issued. The decorator sets the ``__deprecated__``
        attribute on the decorated object to the deprecation message
        passed to the decorator. If applied to an overload, the decorator
        must be after the ``@overload`` decorator for the attribute to
        exist on the overload as returned by ``get_overloads()``.
 
        See PEP 702 for details.
 
        r˜cs¬ˆdkrˆˆ_ˆStˆtƒrfˆj‰ˆjtjk    ‰t ˆ¡‡‡‡‡‡fdd„ƒ}t|ƒˆ_ˆˆ_|_ˆSt    ˆƒršt ˆ¡‡‡‡‡fdd„ƒ}ˆˆ_|_|St
dˆ›ƒ‚dS)NcsVtjˆˆˆddˆs0|s |r0t|j›dƒ‚ˆtjk    rJˆ|f|ž|ŽSˆ|ƒSdS)Nrãr¥z() takes no arguments)r r rHryrõr}r~)r§r¦Úhas_initÚ original_newrr<rAr}‡s  
z.deprecated.<locals>.decorator.<locals>.__new__cstjˆˆˆddˆ||ŽS)Nrãr¥)r r )rr€)r™r§r¦rr<rAÚwrapper–sz.deprecated.<locals>.decorator.<locals>.wrapperzY@deprecated decorator with non-None category must be applied to a class or callable, not ) Z__deprecated__rDrØr}r¹rõrêÚwrapsÚ staticmethodrÅrH)r™r}rª©r§r¦r)r™r¨r©rAr¢s&
 
 
  ÿzdeprecated.<locals>.decorator)r¤)r§r¦rr¢r<r­rAr#[s$$c    Cs6zt d¡j dd¡WSttfk
r0YdSXdS)Nrƒryr    )rírîrïrër“rÿr<r<r<rAÚ_caller¸sr®cCsPdd„|Dƒ}dd„|Dƒ}tj||||d}||_|j_tjdkrL||_|S)NcSsg|] \}}|‘qSr<r<©r?rrZr<r<rArB¿sz!_make_nmtuple.<locals>.<listcomp>c    Ss&i|]\}}|t |d|›d¡“qS)zfield z annotation must be a typeràr¯r<r<rArÀsÿz!_make_nmtuple.<locals>.<dictcomp>©Údefaultsrr\)rCÚ
namedtupler­r}ríÚ version_infoÚ _field_types)r•rerr±rrÂÚnm_tplr<r<rAÚ _make_nmtuple¾sÿÿ
r¶rzryr­c@seZdZdd„ZdS)Ú_NamedTupleMetac
sJt|ks t‚|D]}|tk    r|tjk    rtdƒ‚qtdd„|Dƒƒ}ˆ di¡}g}|D]L}|ˆkrn| |¡qV|rVtd|›dt|ƒdkrŒdnd    ›d
d      |¡›ƒ‚qVt
||  ¡‡fd d „|Dƒˆdd}||_ tj|krîtjj j}    t|    ƒ|_ ˆD]>}
|
tkrtd|
ƒ‚qò|
tkrò|
|jkròt||
ˆ|
ƒqòtj|krF| ¡|S)Nz3can only inherit from a NamedTuple type and Genericcss|]}|tkrtn|VqdSrC)Ú _NamedTuplerdrr<r<rArEÕsz*_NamedTupleMeta.__new__.<locals>.<genexpr>r­zNon-default namedtuple field z cannot follow default fieldrãÚsÚú rÊcsg|] }ˆ|‘qSr<r<)r?r©rr<rArBâsz+_NamedTupleMeta.__new__.<locals>.<listcomp>rzr°z&Cannot overwrite NamedTuple attribute )r¸r6rTr¬rHrdrërbrKrÒr¶rrórçr˜Ú classmethodÚ_prohibited_namedtuple_fieldsr“Ú_special_namedtuple_fieldsrÚsetattrrù) rMrrrrÁreÚ default_namesÚ
field_namerµZ class_getitemÚkeyr<r¼rAr}Ïs@ ÿ  2ý
 
 
 
 z_NamedTupleMeta.__new__N)ryrzr{r}r<r<r<rAr·Îsr·cKs.|dkr| ¡}n |rtdƒ‚t||tƒdS)NzIEither list of fields or keywords can be provided to NamedTuple, not both)r)rrHr¶r®)Z
__typenameZ__fieldsr€r<r<rArós
 
)rRéz$(typename, fields=None, /, **kwargs)cCst|ks t‚tfSrC)rr6r¸)rr<r<rAÚ_namedtuple_mro_entries    s rÅ)N)NNF)r<)N)ŸrérCÚcollections.abcrêÚinspectr,rírerVrTr Ú__all__ZPEP_560rØZ GenericMetarõrIrQr³r[rfr8r rgrhrirjrlrrorrJrrwr…r%r)r+r–rr-r$r!Ú defaultdictÚpartialrršr rrrrrrrrrÚ_aliasrrrr,r3r6rörÄrÉr×r/rÚÚABCMetarÛr2r1rrrr*rrÚ__text_signature__rÚ    signaturerŒrNrryrzrr#r r(r&rr)rUr'r&rAÚ ImportErrorrWrBr4rFrJrr    rUrrŸrmrúrprrsr5rtÚ_Finalrr
r7r9r:rr„rr…r‡r=rr r0rr"rarär}r£r.r£r#r¤r rÌÚOptionalÚWarningrþrr®r¶Ú _prohibitedr¾r r¿r·r}r¸rÅrzr<r<r<rAÚ<module>sÖ¾F 
 
 
 
 
 
 
   
ÿ   ÿ  ÿ(  ý)     ,Aÿ    
, '=    ÿ  
 f !
  þ  /
þ/+ 
 
 
 
     þþ 
 
    þ  Q   ÷ ÿÿõ V $ 
üû R  
%