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
U
Þ=®dN`ã@sxddlmZddlZddlZddlZddlZddlZddlZddlZ    ddl
Z
ddl m Z ddl m Z ddl mZddlmZddlmZdd    lmZdd
lmZdd lmZdd lmZdd lmZddlmZddlmZddlmZe    j rddl!m"Z"ddl#m$Z$ddl%m&Z&e     'd¡Z(e )d¡Z*e )d¡Z+ddddhdd„e,dƒDƒdd„e,dƒDƒ™Z-Gdd „d e.e    j/e(ƒZ0Gd!d"„d"eeƒZ1Gd#d$„d$eeƒZ2d%d&d'd(d)d*hZ3d+d+d+d,œd-d.„Z4d+d+d/œd0d1„Z5dXd+d3d4d5d6œd7d8„Z6dYd:d3d5d;œd<d=„Z7dZd@d:dAdBdAdBdCdDdEdBd4dFd5dGœ dHdI„Z8dJdJd:dKd5dLœdMdN„Z9d[d+dBdKdOœdPdQ„Z:d\d+dBdBdRdSœdTdU„Z;GdVdW„dWe<ƒZ=dS)]é)Ú annotationsN)Údatetime)Útime)Úquote)Úadler32)Úescapeé)Ú_DictAccessorProperty)Ú_missing)Ú_TAccessorValue)ÚHeaders)ÚNotFound)ÚRequestedRangeNotSatisfiable)Ú    safe_join)Ú    wrap_file)ÚWSGIEnvironment)ÚRequest©ÚResponseÚ_Tz    &([^;]+);z[^A-Za-z0-9_.-]ÚCONÚPRNÚAUXÚNULccs|]}d|›VqdS)ZCOMN©©Ú.0ÚirrúEd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\werkzeug/utils.pyÚ    <genexpr>)sré
ccs|]}d|›VqdS)ZLPTNrrrrrr*scsdeZdZdZddddddœ‡fdd„ Zd    d
dd œd d „Zdd    dd
dœdd„Zd    ddœdd„Z‡ZS)Úcached_propertyazA :func:`property` that is only evaluated once. Subsequent access
    returns the cached value. Setting the property sets the cached
    value. Deleting the property clears the cached value, accessing it
    again will evaluate it again.
 
    .. code-block:: python
 
        class Example:
            @cached_property
            def value(self):
                # calculate something important here
                return 42
 
        e = Example()
        e.value  # evaluates
        e.value  # uses cache
        e.value = 16  # sets cache
        del e.value  # clears cache
 
    If the class defines ``__slots__``, it must add ``_cache_{name}`` as
    a slot. Alternatively, it can add ``__dict__``, but that's usually
    not desirable.
 
    .. versionchanged:: 2.1
        Works with ``__slots__``.
 
    .. versionchanged:: 2.0
        ``del obj.name`` clears the cached value.
    Nzt.Callable[[t.Any], _T]ú
str | NoneÚNone)ÚfgetÚnameÚdocÚreturncs6tƒj||d|p|j|_d|j›|_|j|_dS)N)r&Z_cache_)ÚsuperÚ__init__Ú__name__Ú    slot_nameÚ
__module__)Úselfr$r%r&©Ú    __class__rrr)Ms zcached_property.__init__Úobjectr)ÚobjÚvaluer'cCs*t|dƒr||j|j<nt||j|ƒdS©NÚ__dict__)Úhasattrr4r*Úsetattrr+)r-r1r2rrrÚ__set__Xs
zcached_property.__set__Útype)r1r8r'cCsx|dkr |St|ddƒ}|dk    r0| |jt¡}nt||jtƒ}|tkrt| |¡}|dk    rf||j|j<nt||j|ƒ|Sr3)ÚgetattrÚgetr*r
r+r$r4r6)r-r1r8Zobj_dictr2rrrÚ__get__^s 
zcached_property.__get__©r1r'cCs(t|dƒr|j|j=nt||jtƒdSr3)r5r4r*r6r+r
©r-r1rrrÚ
__delete__ss
 zcached_property.__delete__)NN)N)    r*r,Ú __qualname__Ú__doc__r)r7r;r>Ú __classcell__rrr.rr!.s!ü r!c@s$eZdZdZdZdddœdd„ZdS)    Úenviron_propertyaðMaps request attributes to environment variables. This works not only
    for the Werkzeug request object, but also any other class with an
    environ attribute:
 
    >>> class Test(object):
    ...     environ = {'key': 'value'}
    ...     test = environ_property('key')
    >>> var = Test()
    >>> var.test
    'value'
 
    If you pass it a second value it's used as default if the key does not
    exist, the third one can be a converter that takes a value and converts
    it.  If it raises :exc:`ValueError` or :exc:`TypeError` the default value
    is used. If no default value is provided `None` is used.
 
    Per default the property is read only.  You have to explicitly enable it
    by passing ``read_only=False`` to the constructor.
    Trrr<cCs|jS©N)Úenvironr=rrrÚlookup‘szenviron_property.lookupN)r*r,r?r@Z    read_onlyrErrrrrBzsrBc@s eZdZdZdddœdd„ZdS)Úheader_propertyz(Like `environ_property` but for headers.zRequest | Responser r<cCs|jSrC)Úheadersr=rrrrE˜szheader_property.lookupN)r*r,r?r@rErrrrrF•srFzapplication/ecmascriptzapplication/javascriptzapplication/sqlzapplication/xmlzapplication/xml-dtdz&application/xml-external-parsed-entityÚstr)ÚmimetypeÚcharsetr'cCs.| d¡s|tks| d¡r*|d|›7}|S)aLReturns the full content type string with charset for a mimetype.
 
    If the mimetype represents text, the charset parameter will be
    appended, otherwise the mimetype is returned unchanged.
 
    :param mimetype: The mimetype to be used as content type.
    :param charset: The charset to be appended for text mimetypes.
    :return: The content type.
 
    .. versionchanged:: 0.15
        Any type that ends with ``+xml`` gets a charset, not just those
        that start with ``application/``. Known text types such as
        ``application/javascript`` are also given charsets.
    ztext/z+xmlz
; charset=)Ú
startswithÚ_charset_mimetypesÚendswith)rIrJrrrÚget_content_type©sÿþýrN)Úfilenamer'cCs”t d|¡}| dd¡ d¡}tjtjjfD]}|r,| |d¡}q,t    t
  dd  |  ¡¡¡ƒ d¡}tjdkr|r|  d    ¡d
 ¡tkrd|›}|S) atPass it a filename and it will return a secure version of it.  This
    filename can then safely be stored on a regular file system and passed
    to :func:`os.path.join`.  The filename returned is an ASCII only string
    for maximum portability.
 
    On windows systems the function also makes sure that the file is not
    named after one of the special device files.
 
    >>> secure_filename("My cool movie.mov")
    'My_cool_movie.mov'
    >>> secure_filename("../../../etc/passwd")
    'etc_passwd'
    >>> secure_filename('i contain cool \xfcml\xe4uts.txt')
    'i_contain_cool_umlauts.txt'
 
    The function might return an empty filename.  It's your responsibility
    to ensure that the filename is unique and that you abort or
    generate a random filename if the function returned an empty one.
 
    .. versionadded:: 0.5
 
    :param filename: the filename to secure
    ÚNFKDÚasciiÚignoreú ÚÚ_z._ÚntÚ.r)Ú unicodedataÚ    normalizeÚencodeÚdecodeÚosÚsepÚpathÚaltsepÚreplacerHÚ_filename_ascii_strip_reÚsubÚjoinÚsplitÚstripr%ÚupperÚ_windows_device_files)rOr]rrrÚsecure_filenameÂs  ÿÿþý
rhé.Úintztype[Response] | Noner)ÚlocationÚcoderr'cCsF|dkrddlm}t|ƒ}|d|›d|›d|dd}||jd    <|S)
aaReturns a response object (a WSGI application) that, if called,
    redirects the client to the target location. Supported codes are
    301, 302, 303, 305, 307, and 308. 300 is not supported because
    it's not a real redirect and 304 because it's the answer for a
    request with a request with defined If-Modified-Since headers.
 
    .. versionadded:: 0.6
       The location can now be a unicode string that is encoded using
       the :func:`iri_to_uri` function.
 
    .. versionadded:: 0.10
        The class used for the Response object can now be passed in.
 
    :param location: the location the response should redirect to.
    :param code: the redirect status code. defaults to 302.
    :param class Response: a Response class to use when instantiating a
        response. The default is :class:`werkzeug.wrappers.Response` if
        unspecified.
    Nrrz›<!doctype html>
<html lang=en>
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to the target URL: <a href="z">z</a>. If not, click the link.
z    text/html)rIZLocation)ÚwrappersrrrG)rkrlrZ html_locationÚresponserrrÚredirectñs ø
 
roé4r)rDrlr'cCsL|d d¡d}|sd}n
|›d}| d¡}|rB|›d|›}t||ƒS)aLRedirect to the current URL with a slash appended.
 
    If the current URL is ``/user/42``, the redirect URL will be
    ``42/``. When joined to the current URL during response
    processing or by the browser, this will produce ``/user/42/``.
 
    The behavior is undefined if the path ends with a slash already. If
    called unconditionally on a URL, it may produce a redirect loop.
 
    :param environ: Use the path and query from this WSGI environment
        to produce the redirect URL.
    :param code: the status code for the redirect.
 
    .. versionchanged:: 2.1
        Produce a relative URL that only modifies the last segment.
        Relevant when the current path has multiple segments.
 
    .. versionchanged:: 2.1
        The default status code is 308 instead of 301. This preserves
        the request method and body.
    Z    PATH_INFOú/éz./Ú QUERY_STRINGú?)Ú
rpartitionr:ro)rDrlÚtailÚnew_pathZ query_stringrrrÚappend_slash_redirects
 
rxFTzos.PathLike | str | t.IO[bytes]r"Úboolz
bool | strzdatetime | int | float | Nonez3None | (int | t.Callable[[str | None], int | None])zos.PathLike | str | None) Ú path_or_filerDrIÚ as_attachmentÚ download_nameÚ conditionalÚetagÚ last_modifiedÚmax_ageÚuse_x_sendfileÚresponse_classÚ
_root_pathr'c Csj|
dkrddlm} | }
d} d}d}d}tƒ}t|tjtfƒsHt|dƒrœt     tj
tjtf|¡}| dk    rxtj   | |¡} n tj   |¡} t | ¡}|j}|j}n|}|dkr¼| dk    r¼tj  | ¡}|dkr |dkrÖtdƒ‚t |¡\}}|dkrðd}|dk    r |s | d|¡|dk    ržz| d¡WnPtk
rtt d    |¡}| dd
¡ d¡}t|d d }|d |›dœ}Yn
Xd|i}|rˆdnd}|jd|f|Žn|r¬tdƒ‚|    rÊ| dk    rÊ| |d<d}nP|dkràt| dƒ}n0t|tjƒrú| ¡j }nt|tj!ƒrt"dƒ‚t#||ƒ}|
|||dd}|dk    r:||_$|dk    rL||_%n|dk    r\||_%d|j&_'t(|ƒrv|| ƒ}|dk    r²|dkršd|j&_'d|j&_)||j&_*t+t,ƒ|ƒ|_-t|tƒrÊ| .|¡n<|r| dk    rt/|  d¡ƒd@}| .|›d|›d|›¡|rfz|j0|d|d}Wn*t1k
rJ|dk    rD| 2¡‚YnX|j3dkrf|j4 5dd¡|S) a3Send the contents of a file to the client.
 
    The first argument can be a file path or a file-like object. Paths
    are preferred in most cases because Werkzeug can manage the file and
    get extra information from the path. Passing a file-like object
    requires that the file is opened in binary mode, and is mostly
    useful when building a file in memory with :class:`io.BytesIO`.
 
    Never pass file paths provided by a user. The path is assumed to be
    trusted, so a user could craft a path to access a file you didn't
    intend. Use :func:`send_from_directory` to safely serve user-provided paths.
 
    If the WSGI server sets a ``file_wrapper`` in ``environ``, it is
    used, otherwise Werkzeug's built-in wrapper is used. Alternatively,
    if the HTTP server supports ``X-Sendfile``, ``use_x_sendfile=True``
    will tell the server to send the given path, which is much more
    efficient than reading it in Python.
 
    :param path_or_file: The path to the file to send, relative to the
        current working directory if a relative path is given.
        Alternatively, a file-like object opened in binary mode. Make
        sure the file pointer is seeked to the start of the data.
    :param environ: The WSGI environ for the current request.
    :param mimetype: The MIME type to send for the file. If not
        provided, it will try to detect it from the file name.
    :param as_attachment: Indicate to a browser that it should offer to
        save the file instead of displaying it.
    :param download_name: The default name browsers will use when saving
        the file. Defaults to the passed file name.
    :param conditional: Enable conditional and range responses based on
        request headers. Requires passing a file path and ``environ``.
    :param etag: Calculate an ETag for the file, which requires passing
        a file path. Can also be a string to use instead.
    :param last_modified: The last modified time to send for the file,
        in seconds. If not provided, it will try to detect it from the
        file path.
    :param max_age: How long the client should cache the file, in
        seconds. If set, ``Cache-Control`` will be ``public``, otherwise
        it will be ``no-cache`` to prefer conditional caching.
    :param use_x_sendfile: Set the ``X-Sendfile`` header to let the
        server to efficiently send the file. Requires support from the
        HTTP server. Requires passing a file path.
    :param response_class: Build the response using this class. Defaults
        to :class:`~werkzeug.wrappers.Response`.
    :param _root_path: Do not use. For internal use only. Use
        :func:`send_from_directory` to safely send files under a path.
 
    .. versionchanged:: 2.0.2
        ``send_file`` only sets a detected ``Content-Encoding`` if
        ``as_attachment`` is disabled.
 
    .. versionadded:: 2.0
        Adapted from Flask's implementation.
 
    .. versionchanged:: 2.0
        ``download_name`` replaces Flask's ``attachment_filename``
         parameter. If ``as_attachment=False``, it is passed with
         ``Content-Disposition: inline`` instead.
 
    .. versionchanged:: 2.0
        ``max_age`` replaces Flask's ``cache_timeout`` parameter.
        ``conditional`` is enabled and ``max_age`` is not set by
        default.
 
    .. versionchanged:: 2.0
        ``etag`` replaces Flask's ``add_etags`` parameter. It can be a
        string to use instead of generating one.
 
    .. versionchanged:: 2.0
        If an encoding is returned when guessing ``mimetype`` from
        ``download_name``, set the ``Content-Encoding`` header.
    NrrÚ
__fspath__z’Unable to detect the MIME type because a file name is not available. Either set 'download_name', pass a path instead of a file, or set 'mimetype'.zapplication/octet-streamzContent-EncodingrQrPrRz !#$&+-.^_`|~)ÚsafezUTF-8'')rOz    filename*rOÚ
attachmentÚinlinezContent-Dispositionz]No name provided for attachment. Either set 'download_name' or pass a path instead of a file.z
X-SendfileÚrbz3Files must be opened in binary mode or use BytesIO.T)rIrGZdirect_passthroughrzutf-8lÿÿú-)Z accept_rangesZcomplete_lengthi0z
x-sendfile)6rmrr Ú
isinstancer\ÚPathLikerHr5ÚtÚcastÚUnionr^rcÚabspathÚstatÚst_sizeÚst_mtimeÚbasenameÚ    TypeErrorÚ    mimetypesÚ
guess_typeÚsetrZÚUnicodeEncodeErrorrXrYr[rÚopenÚioÚBytesIOÚ    getbufferÚnbytesÚ
TextIOBaseÚ
ValueErrorrÚcontent_lengthrZ cache_controlÚno_cacheÚcallableÚpublicr€rjrÚexpiresZset_etagrZmake_conditionalrÚcloseÚ status_coderGÚpop)rzrDrIr{r|r}r~rr€rr‚rƒrr^ÚfileÚsizeÚmtimerGrÚencodingÚsimpleÚquotedÚnamesr2ÚdataÚrvÚcheckrrrÚ    send_file>sºV ÿ 
 
ÿ 
  ÿ
 
ÿ
 
 
 
 
 
 
 r²zos.PathLike | strzt.Any)Ú    directoryr^rDÚkwargsr'cKs^tt |¡t |¡ƒ}|dkr$tƒ‚d|kr>tj |d|¡}tj |¡sPtƒ‚t||f|ŽS)aËSend a file from within a directory using :func:`send_file`.
 
    This is a secure way to serve files from a folder, such as static
    files or uploads. Uses :func:`~werkzeug.security.safe_join` to
    ensure the path coming from the client is not maliciously crafted to
    point outside the specified directory.
 
    If the final path does not point to an existing regular file,
    returns a 404 :exc:`~werkzeug.exceptions.NotFound` error.
 
    :param directory: The directory that ``path`` must be located under. This *must not*
        be a value provided by the client, otherwise it becomes insecure.
    :param path: The path to the file to send, relative to ``directory``. This is the
        part of the path provided by the client, which is checked for security.
    :param environ: The WSGI environ for the current request.
    :param kwargs: Arguments to pass to :func:`send_file`.
 
    .. versionadded:: 2.0
        Adapted from Flask's implementation.
    Nrƒ)rr\Úfspathr r^rcÚisfiler²)r³r^rDr´rrrÚsend_from_directorys r·)Ú import_nameÚsilentr'c
Csî| dd¡}zœz t|ƒWntk
r8d|kr4‚YnXtj|WS| dd¡\}}t|tƒtƒ|gƒ}zt||ƒWWSt    k
r¤}zt|ƒd‚W5d}~XYnXWn@tk
rè}z"|sØt
||ƒ  t  ¡d¡d‚W5d}~XYnXdS)aCImports an object based on a string.  This is useful if you want to
    use import paths as endpoints or something similar.  An import path can
    be specified either in dotted notation (``xml.sax.saxutils.escape``)
    or with a colon as object delimiter (``xml.sax.saxutils:escape``).
 
    If `silent` is True the return value will be `None` if the import fails.
 
    :param import_name: the dotted name for the object to import.
    :param silent: if set to `True` import errors are ignored and
                   `None` is returned instead.
    :return: imported object
    ú:rWrNrr) r`Ú
__import__Ú ImportErrorÚsysÚmodulesÚrsplitÚglobalsÚlocalsr9ÚAttributeErrorÚImportStringErrorÚwith_tracebackÚexc_info)r¸r¹Ú module_nameZobj_nameÚmoduleÚerrrÚ import_stringCs,    
 
ÿþrÉzt.Iterator[str])Ú import_pathÚinclude_packagesÚ    recursiver'c    cs„t|ƒ}t|ddƒ}|dkr*t|›dƒ‚|j›d}t |¡D]>\}}}||}|rx|r`|V|r~t||dƒEdHq@|Vq@dS)a­Finds all the modules below a package.  This can be useful to
    automatically import all views / controllers so that their metaclasses /
    function decorators have a chance to register themselves on the
    application.
 
    Packages are not returned unless `include_packages` is `True`.  This can
    also recursively list modules but in that case it will import all the
    packages to get the correct load path of that module.
 
    :param import_path: the dotted name for the package to find child modules.
    :param include_packages: set to `True` if packages should be returned, too.
    :param recursive: set to `True` if recursion should happen.
    :return: generator
    Ú__path__Nz is not a packagerWT)rÉr9rŸr*ÚpkgutilÚ iter_modulesÚ find_modules)    rÊrËrÌrÇr^r“Ú    _importerÚmodnameÚispkgrrrrÐjs  rÐcsJeZdZUdZded<ded<ddddœ‡fdd    „ Zdd
œd d „Z‡ZS) rÃzBProvides information about a failed :func:`import_string` attempt.rHr¸Ú BaseExceptionÚ    exceptionr#)r¸rÕr'c
    sÎ||_||_|}d}g}| dd¡ d¡D]’}|r@|›d|›n|}t|dd}|rl| |t|ddƒf¡q*dd„|Dƒ}| d    |›d
¡d  |¡}    d |›d |    ›dt|ƒj    ›d|›}q¾q*t
ƒ  |¡dS)NrTrºrWT)r¹Ú__file__cSs"g|]\}}d|›d|›d‘qS)ú- z
 found in rWr)rÚnrrrrÚ
<listcomp>Ÿsz.ImportStringError.__init__.<locals>.<listcomp>r×z  not found.Ú
zimport_string() failed for zõ. Possible reasons are:
 
- missing __init__.py in a package;
- package or module path not included in sys.path;
- duplicated package or module name taking precedence in sys.path;
- missing module, class, function or variable;
 
Debugged import:
 
z
 
Original exception:
 
z: ) r¸rÕr`rdrÉÚappendr9rcr8r*r(r))
r-r¸rÕÚmsgr%ZtrackedÚpartZimportedÚtrackZ    track_strr.rrr)“s" 
 ÿ zImportStringError.__init__)r'cCs"dt|ƒj›d|j›d|j›dS)Nú<ú(z, z)>)r8r*r¸rÕ)r-rrrÚ__repr__±szImportStringError.__repr__)r*r,r?r@Ú__annotations__r)rárArrr.rrËs
 
rÃ)riN)rp)
NFNTTNNFNN)F)FF)>Ú
__future__rršr•r\rÎÚrer½ÚtypingrŒrXrrÚ urllib.parserÚzlibrZ
markupsaferÚ    _internalr    r
r Zdatastructuresr Ú
exceptionsr rÚsecurityrZwsgirÚ TYPE_CHECKINGZ_typeshed.wsgirZwrappers.requestrZwrappers.responserÚTypeVarrÚcompileZ
_entity_reraÚrangergÚpropertyÚGenericr!rBrFrLrNrhrorxr²r·rÉrÐr¼rÃrrrrÚ<module>sŒ                 
 
 
üú
L ú
0ÿ((ô(\*(ÿ!