zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
U
ß=®dDVã@s ddlmZddlZddlZddlZddlZddlZddlm    Z
ddl m Z ddl mZddlmZddlmZddlmZddlZdd    lmZdd
lmZdd lmZdd lmZdd lmZddlmZddlmZddl m!Z!ddl m"Z"ddl m#Z#ddl m$Z$ddl m%Z%ddl m&Z&ddl'm(Z(ddl)m*Z*ddl)m+Z,ddl-m.Z/ddl0m1Z1ddl0mZ2ddl3m4Z4ddl3m5Z5ddl6m7Z7dd l6m8Z8dd!l6m9Z9dd"l:m;Z;dd#l:m<Z<dd$l:m=Z=dd%l:m>Z>dd&l:m?Z?dd'l:m@Z@dd(lAmBZBdd)lAmCZCdd*lAmDZDdd+lAmEZEdd,lFmGZGdd-lFmHZHdd.lmIZIdd/lJmKZKdd0lJmLZLdd1lJmMZMdd2lJmNZNdd3lJmOZOdd4lPmQZQdd5lPmRZRdd6lSmTZTdd7lSmUZUdd8lSmVZVdd9lSmWZWdd:lSmXZXdd;lYmZZZdd<lYm[Z[dd=l\m]Z]ddl\m.Z.ej^r,dd>l_m`Z`dd?lambZbdd@lamcZcejddAe2jedBZfejddCe2jgdBZhejddDe2jidBZjejddEe2jkdBZlejddFe2jmdBZndGdHdIœdJdK„ZoGdLdM„dMeNƒZpdS)Né)Ú annotationsN)ÚIterator)Ú    timedelta)Úiscoroutinefunction)Úchain)Ú TracebackType)Úquote)ÚHeaders)Ú ImmutableDict)ÚAborter)Ú
BadRequest)ÚBadRequestKeyError)Ú HTTPException)ÚInternalServerError)Ú
BuildError)ÚMap)Ú
MapAdapter)ÚRequestRedirect)ÚRoutingException)ÚRule)Úis_running_from_reloader)Úcached_property)Úredirect)ÚResponseé)Úcli)Útyping)ÚConfig)ÚConfigAttribute)Ú_AppCtxGlobals©Ú
AppContext©ÚRequestContext)Ú_cv_app)Ú _cv_request)Úg)Úrequest)Ú request_ctx)Úsession)Ú_split_blueprint_path)Úget_debug_flag)Úget_flashed_messages)Úget_load_dotenv)ÚDefaultJSONProvider)Ú JSONProvider©Ú create_logger)Ú_endpoint_from_view_func)Ú    _sentinel)Ú find_package)ÚScaffold)Ú setupmethod)ÚSecureCookieSessionInterface)ÚSessionInterface)Úappcontext_tearing_down)Úgot_request_exception)Úrequest_finished)Úrequest_started)Úrequest_tearing_down©ÚDispatchingJinjaLoader)Ú Environment)ÚRequest)Ú    Blueprint©Ú FlaskClient©ÚFlaskCliRunnerÚT_shell_context_processor)ÚboundÚ
T_teardownÚT_template_filterÚT_template_globalÚT_template_testztimedelta | int | Noneztimedelta | None©ÚvalueÚreturncCs |dkst|tƒr|St|dS)N)Úseconds)Ú
isinstancer)rN©rRú@d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\flask/app.pyÚ_make_timedeltaUsrTcs*eZdZUdZeZeZeZ    e
Z e Z eZedƒZedƒZededZeZded<iZded    <ed
d d
d
ed d d d
ddd
d
dd d
dd
d
d
d d dd
ddœƒZeZeZd
Z ded<d
Z!ded<e"ƒZ#ded<dèddddddddddd œ
‡fd!d"„ Z$dd#d$œd%d&„Z%e&dd'œd(d)„ƒZ'e&d*d'œd+d,„ƒZ(e&d-d'œd.d/„ƒZ)e*dd'œd0d1„ƒZ+dédd2d3œd4d5„Z,d6d'œd7d8„Z-dd'œd9d:„Z.dêddd<d=œd>d?„Z/d-d'œd@dA„Z0dBd'œdCdD„Z1dddEœdFdG„Z2dd#dHœdIdJ„Z3dd'œdKdL„Z4e*dd'œdMdN„ƒZ5e5j6dd#dOœdPdN„ƒZ5dëddQdRddSd#dTœdUdV„Z7dìddSdWdXœdYdZ„Z8dSd[d\œd]d^„Z9e:d_dSd#d`œdadb„ƒZ;dcd'œddde„Z<e:dídddfdRdSd#dgœdhdi„ƒZ=e:dîddjdkœdldm„ƒZ>e:dïdndd#doœdpdq„ƒZ?e:dðddrdkœdsdt„ƒZ@e:dñdudd#doœdvdw„ƒZAe:dòddxdkœdydz„ƒZBe:dód{dd#doœd|d}„ƒZCe:d~d~dœd€d„ƒZDe:d‚d‚dœdƒd„„ƒZEd…d†d‡œdˆd‰„ZFdŠd‹d‡œdŒd„ZGd…dd‡œdŽd„ZHd…d‹d‡œdd‘„ZId…d’d‡œd“d”„ZJd•d#d–œd—d˜„ZKd™dšd›œdœd„ZLdžd'œdŸd „ZMd’d'œd¡d¢„ZNdôd£dd’d¤œd¥d¦„ZOd’d'œd§d¨„ZPd©ddªœd«d¬„ZQd­d­d®œd¯d°„ZRd±d²d®œd³d´„ZSd
d
d
d
dµœdddddRdSdd¶œd·d¸„ZTdõddºd»d¼œd½d¾„ZUdžd’d¿œdÀdÁ„ZVdÂdÃd›œdÄdńZWddd#dƜdÇdȄZXdÉddÊdd˜dÌd̈́ZYdÎd'œdÏdЄZZd’d’dќdÒdӄZ[e\fd©d#dԜdÕdքZ]e\fd©d#dԜd×d؄Z^dÙd'œdÚdۄZ_ddÜdݜdÞd߄Z`dSdSdÜdàœdádâ„Zadd­dSdãœdädå„Zbdd­dSdãœdædç„Zc‡ZdS)öÚFlaskaÒThe flask object implements a WSGI application and acts as the central
    object.  It is passed the name of the module or package of the
    application.  Once it is created it will act as a central registry for
    the view functions, the URL rules, template configuration and much more.
 
    The name of the package is used to resolve resources from inside the
    package or the folder the module is contained in depending on if the
    package parameter resolves to an actual python package (a folder with
    an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file).
 
    For more information about resource loading, see :func:`open_resource`.
 
    Usually you create a :class:`Flask` instance in your main module or
    in the :file:`__init__.py` file of your package like this::
 
        from flask import Flask
        app = Flask(__name__)
 
    .. admonition:: About the First Parameter
 
        The idea of the first parameter is to give Flask an idea of what
        belongs to your application.  This name is used to find resources
        on the filesystem, can be used by extensions to improve debugging
        information and a lot more.
 
        So it's important what you provide there.  If you are using a single
        module, `__name__` is always the correct value.  If you however are
        using a package, it's usually recommended to hardcode the name of
        your package there.
 
        For example if your application is defined in :file:`yourapplication/app.py`
        you should create it with one of the two versions below::
 
            app = Flask('yourapplication')
            app = Flask(__name__.split('.')[0])
 
        Why is that?  The application will work even with `__name__`, thanks
        to how resources are looked up.  However it will make debugging more
        painful.  Certain extensions can make assumptions based on the
        import name of your application.  For example the Flask-SQLAlchemy
        extension will look for the code in your application that triggered
        an SQL query in debug mode.  If the import name is not properly set
        up, that debugging information is lost.  (For example it would only
        pick up SQL queries in `yourapplication.app` and not
        `yourapplication.views.frontend`)
 
    .. versionadded:: 0.7
       The `static_url_path`, `static_folder`, and `template_folder`
       parameters were added.
 
    .. versionadded:: 0.8
       The `instance_path` and `instance_relative_config` parameters were
       added.
 
    .. versionadded:: 0.11
       The `root_path` parameter was added.
 
    .. versionadded:: 1.0
       The ``host_matching`` and ``static_host`` parameters were added.
 
    .. versionadded:: 1.0
       The ``subdomain_matching`` parameter was added. Subdomain
       matching needs to be enabled manually now. Setting
       :data:`SERVER_NAME` does not implicitly enable it.
 
    :param import_name: the name of the application package
    :param static_url_path: can be used to specify a different path for the
                            static files on the web.  Defaults to the name
                            of the `static_folder` folder.
    :param static_folder: The folder with static files that is served at
        ``static_url_path``. Relative to the application ``root_path``
        or an absolute path. Defaults to ``'static'``.
    :param static_host: the host to use when adding the static route.
        Defaults to None. Required when using ``host_matching=True``
        with a ``static_folder`` configured.
    :param host_matching: set ``url_map.host_matching`` attribute.
        Defaults to False.
    :param subdomain_matching: consider the subdomain relative to
        :data:`SERVER_NAME` when matching routes. Defaults to False.
    :param template_folder: the folder that contains the templates that should
                            be used by the application.  Defaults to
                            ``'templates'`` folder in the root path of the
                            application.
    :param instance_path: An alternative instance path for the application.
                          By default the folder ``'instance'`` next to the
                          package or module is assumed to be the instance
                          path.
    :param instance_relative_config: if set to ``True`` relative filenames
                                     for loading the config are assumed to
                                     be relative to the instance path instead
                                     of the application root.
    :param root_path: The path to the root of the application files.
        This should only be set manually when it can't be detected
        automatically, such as for namespace packages.
    ÚTESTINGÚ
SECRET_KEYÚPERMANENT_SESSION_LIFETIME)Z get_converterztype[JSONProvider]Újson_provider_classÚdictÚ jinja_optionsNFé)Údaysú/r)TÚhttpiý)ÚDEBUGrVÚPROPAGATE_EXCEPTIONSrWrXZUSE_X_SENDFILEÚ SERVER_NAMEÚAPPLICATION_ROOTZSESSION_COOKIE_NAMEZSESSION_COOKIE_DOMAINZSESSION_COOKIE_PATHZSESSION_COOKIE_HTTPONLYZSESSION_COOKIE_SECUREZSESSION_COOKIE_SAMESITEZSESSION_REFRESH_EACH_REQUESTZMAX_CONTENT_LENGTHZSEND_FILE_MAX_AGE_DEFAULTÚTRAP_BAD_REQUEST_ERRORSÚTRAP_HTTP_EXCEPTIONSZEXPLAIN_TEMPLATE_LOADINGÚPREFERRED_URL_SCHEMEÚTEMPLATES_AUTO_RELOADZMAX_COOKIE_SIZEztype[FlaskClient] | NoneÚtest_client_classztype[FlaskCliRunner] | NoneÚtest_cli_runner_classr8Úsession_interfaceÚstaticÚ    templatesÚstrz
str | Nonezstr | os.PathLike | NoneÚbool)
Ú import_nameÚstatic_url_pathÚ static_folderÚ static_hostÚ host_matchingÚsubdomain_matchingÚtemplate_folderÚ instance_pathÚinstance_relative_configÚ    root_pathc sôtƒj|||||
d|dkr(| ¡}ntj |¡s<tdƒ‚||_| |    ¡|_    | 
¡|_ |  |¡|_ g|_g|_g|_i|_i|_| ¡|_||j_||_d|_|jræt|ƒ|ksºtdƒ‚t |¡‰|j|j›dd|‡fdd„d    |j|j _dS)
N)rorqrprurxzWIf an instance path is provided it must be absolute. A relative path was given instead.Fz-Invalid static_host/host_matching combinationz/<path:filename>rkcsˆƒjf|ŽS©N)Zsend_static_file)Úkw©Zself_refrRrSÚ<lambda>öóz Flask.__init__.<locals>.<lambda>)ÚendpointÚhostÚ    view_func)!ÚsuperÚ__init__Úauto_find_instance_pathÚosÚpathÚisabsÚ
ValueErrorrvÚ make_configÚconfigÚ make_aborterZaborterrYÚjsonÚurl_build_error_handlersÚteardown_appcontext_funcsÚshell_context_processorsÚ
blueprintsÚ
extensionsÚ url_map_classÚurl_maprsrtÚ_got_first_requestZhas_static_folderrnÚAssertionErrorÚweakrefÚrefÚ add_url_rulerpÚnamer) Úselfrorprqrrrsrtrurvrwrx©Ú    __class__r{rSr‚bsP û
 ÿ 
 þ
 
 
ÿþ
 
 
ü    zFlask.__init__ÚNone)Úf_namerOcCs|jrtd|›dƒ‚dS)NzThe setup method 'zõ' can no longer be called on the application. It has already handled its first request, any changes will not be applied consistently.
Make sure all imports, decorators, functions, etc. needed to set up the application are done before running it.)r“r”)r™rrRrRrSÚ_check_setup_finishedýs
ÿzFlask._check_setup_finished)rOcCsF|jdkr@ttjdddƒ}|dkr(dStj tj |¡¡dS|jS)a_The name of the application.  This is usually the import name
        with the difference that it's guessed from the run file if the
        import name is main.  This name is used as a display name when
        Flask needs the name of the application.  It can be set and overridden
        to change the value.
 
        .. versionadded:: 0.8
        Ú__main__Ú__file__Nr)roÚgetattrÚsysÚmodulesr„r…ÚsplitextÚbasename)r™ÚfnrRrRrSr˜    s
 
z
Flask.namezlogging.LoggercCst|ƒS)a»A standard Python :class:`~logging.Logger` for the app, with
        the same name as :attr:`name`.
 
        In debug mode, the logger's :attr:`~logging.Logger.level` will
        be set to :data:`~logging.DEBUG`.
 
        If there are no handlers configured, a default handler will be
        added. See :doc:`/logging` for more information.
 
        .. versionchanged:: 1.1.0
            The logger takes the same name as :attr:`name` rather than
            hard-coding ``"flask.app"``.
 
        .. versionchanged:: 1.0.0
            Behavior was simplified. The logger is always named
            ``"flask.app"``. The level is only set during configuration,
            it doesn't check ``app.debug`` each time. Only one format is
            used, not different ones depending on ``app.debug``. No
            handlers are removed, and a handler is only added if no
            handlers are already configured.
 
        .. versionadded:: 0.3
        r0©r™rRrRrSÚloggersz Flask.loggerr@cCs| ¡S)zÓThe Jinja environment used to load templates.
 
        The environment is created the first time this property is
        accessed. Changing :attr:`jinja_options` after that will have no
        effect.
        )Úcreate_jinja_environmentr§rRrRrSÚ    jinja_env5szFlask.jinja_envcCsddl}|jdtdd|jS)zÏThis attribute is set to ``True`` if the application started
        handling the first request.
 
        .. deprecated:: 2.3
            Will be removed in Flask 2.4.
 
        .. versionadded:: 0.8
        rNzC'got_first_request' is deprecated and will be removed in Flask 2.4.é)Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarningr“)r™r­rRrRrSÚgot_first_request?s
ýzFlask.got_first_requestr)Úinstance_relativerOcCs0|j}|r|j}t|jƒ}tƒ|d<| ||¡S)adUsed to create the config attribute by the Flask constructor.
        The `instance_relative` parameter is passed in from the constructor
        of Flask (there named `instance_relative_config`) and indicates if
        the config should be relative to the instance path or the root path
        of the application.
 
        .. versionadded:: 0.8
        r`)rxrvrZÚdefault_configr+Ú config_class)r™r±rxÚdefaultsrRrRrSrˆRs     
 
zFlask.make_configr cCs| ¡S)aVCreate the object to assign to :attr:`aborter`. That object
        is called by :func:`flask.abort` to raise HTTP errors, and can
        be called directly as well.
 
        By default, this creates an instance of :attr:`aborter_class`,
        which defaults to :class:`werkzeug.exceptions.Aborter`.
 
        .. versionadded:: 2.2
        )Ú aborter_classr§rRrRrSrŠbs
zFlask.make_abortercCs<t|jƒ\}}|dkr$tj |d¡Stj |d|j›d¡S)aTries to locate the instance path if it was not provided to the
        constructor of the application class.  It will basically calculate
        the path to a folder named ``instance`` next to your main file or
        the package.
 
        .. versionadded:: 0.8
        NÚinstanceÚvarz    -instance)r4ror„r…Újoinr˜)r™ÚprefixÚ package_pathrRrRrSrƒnszFlask.auto_find_instance_pathÚrbzt.IO[t.AnyStr])ÚresourceÚmoderOcCsttj |j|¡|ƒS)aªOpens a resource from the application's instance folder
        (:attr:`instance_path`).  Otherwise works like
        :meth:`open_resource`.  Instance resources can also be opened for
        writing.
 
        :param resource: the name of the resource.  To access resources within
                         subfolders use forward slashes as separator.
        :param mode: resource file opening mode, default is 'rb'.
        )Úopenr„r…r¸rv)r™r¼r½rRrRrSÚopen_instance_resource{s
zFlask.open_instance_resourcecCs€t|jƒ}d|kr|j|d<d|krD|jd}|dkr<|j}||d<|j|f|Ž}|jj|jt    |jt
t t d|j j|jd<|S)aÇCreate the Jinja environment based on :attr:`jinja_options`
        and the various Jinja-related methods of the app. Changing
        :attr:`jinja_options` after this will have no effect. Also adds
        Flask-related globals and filters to the environment.
 
        .. versionchanged:: 0.11
           ``Environment.auto_reload`` set in accordance with
           ``TEMPLATES_AUTO_RELOAD`` configuration option.
 
        .. versionadded:: 0.5
        Z
autoescapeÚ auto_reloadrgN)Úurl_forr,r‰r'r)r&zjson.dumps_function)rZr[Úselect_jinja_autoescaper‰ÚdebugÚjinja_environmentÚglobalsÚupdaterÁr,r'r)r&r‹ÚdumpsZpolicies)r™ÚoptionsrÀÚrvrRrRrSr©‡s&
 
 
÷ zFlask.create_jinja_environmentr?cCst|ƒS)a Creates the loader for the Jinja2 environment.  Can be used to
        override just the loader and keeping the rest unchanged.  It's
        discouraged to override this function.  Instead one should override
        the :meth:`jinja_loader` function instead.
 
        The global loader dispatches between the loaders of the application
        and the individual blueprints.
 
        .. versionadded:: 0.7
        r>r§rRrRrSÚcreate_global_jinja_loader¯s z Flask.create_global_jinja_loader)ÚfilenamerOcCs|dkr dS| d¡S)aReturns ``True`` if autoescaping should be active for the given
        template name. If no template name is given, returns `True`.
 
        .. versionchanged:: 2.2
            Autoescaping is now enabled by default for ``.svg`` files.
 
        .. versionadded:: 0.5
        NT)z.htmlz.htmz.xmlz.xhtmlz.svg)Úendswith)r™rËrRrRrSr¼s    zFlask.select_jinja_autoescape)ÚcontextrOcCs^d}trt|ttjƒƒ}| ¡}|D]*}||jkr$|j|D]}| |ƒ¡q<q$| |¡dS)aUpdate the template context with some commonly used variables.
        This injects request, session, config and g into the template
        context as well as everything template context processors want
        to inject.  Note that the as of Flask 0.6, the original values
        in the context will not be overridden if a context processor
        decides to return a value with the same key.
 
        :param context: the context as a dictionary that is updated in place
                        to add extra variables.
        ryN)r'rÚreversedrÚcopyZtemplate_context_processorsrÆ)r™rÍÚnamesZorig_ctxr˜ÚfuncrRrRrSÚupdate_template_contextÉs 
zFlask.update_template_contextcCs&|tdœ}|jD]}| |ƒ¡q|S)z¹Returns the shell context for an interactive shell for this
        application.  This runs all the registered shell context
        processors.
 
        .. versionadded:: 0.11
        )Zappr&)r&rŽrÆ)r™rÉÚ    processorrRrRrSÚmake_shell_contextås
 
zFlask.make_shell_contextcCs
|jdS)a¢Whether debug mode is enabled. When using ``flask run`` to start the
        development server, an interactive debugger will be shown for unhandled
        exceptions, and the server will be reloaded when code changes. This maps to the
        :data:`DEBUG` config key. It may not behave as expected if set late.
 
        **Do not enable debug mode when deploying in production.**
 
        Default: ``False``
        r`)r‰r§rRrRrSrÃñs z Flask.debugrMcCs$||jd<|jddkr ||j_dS)Nr`rg)r‰rªrÀ)r™rNrRrRrSrÃþs
z
int | Nonez bool | Nonezt.Any)rÚportrÃÚ load_dotenvrÈrOc Ks,tj d¡dkr(tƒs$tjddddSt|ƒrJt ¡dtjkrJt    ƒ|_
|dk    r\t |ƒ|_
|j  d¡}d}}|r„|  d    ¡\}}    }|s–|r’|}nd
}|s¢|d kr¬t|ƒ}n|rºt|ƒ}nd }| d |j
¡| d|j
¡| dd¡t |j
|j¡d dlm}
z|
t t|¡||f|ŽW5d|_XdS)a×
Runs the application on a local development server.
 
        Do not use ``run()`` in a production setting. It is not intended to
        meet security and performance requirements for a production server.
        Instead, see :doc:`/deploying/index` for WSGI server recommendations.
 
        If the :attr:`debug` flag is set the server will automatically reload
        for code changes and show a debugger in case an exception happened.
 
        If you want to run the application in debug mode, but disable the
        code execution on the interactive debugger, you can pass
        ``use_evalex=False`` as parameter.  This will keep the debugger's
        traceback screen active, but disable code execution.
 
        It is not recommended to use this function for development with
        automatic reloading as this is badly supported.  Instead you should
        be using the :command:`flask` command line script's ``run`` support.
 
        .. admonition:: Keep in Mind
 
           Flask will suppress any server error with a generic error page
           unless it is in debug mode.  As such to enable just the
           interactive debugger without the code reloading, you have to
           invoke :meth:`run` with ``debug=True`` and ``use_reloader=False``.
           Setting ``use_debugger`` to ``True`` without being in debug mode
           won't catch any exceptions because there won't be any to
           catch.
 
        :param host: the hostname to listen on. Set this to ``'0.0.0.0'`` to
            have the server available externally as well. Defaults to
            ``'127.0.0.1'`` or the host in the ``SERVER_NAME`` config variable
            if present.
        :param port: the port of the webserver. Defaults to ``5000`` or the
            port defined in the ``SERVER_NAME`` config variable if present.
        :param debug: if given, enable or disable debug mode. See
            :attr:`debug`.
        :param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv`
            files to set environment variables. Will also change the working
            directory to the directory containing the first file found.
        :param options: the options to be forwarded to the underlying Werkzeug
            server. See :func:`werkzeug.serving.run_simple` for more
            information.
 
        .. versionchanged:: 1.0
            If installed, python-dotenv will be used to load environment
            variables from :file:`.env` and :file:`.flaskenv` files.
 
            The :envvar:`FLASK_DEBUG` environment variable will override :attr:`debug`.
 
            Threaded mode is enabled by default.
 
        .. versionchanged:: 0.10
            The default port is now picked from the ``SERVER_NAME``
            variable.
        ZFLASK_RUN_FROM_CLIÚtruez• * Ignoring a call to 'app.run()' that would block the current 'flask' CLI command.
   Only call 'app.run()' in an 'if __name__ == "__main__"' guard.Úred)ZfgNZ FLASK_DEBUGrbú:z    127.0.0.1riˆZ use_reloaderZ use_debuggerZthreadedT)Ú
run_simpleF)r„ÚenvironÚgetrÚclickZsechor-rrÖr+rÃrnr‰Ú    partitionÚintÚ
setdefaultZshow_server_bannerr˜Úwerkzeug.servingrÚr“ÚtÚcastrm) r™rrÕrÃrÖrÈÚ server_nameZsn_hostZsn_portÚ_rÚrRrRrSÚrunsDAû
 
 
 
  z    Flask.runrD)Ú use_cookiesÚkwargsrOcKs2|j}|dkrddlm}|||jfd|i|—ŽS)a”Creates a test client for this application.  For information
        about unit testing head over to :doc:`/testing`.
 
        Note that if you are testing for assertions or exceptions in your
        application code, you must set ``app.testing = True`` in order for the
        exceptions to propagate to the test client.  Otherwise, the exception
        will be handled by the application (not visible to the test client) and
        the only indication of an AssertionError or other exception will be a
        500 status code response to the test client.  See the :attr:`testing`
        attribute.  For example::
 
            app.testing = True
            client = app.test_client()
 
        The test client can be used in a ``with`` block to defer the closing down
        of the context until the end of the ``with`` block.  This is useful if
        you want to access the context locals for testing::
 
            with app.test_client() as c:
                rv = c.get('/?vodka=42')
                assert request.args['vodka'] == '42'
 
        Additionally, you may pass optional keyword arguments that will then
        be passed to the application's :attr:`test_client_class` constructor.
        For example::
 
            from flask.testing import FlaskClient
 
            class CustomClient(FlaskClient):
                def __init__(self, *args, **kwargs):
                    self._authentication = kwargs.pop("authentication")
                    super(CustomClient,self).__init__( *args, **kwargs)
 
            app.test_client_class = CustomClient
            client = app.test_client(authentication='Basic ....')
 
        See :class:`~flask.testing.FlaskClient` for more information.
 
        .. versionchanged:: 0.4
           added support for ``with`` block usage for the client.
 
        .. versionadded:: 0.7
           The `use_cookies` parameter was added as well as the ability
           to override the client to be used by setting the
           :attr:`test_client_class` attribute.
 
        .. versionchanged:: 0.11
           Added `**kwargs` to support passing additional keyword arguments to
           the constructor of :attr:`test_client_class`.
        NrrCrç)rhÚtestingrDÚresponse_class)r™rçrèÚclsrRrRrSÚ test_client€s3 ÿÿÿzFlask.test_clientrF)rèrOcKs&|j}|dkrddlm}||f|ŽS)a-Create a CLI runner for testing CLI commands.
        See :ref:`testing-cli`.
 
        Returns an instance of :attr:`test_cli_runner_class`, by default
        :class:`~flask.testing.FlaskCliRunner`. The Flask app object is
        passed as the first argument.
 
        .. versionadded:: 1.0
        NrrE)rirérF)r™rèrërRrRrSÚtest_cli_runnerºs
 zFlask.test_cli_runnerrB)Ú    blueprintrÈrOcKs| ||¡dS)axRegister a :class:`~flask.Blueprint` on the application. Keyword
        arguments passed to this method will override the defaults set on the
        blueprint.
 
        Calls the blueprint's :meth:`~flask.Blueprint.register` method after
        recording the blueprint in the application's :attr:`blueprints`.
 
        :param blueprint: The blueprint to register.
        :param url_prefix: Blueprint routes will be prefixed with this.
        :param subdomain: Blueprint routes will match on this subdomain.
        :param url_defaults: Blueprint routes will use these default values for
            view arguments.
        :param options: Additional keyword arguments are passed to
            :class:`~flask.blueprints.BlueprintSetupState`. They can be
            accessed in :meth:`~flask.Blueprint.record` callbacks.
 
        .. versionchanged:: 2.0.1
            The ``name`` option can be used to change the (pre-dotted)
            name the blueprint is registered with. This allows the same
            blueprint to be registered multiple times with unique names
            for ``url_for``.
 
        .. versionadded:: 0.7
        N)Úregister)r™rîrÈrRrRrSÚregister_blueprintËszFlask.register_blueprintzt.ValuesView[Blueprint]cCs
|j ¡S)zhIterates over all blueprints by the order they were registered.
 
        .. versionadded:: 0.11
        )rÚvaluesr§rRrRrSÚiter_blueprintsçszFlask.iter_blueprintszft.RouteCallable | None)Úruler~r€Úprovide_automatic_optionsrÈrOc    Ks|dkrt|ƒ}||d<| dd¡}|dkr<t|ddƒp:d}t|tƒrNtdƒ‚dd„|Dƒ}tt|ddƒƒ}|dkr€t|d    dƒ}|dkr¤d
|kr d }| d
¡nd }||O}|j|fd|i|—Ž}||_    |j
 |¡|dk    r|j   |¡}|dk    r ||kr t d |›ƒ‚||j |<dS)Nr~Úmethods)ÚGETzYAllowed methods must be a list of strings, for example: @app.route(..., methods=["POST"])cSsh|] }| ¡’qSrR)Úupper)Ú.0ÚitemrRrRrSÚ    <setcomp>sz%Flask.add_url_rule.<locals>.<setcomp>Úrequired_methodsrRrôÚOPTIONSTFzDView function mapping is overwriting an existing endpoint function: )r2Úpopr¡rQrmÚ    TypeErrorÚsetÚaddÚurl_rule_classrôr’Úview_functionsrÜr”)    r™rór~r€rôrÈrõrûZold_funcrRrRrSr—îsD     
ÿÿ  
 ÿzFlask.add_url_rulez2t.Callable[[T_template_filter], T_template_filter])r˜rOcsdddœ‡‡fdd„ }|S)aA decorator that is used to register custom template filter.
        You can specify a name for the filter, otherwise the function
        name will be used. Example::
 
          @app.template_filter()
          def reverse(s):
              return s[::-1]
 
        :param name: the optional name of the filter, otherwise the
                     function name will be used.
        rJ©ÚfrOcsˆj|ˆd|S©N)r˜)Úadd_template_filter©r©r˜r™rRrSÚ    decorator9sz(Flask.template_filter.<locals>.decoratorrR©r™r˜r    rRrrSÚtemplate_filter)szFlask.template_filterzft.TemplateFilterCallable)rr˜rOcCs||jj|p|j<dS)zäRegister a custom template filter.  Works exactly like the
        :meth:`template_filter` decorator.
 
        :param name: the optional name of the filter, otherwise the
                     function name will be used.
        N)rªÚfiltersÚ__name__©r™rr˜rRrRrSr?s
zFlask.add_template_filterz.t.Callable[[T_template_test], T_template_test]csdddœ‡‡fdd„ }|S)aSA decorator that is used to register custom template test.
        You can specify a name for the test, otherwise the function
        name will be used. Example::
 
          @app.template_test()
          def is_prime(n):
              if n == 2:
                  return True
              for i in range(2, int(math.ceil(math.sqrt(n))) + 1):
                  if n % i == 0:
                      return False
              return True
 
        .. versionadded:: 0.10
 
        :param name: the optional name of the test, otherwise the
                     function name will be used.
        rLrcsˆj|ˆd|Sr)Úadd_template_testrrrRrSr    bsz&Flask.template_test.<locals>.decoratorrRr
rRrrSÚ template_testKszFlask.template_testzft.TemplateTestCallablecCs||jj|p|j<dS)zþRegister a custom template test.  Works exactly like the
        :meth:`template_test` decorator.
 
        .. versionadded:: 0.10
 
        :param name: the optional name of the test, otherwise the
                     function name will be used.
        N)rªÚtestsr rrRrRrSrhs zFlask.add_template_testz2t.Callable[[T_template_global], T_template_global]csdddœ‡‡fdd„ }|S)a¿A decorator that is used to register a custom template global function.
        You can specify a name for the global function, otherwise the function
        name will be used. Example::
 
            @app.template_global()
            def double(n):
                return 2 * n
 
        .. versionadded:: 0.10
 
        :param name: the optional name of the global function, otherwise the
                     function name will be used.
        rKrcsˆj|ˆd|Sr)Úadd_template_globalrrrRrSr    ˆsz(Flask.template_global.<locals>.decoratorrRr
rRrrSÚtemplate_globalvszFlask.template_globalzft.TemplateGlobalCallablecCs||jj|p|j<dS)aRegister a custom template global function. Works exactly like the
        :meth:`template_global` decorator.
 
        .. versionadded:: 0.10
 
        :param name: the optional name of the global function, otherwise the
                     function name will be used.
        N)rªrÅr rrRrRrSrŽs zFlask.add_template_globalrIrcCs|j |¡|S)a¨Registers a function to be called when the application
        context is popped. The application context is typically popped
        after the request context for each request, at the end of CLI
        commands, or after a manually pushed context ends.
 
        .. code-block:: python
 
            with app.app_context():
                ...
 
        When the ``with`` block exits (or ``ctx.pop()`` is called), the
        teardown functions are called just before the app context is
        made inactive. Since a request context typically also manages an
        application context it would also be called when you pop a
        request context.
 
        When a teardown function was called because of an unhandled
        exception it will be passed an error object. If an
        :meth:`errorhandler` is registered, it will handle the exception
        and the teardown will not receive it.
 
        Teardown functions must avoid raising exceptions. If they
        execute code that might fail they must surround that code with a
        ``try``/``except`` block and log any errors.
 
        The return values of teardown functions are ignored.
 
        .. versionadded:: 0.9
        )rÚappend©r™rrRrRrSÚteardown_appcontextœs zFlask.teardown_appcontextrGcCs|j |¡|S)zVRegisters a shell context processor function.
 
        .. versionadded:: 0.11
        )rŽrrrRrRrSÚshell_context_processor¾s zFlask.shell_context_processorÚ    Exceptionzft.ErrorHandlerCallable | None)ÚerOc
Cs†| t|ƒ¡\}}tjd˜}|dk    r,|dfndD]P}|D]F}|j||}|sPq8|jD]&}| |¡}    |    dk    rV|    SqVq8q0dS)a(Return a registered error handler for an exception in this order:
        blueprint handler for a specific code, app handler for a specific code,
        blueprint handler for an exception class, app handler for an exception
        class, or ``None`` if a suitable handler is not found.
        Nry)N)Z_get_exc_class_and_codeÚtyper'rZerror_handler_specÚ__mro__rÜ)
r™rÚ    exc_classÚcoderÐÚcr˜Z handler_maprëÚhandlerrRrRrSÚ_find_error_handlerÉs
 
 
zFlask._find_error_handlerrz&HTTPException | ft.ResponseReturnValuecCs@|jdkr|St|tƒr|S| |¡}|dkr2|S| |¡|ƒS)acHandles an HTTP exception.  By default this will invoke the
        registered error handlers and fall back to returning the
        exception as response.
 
        .. versionchanged:: 1.0.3
            ``RoutingException``, used internally for actions such as
             slash redirects during routing, is not passed to error
             handlers.
 
        .. versionchanged:: 1.0
            Exceptions are looked up by code *and* by MRO, so
            ``HTTPException`` subclasses can be handled with a catch-all
            handler for the base ``HTTPException``.
 
        .. versionadded:: 0.3
        N)rrQrr Ú ensure_sync©r™rrrRrRrSÚhandle_http_exceptionàs
 
 
zFlask.handle_http_exceptioncCsF|jdrdS|jd}|dkr4|jr4t|tƒr4dS|rBt|tƒSdS)aùChecks if an HTTP exception should be trapped or not.  By default
        this will return ``False`` for all exceptions except for a bad request
        key error if ``TRAP_BAD_REQUEST_ERRORS`` is set to ``True``.  It
        also returns ``True`` if ``TRAP_HTTP_EXCEPTIONS`` is set to ``True``.
 
        This is called for all HTTP exceptions raised by a view function.
        If it returns ``True`` for any exception the error handler for this
        exception is not called and it shows up as regular exception in the
        traceback.  This is helpful for debugging implicitly raised HTTP
        exceptions.
 
        .. versionchanged:: 1.0
            Bad request errors are not trapped by default in debug mode.
 
        .. versionadded:: 0.8
        reTrdNF)r‰rÃrQr r )r™rZtrap_bad_requestrRrRrSÚtrap_http_exceptions
 
ÿþý
zFlask.trap_http_exceptioncCs`t|tƒr |js|jdr d|_t|tƒr>| |¡s>| |¡S| |¡}|dkrR‚|     |¡|ƒS)a>This method is called whenever an exception occurs that
        should be handled. A special case is :class:`~werkzeug
        .exceptions.HTTPException` which is forwarded to the
        :meth:`handle_http_exception` method. This function will either
        return a response value or reraise the exception with the same
        traceback.
 
        .. versionchanged:: 1.0
            Key errors raised from request data like ``form`` show the
            bad key in debug mode rather than a generic bad request
            message.
 
        .. versionadded:: 0.7
        rdTN)
rQr rÃr‰Zshow_exceptionrr$r#r r!r"rRrRrSÚhandle_user_exception&s
ÿÿ
 
zFlask.handle_user_exceptionrcCst ¡}tj||j|d|jd}|dkr8|jp6|j}|rN|d|krJ‚|‚| |¡t    |d}| 
|¡}|dk    r‚| |¡|ƒ}|j |ddS)a½Handle an exception that did not have an error handler
        associated with it, or that was raised from an error handler.
        This always causes a 500 ``InternalServerError``.
 
        Always sends the :data:`got_request_exception` signal.
 
        If :data:`PROPAGATE_EXCEPTIONS` is ``True``, such as in debug
        mode, the error will be re-raised so that the debugger can
        display it. Otherwise, the original exception is logged, and
        an :exc:`~werkzeug.exceptions.InternalServerError` is returned.
 
        If an error handler is registered for ``InternalServerError`` or
        ``500``, it will be used. For consistency, the handler will
        always receive the ``InternalServerError``. The original
        unhandled exception is available as ``e.original_exception``.
 
        .. versionchanged:: 1.1.0
            Always passes the ``InternalServerError`` instance to the
            handler, setting ``original_exception`` to the unhandled
            error.
 
        .. versionchanged:: 1.1.0
            ``after_request`` functions and other finalization is done
            even for the default 500 response when there is no handler.
 
        .. versionadded:: 0.3
        )Ú_async_wrapperÚ    exceptionraNr)Zoriginal_exceptionT)Úfrom_error_handler) r¢Úexc_infor:Úsendr!r‰rérÃÚ log_exceptionrr Úfinalize_request)r™rr)Ú    propagateÚ server_errorrrRrRrSÚhandle_exceptionFs
 
 
 
zFlask.handle_exceptionzEtuple[type, BaseException, TracebackType] | tuple[(None, None, None)])r)rOcCs&|jjdtj›dtj›d|ddS)a Logs an exception.  This is called by :meth:`handle_exception`
        if debugging is disabled and right before the handler is called.
        The default implementation logs the exception as error on the
        :attr:`logger`.
 
        .. versionadded:: 0.8
        z Exception on z [ú])r)N)r¨Úerrorr'r…Úmethod)r™r)rRrRrSr+{s ÿzFlask.log_exceptionrAz
t.NoReturn)r'rOcCsF|jr(t|jtƒr(|jjdks(|jdkr.|j‚ddlm}||ƒ‚dS)a×Intercept routing exceptions and possibly do something else.
 
        In debug mode, intercept a routing redirect and replace it with
        an error if the body will be discarded.
 
        With modern Werkzeug this shouldn't occur, since it now uses a
        308 status which tells the browser to resend the method and
        body.
 
        .. versionchanged:: 2.1
            Don't intercept 307 and 308 redirects.
 
        :meta private:
        :internal:
        >é3é4>röÚHEADrür)ÚFormDataRoutingRedirectN)rÃrQÚrouting_exceptionrrr2Z debughelpersr6)r™r'r6rRrRrSÚraise_routing_exceptionŠsÿ
þ
ýü zFlask.raise_routing_exceptionzft.ResponseReturnValuecCs\tj}|jdk    r| |¡|j}t|ddƒr>|jdkr>| ¡S|j}|     |j
|j ¡f|ŽS)a·Does the request dispatching.  Matches the URL and returns the
        return value of the view or error handler.  This does not have to
        be a response object.  In order to convert the return value to a
        proper response object, call :func:`make_response`.
 
        .. versionchanged:: 0.7
           This no longer does the exception handling, this code was
           moved to the new :meth:`full_dispatch_request`.
        NrôFrü) r(r'r7r8Zurl_ruler¡r2Úmake_default_options_responseÚ    view_argsr!rr~)r™Úreqrór:rRrRrSÚdispatch_request¦s
 
 
 
ÿþzFlask.dispatch_requestc
Csjd|_z,tj||jd| ¡}|dkr0| ¡}Wn,tk
r^}z| |¡}W5d}~XYnX| |¡S)zÀDispatches the request and on top of that performs request
        pre and postprocessing as well as HTTP exception catching and
        error handling.
 
        .. versionadded:: 0.7
        T)r&N)    r“r<r*r!Úpreprocess_requestr<rr%r,)r™rÉrrRrRrSÚfull_dispatch_request¿s zFlask.full_dispatch_requestz&ft.ResponseReturnValue | HTTPException)rÉr(rOcCsV| |¡}z | |¡}tj||j|dWn&tk
rP|s@‚|j d¡YnX|S)a)Given the return value from a view function this finalizes
        the request by converting it into a response and invoking the
        postprocessing functions.  This is invoked for both normal
        request dispatching as well as error handlers.
 
        Because this means that it might be called as a result of a
        failure a special safe mode is available which can be enabled
        with the `from_error_handler` flag.  If enabled, failures in
        response processing will be logged and otherwise ignored.
 
        :internal:
        )r&Úresponsez?Request finalizing failed with an error while handling an error)Ú make_responseÚprocess_responser;r*r!rr¨r')r™rÉr(r?rRrRrSr,Ñs
 
ÿ
ÿ
zFlask.finalize_requestcCs&tj}| ¡}| ¡}|j |¡|S)zÚThis method is called to create the default ``OPTIONS`` response.
        This can be changed through subclassing to change the default
        behavior of ``OPTIONS`` responses.
 
        .. versionadded:: 0.7
        )r(Ú url_adapterZallowed_methodsrêZallowrÆ)r™ÚadapterrõrÉrRrRrSr9ðs
 z#Flask.make_default_options_responsezBaseException | None)r1rOcCsdS)a
This is called to figure out if an error should be ignored
        or not as far as the teardown system is concerned.  If this
        function returns ``True`` then the teardown handlers will not be
        passed the error.
 
        .. versionadded:: 0.10
        FrR)r™r1rRrRrSÚshould_ignore_errorýszFlask.should_ignore_errorz
t.Callable)rÑrOcCst|ƒr| |¡S|S)a)Ensure that the function is synchronous for WSGI workers.
        Plain ``def`` functions are returned as-is. ``async def``
        functions are wrapped to run and wait for the response.
 
        Override this method to change how the app runs async views.
 
        .. versionadded:: 2.0
        )rÚ async_to_sync)r™rÑrRrRrSr!s    
zFlask.ensure_synczt.Callable[..., t.Coroutine]zt.Callable[..., t.Any]cCs8zddlm}Wntk
r.tdƒd‚YnX||ƒS)a1Return a sync function that will run the coroutine function.
 
        .. code-block:: python
 
            result = app.async_to_sync(func)(*args, **kwargs)
 
        Override this method to change how the app converts async code
        to be synchronously callable.
 
        .. versionadded:: 2.0
        r)rEzAInstall Flask with the 'async' extra in order to use async views.N)Z asgiref.syncrEÚ ImportErrorÚ RuntimeError)r™rÑZasgiref_async_to_syncrRrRrSrEsÿþzFlask.async_to_sync©Ú_anchorÚ_methodÚ_schemeÚ    _external)r~rIrJrKrLrñrOc
KsNt d¡}|dk    rd|j}|jj}    |dd…dkrR|    dk    rF|    ›|›}n |dd…}|dkr¤|dk    }n@t d¡}
|
dk    r~|
j}n
| d¡}|dkr˜tdƒ‚|dkr¤d}|dk    r¸|s¸tdƒ‚|     ||¡z|j
|||||d} WnHt k
r$} z(|j ||||d|  | ||¡WY¢Sd} ~ XYnX|dk    rJt|d    d
}| ›d |›} | S) a    Generate a URL to the given endpoint with the given values.
 
        This is called by :func:`flask.url_for`, and can be called
        directly as well.
 
        An *endpoint* is the name of a URL rule, usually added with
        :meth:`@app.route() <route>`, and usually the same name as the
        view function. A route defined in a :class:`~flask.Blueprint`
        will prepend the blueprint's name separated by a ``.`` to the
        endpoint.
 
        In some cases, such as email messages, you want URLs to include
        the scheme and domain, like ``https://example.com/hello``. When
        not in an active request, URLs will be external by default, but
        this requires setting :data:`SERVER_NAME` so Flask knows what
        domain to use. :data:`APPLICATION_ROOT` and
        :data:`PREFERRED_URL_SCHEME` should also be configured as
        needed. This config is only used when not in an active request.
 
        Functions can be decorated with :meth:`url_defaults` to modify
        keyword arguments before the URL is built.
 
        If building fails for some reason, such as an unknown endpoint
        or incorrect values, the app's :meth:`handle_url_build_error`
        method is called. If that returns a string, that is returned,
        otherwise a :exc:`~werkzeug.routing.BuildError` is raised.
 
        :param endpoint: The endpoint name associated with the URL to
            generate. If this starts with a ``.``, the current blueprint
            name (if any) will be used.
        :param _anchor: If given, append this as ``#anchor`` to the URL.
        :param _method: If given, generate the URL associated with this
            method for the endpoint.
        :param _scheme: If given, the URL will have this scheme if it
            is external.
        :param _external: If given, prefer the URL to be internal
            (False) or require it to be external (True). External URLs
            include the scheme and domain. When not in an active
            request, URLs are external by default.
        :param values: Values to use for the variable parts of the URL
            rule. Unknown keys are appended as query string arguments,
            like ``?a=b&c=d``.
 
        .. versionadded:: 2.2
            Moved from ``flask.url_for``, which calls this method.
        NrÚ.z˜Unable to build URLs outside an active request without 'SERVER_NAME' configured. Also configure 'APPLICATION_ROOT' and 'PREFERRED_URL_SCHEME' as needed.Tz4When specifying '_scheme', '_external' must be True.)r2Ú
url_schemeZforce_externalrHz%!#$&'()*+,/:;=?@)Úsafeú#)r%rÜrBr'rîr$Úcreate_url_adapterrGr‡Úinject_url_defaultsÚbuildrrÆÚhandle_url_build_errorÚ
_url_quote) r™r~rIrJrKrLrñZreq_ctxrBZblueprint_nameZapp_ctxrÉr1rRrRrSrÁ,sV8
 
 
 
ÿ      û
ÿ$
 z Flask.url_foré.rßÚ BaseResponse)ÚlocationrrOcCst|||jdS)aVCreate a redirect response object.
 
        This is called by :func:`flask.redirect`, and can be called
        directly as well.
 
        :param location: The URL to redirect to.
        :param code: The status code for the redirect.
 
        .. versionadded:: 2.2
            Moved from ``flask.redirect``, which calls this method.
        )rr)Ú _wz_redirectrê)r™rXrrRrRrSr©s zFlask.redirect)rÉrOc
Cs¼d}}t|tƒrht|ƒ}|dkr.|\}}}n:|dkr`t|dttttfƒrV|\}}qh|\}}ntdƒ‚|dkr‚tdtj›dƒ‚t||j    ƒspt|t
t t fƒsªt|t ƒrÄ|j    |||d}d}}n¬t|ttfƒrà|j |¡}nt|tƒsôt|ƒrZz|j     |tj¡}WnNtk
rV}z.t|›d    t|ƒj›d
ƒ t ¡d¡d‚W5d}~XYnXntd t|ƒj›d
ƒ‚t t|¡}|dk    r¦t|t
t t fƒr ||_n||_|r¸|j |¡|S) aConvert the return value from a view function to an instance of
        :attr:`response_class`.
 
        :param rv: the return value from the view function. The view function
            must return a response. Returning ``None``, or the view ending
            without returning, is not allowed. The following types are allowed
            for ``view_rv``:
 
            ``str``
                A response object is created with the string encoded to UTF-8
                as the body.
 
            ``bytes``
                A response object is created with the bytes as the body.
 
            ``dict``
                A dictionary that will be jsonify'd before being returned.
 
            ``list``
                A list that will be jsonify'd before being returned.
 
            ``generator`` or ``iterator``
                A generator that returns ``str`` or ``bytes`` to be
                streamed as the response.
 
            ``tuple``
                Either ``(body, status, headers)``, ``(body, status)``, or
                ``(body, headers)``, where ``body`` is any of the other types
                allowed here, ``status`` is a string or an integer, and
                ``headers`` is a dictionary or a list of ``(key, value)``
                tuples. If ``body`` is a :attr:`response_class` instance,
                ``status`` overwrites the exiting value and ``headers`` are
                extended.
 
            :attr:`response_class`
                The object is returned unchanged.
 
            other :class:`~werkzeug.wrappers.Response` class
                The object is coerced to :attr:`response_class`.
 
            :func:`callable`
                The function is called as a WSGI application. The result is
                used to create a response object.
 
        .. versionchanged:: 2.2
            A generator will be converted to a streaming response.
            A list will be converted to a JSON response.
 
        .. versionchanged:: 1.1
            A dict will be converted to a JSON response.
 
        .. versionchanged:: 0.9
           Previously a tuple was interpreted as the arguments for the
           response object.
        Nér«rz’The view function did not return a valid response tuple. The tuple must have the form (body, status, headers), (body, status), or (body, headers).zThe view function for zh did not return a valid response. The function either returned None or ended without a return statement.)ÚstatusÚheadersz²
The view function did not return a valid response. The return type must be a string, dict, list, tuple with headers or status, Response instance, or WSGI callable, but it was a rMz±The view function did not return a valid response. The return type must be a string, dict, list, tuple with headers or status, Response instance, or WSGI callable, but it was a ) rQÚtupleÚlenr    rZÚlistrþr'r~rêrmÚbytesÚ    bytearrayÚ _abc_Iteratorr‹r?rWÚcallableZ
force_typerÛrr Úwith_tracebackr¢r)rârãrr[Ú status_coder\rÆ)r™rÉr[r\Zlen_rvrrRrRrSr@·sf9
 
 
ÿ ÿý
ÿÿ
úúÿ 
 zFlask.make_responsezRequest | NonezMapAdapter | NonecCsp|dk    r:|js|jjpd}nd}|jj|j|jd|dS|jddk    rl|jj|jd|jd|jddSdS)a*Creates a URL adapter for the given request. The URL adapter
        is created at a point where the request context is not yet set
        up so the request is passed explicitly.
 
        .. versionadded:: 0.6
 
        .. versionchanged:: 0.9
           This can now also be called without a request object when the
           URL adapter is created for the application context.
 
        .. versionchanged:: 1.0
            :data:`SERVER_NAME` no longer implicitly enables subdomain
            matching. Use :attr:`subdomain_matching` instead.
        Nrb)räÚ    subdomainrcrf)Ú script_namerN)rtr’Zdefault_subdomainZbind_to_environrÛr‰Úbind)r™r'rfrRrRrSrQCs ýýzFlask.create_url_adapter)r~rñrOcCsZd}d|kr(t|tt| d¡dƒƒƒ}|D](}||jkr,|j|D]}|||ƒqDq,dS)zÖInjects the URL defaults for the given endpoint directly into
        the values dictionary passed.  This is used internally and
        automatically called on URL building.
 
        .. versionadded:: 0.7
        ryrMrN)rrÎr*Ú
rpartitionZurl_default_functions)r™r~rñrÐr˜rÑrRrRrSrRksÿ
zFlask.inject_url_defaultsrzdict[str, t.Any])r1r~rñrOc Csn|jD]L}z||||ƒ}Wn&tk
r@}z|}W5d}~XYqX|dk    r|Sq|t ¡dkrf‚|‚dS)a—Called by :meth:`.url_for` if a
        :exc:`~werkzeug.routing.BuildError` was raised. If this returns
        a value, it will be returned by ``url_for``, otherwise the error
        will be re-raised.
 
        Each function in :attr:`url_build_error_handlers` is called with
        ``error``, ``endpoint`` and ``values``. If a function returns
        ``None`` or raises a ``BuildError``, it is skipped. Otherwise,
        its return value is returned by ``url_for``.
 
        :param error: The active ``BuildError`` being handled.
        :param endpoint: The endpoint being built.
        :param values: The keyword arguments passed to ``url_for``.
        Nr)rŒrr¢r))r™r1r~rñrrÉrrRrRrSrT€s
 
zFlask.handle_url_build_errorzft.ResponseReturnValue | NonecCsˆdttjƒ˜}|D],}||jkr|j|D]}|tjtjƒq*q|D]>}||jkrD|j|D]$}| |¡ƒ}|dk    r\|Sq\qDdS)aÂCalled before the request is dispatched. Calls
        :attr:`url_value_preprocessors` registered with the app and the
        current blueprint (if any). Then calls :attr:`before_request_funcs`
        registered with the app and the blueprint.
 
        If any :meth:`before_request` handler returns a non-None value, the
        value is handled as if it was the return value from the view, and
        further request handling is stopped.
        N)N)rÎr'rZurl_value_preprocessorsr~r:Zbefore_request_funcsr!)r™rÐr˜Zurl_funcZ before_funcrÉrRrRrSr=¢s
 
 
 zFlask.preprocess_request)r?rOcCs„t ¡}|jD]}| |¡|ƒ}qttjdƒD]0}||jkr.t|j|ƒD]}| |¡|ƒ}qJq.|j     
|j ¡s€|j      ||j |¡|S)aCan be overridden in order to modify the response object
        before it's sent to the WSGI server.  By default this will
        call all the :meth:`after_request` decorated functions.
 
        .. versionchanged:: 0.5
           As of Flask 0.5 the functions registered for after request
           execution are called in reverse order of registration.
 
        :param response: a :attr:`response_class` object.
        :return: a new response object or the same, has to be an
                 instance of :attr:`response_class`.
        ry) r(Z_get_current_objectZ_after_request_functionsr!rr'rZafter_request_funcsrÎrjZis_null_sessionr)Z save_session)r™r?ÚctxrÑr˜rRrRrSrA½s 
 
zFlask.process_response)ÚexcrOcCsh|tkrt ¡d}ttjdƒD]0}||jkr t|j|ƒD]}| |¡|ƒq<q t    j
||j|ddS)a2Called after the request is dispatched and the response is
        returned, right before the request context is popped.
 
        This calls all functions decorated with
        :meth:`teardown_request`, and :meth:`Blueprint.teardown_request`
        if a blueprint handled the request. Finally, the
        :data:`request_tearing_down` signal is sent.
 
        This is called by
        :meth:`RequestContext.pop() <flask.ctx.RequestContext.pop>`,
        which may be delayed during testing to maintain access to
        resources.
 
        :param exc: An unhandled exception raised while dispatching the
            request. Detected from the current exception information if
            not passed. Passed to each teardown function.
 
        .. versionchanged:: 0.9
            Added the ``exc`` argument.
        rry©r&rkN) r3r¢r)rr'rZteardown_request_funcsrÎr!r=r*)r™rkr˜rÑrRrRrSÚdo_teardown_requestÙs 
zFlask.do_teardown_requestcCsH|tkrt ¡d}t|jƒD]}| |¡|ƒqtj||j|ddS)aÕCalled right before the application context is popped.
 
        When handling a request, the application context is popped
        after the request context. See :meth:`do_teardown_request`.
 
        This calls all functions decorated with
        :meth:`teardown_appcontext`. Then the
        :data:`appcontext_tearing_down` signal is sent.
 
        This is called by
        :meth:`AppContext.pop() <flask.ctx.AppContext.pop>`.
 
        .. versionadded:: 0.9
        rrlN)r3r¢r)rÎrr!r9r*)r™rkrÑrRrRrSÚdo_teardown_appcontextús
 zFlask.do_teardown_appcontextr!cCst|ƒS)aFCreate an :class:`~flask.ctx.AppContext`. Use as a ``with``
        block to push the context, which will make :data:`current_app`
        point at this application.
 
        An application context is automatically pushed by
        :meth:`RequestContext.push() <flask.ctx.RequestContext.push>`
        when handling a request, and when running a CLI command. Use
        this to manually create a context outside of these situations.
 
        ::
 
            with app.app_context():
                init_db()
 
        See :doc:`/appcontext`.
 
        .. versionadded:: 0.9
        r r§rRrRrSÚ app_contextszFlask.app_contextr#)rÛrOcCs
t||ƒS)a$Create a :class:`~flask.ctx.RequestContext` representing a
        WSGI environment. Use a ``with`` block to push the context,
        which will make :data:`request` point at this request.
 
        See :doc:`/reqcontext`.
 
        Typically you should not call this from your own code. A request
        context is automatically pushed by the :meth:`wsgi_app` when
        handling a request. Use :meth:`test_request_context` to create
        an environment and context instead of this method.
 
        :param environ: a WSGI environment
        r")r™rÛrRrRrSÚrequest_context(szFlask.request_context)ÚargsrèrOcOs>ddlm}||f|ž|Ž}z| | ¡¡W¢S| ¡XdS)aÃCreate a :class:`~flask.ctx.RequestContext` for a WSGI
        environment created from the given values. This is mostly useful
        during testing, where you may want to run a function that uses
        request data without dispatching a full request.
 
        See :doc:`/reqcontext`.
 
        Use a ``with`` block to push the context, which will make
        :data:`request` point at the request for the created
        environment. ::
 
            with app.test_request_context(...):
                generate_report()
 
        When using the shell, it may be easier to push and pop the
        context manually to avoid indentation. ::
 
            ctx = app.test_request_context(...)
            ctx.push()
            ...
            ctx.pop()
 
        Takes the same arguments as Werkzeug's
        :class:`~werkzeug.test.EnvironBuilder`, with some defaults from
        the application. See the linked Werkzeug docs for most of the
        available arguments. Flask-specific behavior is listed here.
 
        :param path: URL path being requested.
        :param base_url: Base URL where the app is being served, which
            ``path`` is relative to. If not given, built from
            :data:`PREFERRED_URL_SCHEME`, ``subdomain``,
            :data:`SERVER_NAME`, and :data:`APPLICATION_ROOT`.
        :param subdomain: Subdomain name to append to
            :data:`SERVER_NAME`.
        :param url_scheme: Scheme to use instead of
            :data:`PREFERRED_URL_SCHEME`.
        :param data: The request body, either as a string or a dict of
            form keys and values.
        :param json: If given, this is serialized as JSON and passed as
            ``data``. Also defaults ``content_type`` to
            ``application/json``.
        :param args: other positional arguments passed to
            :class:`~werkzeug.test.EnvironBuilder`.
        :param kwargs: other keyword arguments passed to
            :class:`~werkzeug.test.EnvironBuilder`.
        r)ÚEnvironBuilderN)rérrÚcloserpZ get_environ)r™rqrèrrZbuilderrRrRrSÚtest_request_context8s
/ zFlask.test_request_context)rÛÚstart_responserOc
CsÊ| |¡}d}zlz| ¡| ¡}WnHtk
rT}z|}|     |¡}W5d}~XYnt
  ¡d}‚YnX|||ƒW¢Sd|kr¤|dt ¡ƒ|dt ¡ƒ|dk    rº| |¡rºd}| |¡XdS)aÂThe actual WSGI application. This is not implemented in
        :meth:`__call__` so that middlewares can be applied without
        losing a reference to the app object. Instead of doing this::
 
            app = MyMiddleware(app)
 
        It's a better idea to do this instead::
 
            app.wsgi_app = MyMiddleware(app.wsgi_app)
 
        Then you still have the original application object around and
        can continue to call methods on it.
 
        .. versionchanged:: 0.7
            Teardown events for the request and app contexts are called
            even if an unhandled error occurs. Other events may not be
            called depending on when an error occurs during dispatch.
            See :ref:`callbacks-and-errors`.
 
        :param environ: A WSGI environment.
        :param start_response: A callable accepting a status code,
            a list of headers, and an optional exception context to
            start the response.
        Nzwerkzeug.debug.preserve_contextr) rpr$rÜr%rDrýÚpushr>rr/r¢r))r™rÛrurjr1r?rrRrRrSÚwsgi_appps&
  zFlask.wsgi_appcCs | ||¡S)z«The WSGI server calls the Flask application object as the
        WSGI application. This calls :meth:`wsgi_app`, which can be
        wrapped to apply middleware.
        )rw)r™rÛrurRrRrSÚ__call__ szFlask.__call__)    NrkNFFrlNFN)F)r»)NNNT)T)NNN)N)N)N)N)N)N)F)rV)er Ú
__module__Ú __qualname__Ú__doc__rAZ request_classrrêr rµr@rÄrZapp_ctx_globals_classrr³rréZ
secret_keyrTZpermanent_session_lifetimer.rYÚ__annotations__r[r
rr²rrrr‘rhrir7rjr‚ržrr˜r¨rªÚpropertyr°rˆrŠrƒr¿r©rÊrÂrÒrÔrÃÚsetterrærìrír6rðròr—r rrrrrrrr r#r$r%r/r+r8r<r>r,r9rDr!rErÁrr@rQrRrTr=rAr3rmrnrorprtrwrxÚ __classcell__rRrRršrSrU\s2
b
      ÿ  éÿ   õ&        (    û{:û:ÿÿ ÿÿ ÿÿ !
## 5ý 
ù} ("ÿ"ÿ80rU)qÚ
__future__rÚloggingr„r¢rrâr•Úcollections.abcrrbÚdatetimerÚinspectrÚ    itertoolsrÚtypesrÚ urllib.parserrUrÝZwerkzeug.datastructuresr    r
Zwerkzeug.exceptionsr r r rrZwerkzeug.routingrrrrrrrárZwerkzeug.utilsrrrYZwerkzeug.wrappersrrWÚrÚftr‰rrrjrr!r#rÅr$r%r&r'r(r)Zhelpersr*r+r,r-Z json.providerr.r/r1Zscaffoldr2r3r4r5r6Úsessionsr7r8Zsignalsr9r:r;r<r=Z
templatingr?r@ÚwrappersrAÚ TYPE_CHECKINGrrBrérDrFÚTypeVarZShellContextProcessorCallablerGZTeardownCallablerIZTemplateFilterCallablerJZTemplateGlobalCallablerKZTemplateTestCallablerLrTrUrRrRrRrSÚ<module>sž                                                               ÿ