Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
gen.cpython-313.pyc409 linesDownload Raw Back to __pycache__
1�

2��j��3��SrSSKrSSKrSSKrSSKJr SSKrSSKrSSK	r	SSK	J4r5 SSKJr SSK
r
SSKrSSKJrJrJrJrJrJr SSKJr SSKJr SS	KJr SSKrSSKrSS6KJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r) \RT(aSSKJ+r+J,r,J-r-J.r. \R^"S5r0\ S\&\#\&\'\!\&4\RbR 4r2"S
S\35r4"SS\35r5"SS\35r6"SS\35r7"SS\35r8S\ \9S4S\!4Sjr:S\4Sjr;S\"S\04S\!S\!S\04S jr<\)S!\"S"S\"S#4S$j5r=\)S!\"S\04S\"S#4S%j5r=S!\ \"S"\"S\044S\"S#4S&jr=S!\!S\>4S'jr?"S(S\35r@"S)S*5rA\)SDS+\(\2S,\ \$\3\%\$\3S44S\\#4S-jj5rB\)SDS+\\!\24S,\ \$\3\%\$\3S44S\\'4S.jj5rBSDS+\ \(\2\\!\244S,S/SS04S1jjrB\BrCSDS+\ \(\2\\!\244S,S/SS04S2jjrDS3\!S\4S4jrESDS5\ \F\R�4S6\2S,S/S\4S7jjrHS8\FSS94S:jrI"S;S<5rJ\R�"\\J"55rL\R�"\\J"55rMS=\Ml"S>S?5rNS@\&S\4SAjrOSB\2S\4SCjrP\7"\P5rPg!\a SrGN`f=f)Ea*	``tornado.gen`` implements generator-based coroutines.8 9.. note::10 11   The "decorator and generator" approach in this module is a12   precursor to native coroutines (using ``async def`` and ``await``)13   which were introduced in Python 3.5. Applications that do not14   require compatibility with older versions of Python should use15   native coroutines instead. Some parts of this module are still16   useful with native coroutines, notably `multi`, `sleep`,17   `WaitIterator`, and `with_timeout`. Some of these functions have18   counterparts in the `asyncio` module which may be used as well,19   although the two may not necessarily be 100% compatible.20 21Coroutines provide an easier way to work in an asynchronous22environment than chaining callbacks. Code using coroutines is23technically asynchronous, but it is written as a single generator24instead of a collection of separate functions.25 26For example, here's a coroutine-based handler:27 28.. testcode::29 30    class GenAsyncHandler(RequestHandler):31        @gen.coroutine32        def get(self):33            http_client = AsyncHTTPClient()34            response = yield http_client.fetch("http://example.com")35            do_something_with_response(response)36            self.render("template.html")37 38Asynchronous functions in Tornado return an ``Awaitable`` or `.Future`;39yielding this object returns its result.40 41You can also yield a list or dict of other yieldable objects, which42will be started at the same time and run in parallel; a list or dict43of results will be returned when they are all finished:44 45.. testcode::46 47    @gen.coroutine48    def get(self):49        http_client = AsyncHTTPClient()50        response1, response2 = yield [http_client.fetch(url1),51                                      http_client.fetch(url2)]52        response_dict = yield dict(response3=http_client.fetch(url3),53                                   response4=http_client.fetch(url4))54        response3 = response_dict['response3']55        response4 = response_dict['response4']56 57If ``tornado.platform.twisted`` is imported, it is also possible to58yield Twisted's ``Deferred`` objects. See the `convert_yielded`59function to extend this mechanism.60 61.. versionchanged:: 3.262   Dict support added.63 64.. versionchanged:: 4.165   Support added for yielding ``asyncio`` Futures and Twisted Deferreds66   via ``singledispatch``.67 68�N)�	Generator)�singledispatch)�isawaitable)�Future�	is_future�chain_future�future_set_exc_info�future_add_done_callback�"future_set_result_unless_cancelled)�IOLoop)�app_log)�TimeoutError)�Mapping�Union�Any�Callable�List�Type�Tuple�	Awaitable�Dict�Sequence�overload)�Deque�Optional�Set�Iterable�_Tc��\rSrSrSrg)�
KeyReuseError�v�N��__name__�69__module__�__qualname__�__firstlineno__�__static_attributes__r"��QD:\code\apps\devtools\python\user_packages\Python313\site-packages\tornado/gen.pyr r v���r)r c��\rSrSrSrg)�UnknownKeyError�zr"Nr#r"r)r*r-r-zr+r)r-c��\rSrSrSrg)�LeakedCallbackError�~r"Nr#r"r)r*r0r0~r+r)r0c��\rSrSrSrg)�
BadYieldError�r"Nr#r"r)r*r3r3�r+r)r3c��\rSrSrSrg)�ReturnValueIgnoredError�r"Nr#r"r)r*r6r6�r+r)r6�e�Return�returnc��UR$![a Of=fURS$![[4a gf=f)Nr)�value�AttributeError�args�70IndexError)r8s r*�_value_from_stopiterationr@�sP��
��w�w����
��
����v�v�a�y����J�'����s��71��.�A�Ac��[5n[USS5nU(a"USSnU[:XaUS	OU$U(aM"U$)N�_source_tracebackr"�����r)r�getattr�__file__)�future�source_traceback�filenames   r*�_create_futurerI�sT��
�X�F��v�':�B�?��72�$�B�'��*���x�� ��$���M��73��Mr)�f.r>�kwc��U"U0UD6$�Nr")rJr>rKs   r*�
_fake_ctx_runrN�s���d�>�b�>�r)�func).zGenerator[Any, Any, _T]).�74Future[_T]c��grMr"�rOs r*�	coroutinerS�s��#&r)c��grMr"rRs r*rSrS�s��GJr)c�b^�[R"T5U4Sj5nTUlSUlU$)a�Decorator for asynchronous generators.75 76For compatibility with older versions of Python, coroutines may77also "return" by raising the special exception `Return(value)78<Return>`.79 80Functions with this decorator return a `.Future`.81 82.. warning::83 84   When exceptions occur inside a coroutine, the exception85   information will be stored in the `.Future` object. You must86   examine the result of the `.Future` object, or the exception87   may go unnoticed by your code. This means yielding the function88   if called from another coroutine, using something like89   `.IOLoop.run_sync` for top-level calls, or passing the `.Future`90   to `.IOLoop.add_future`.91 92.. versionchanged:: 6.093 94   The ``callback`` argument was removed. Use the returned95   awaitable object instead.96 97c��>^�[5n[b [R"5RnO[nU"T/UQ70UD6n[U[5(a6U"[U5n[X4X%5mURU4Sj5 SnUSn$[X$5 U$![[4an[U[U55 SnAN?SnAf[a" [U[ R""55 Nmf=f!Snf=f![[4an[U5nSnAN�SnAf[a. [U[ R""55 USns$!Snf=ff=f)Nc�>�T$rMr")�_�runners �r*�<lambda>�,coroutine.<locals>.wrapper.<locals>.<lambda>s���vr))rI�contextvars�copy_context�runrN�98isinstancer�next�Runner�add_done_callback�
StopIterationr9rr@�	Exceptionr	�sys�exc_info)	r>�kwargsrF�ctx_run�result�yieldedr8rYrOs	       @�r*�wrapper�coroutine.<locals>.wrapper�sM���99 �!���"�!�.�.�0�4�4�G�#�G�1	"��T�3�D�3�F�3�F��&�)�,�,�?�%�d�F�3�G� $�G�V�E�F��,�,�-=�>���"�!�"�F�K-�L	+�6�:��
��?&�v�.��6�� 9�!� <����!�@�'������?�@��2"�F��_�
�&�	2�.�q�1�F���	�������7�
��������
	�sY�D�
B �C<� C9�0C100�101,C9�8C9�<D�E�D#�#,E�E�E�E�ET)�	functools�wraps�__wrapped__�__tornado_coroutine__)rOrks` r*rSrS�s8���8�_�_�T��<��<�|�G��$(�G�!��Nr)c��[USS5$)zvReturn whether *func* is a coroutine function, i.e. a function102wrapped with `~.gen.coroutine`.103 104.. versionadded:: 4.5105rpF)rDrRs r*�is_coroutine_functionrrs���4�0�%�8�8r)c�<^�\rSrSrSrSS\SS4U4SjjjrSrU=r$)	r9ia�Special exception to return a value from a `coroutine`.106 107This exception exists for compatibility with older versions of108Python (before 3.3). In newer code use the ``return`` statement109instead.110 111If this exception is raised, its value argument is used as the112result of the coroutine::113 114    @gen.coroutine115    def fetch_json(url):116        response = yield AsyncHTTPClient().fetch(url)117        raise gen.Return(json_decode(response.body))118 119By analogy with the return statement, the value argument is optional.120Nr<r:c�>>�[TU]5 XlU4UlgrM)�super�__init__r<r>)�selfr<�	__class__s  �r*rv�Return.__init__1s���
�����121��H��	r))r>r<rM)	r$r%r&r'�__doc__rrvr(�
__classcell__)rxs@r*r9r9s ����"�c��T��r)c��\rSrSrSr0rS\S\SS4SjrS\4Sjr	S\4S	jr122S123\SS4SjrS124\S\4SjrS\
R4S
jrS\4SjrSrg)�WaitIteratori8aProvides an iterator to yield the results of awaitables as they finish.125 126Yielding a set of awaitables like this:127 128``results = yield [awaitable1, awaitable2]``129 130pauses the coroutine until both ``awaitable1`` and ``awaitable2``131return, and then restarts the coroutine with the results of both132awaitables. If either awaitable raises an exception, the133expression will raise that exception and all the results will be134lost.135 136If you need to get the result of each awaitable as soon as possible,137or if you need the result of some awaitables even if others produce138errors, you can use ``WaitIterator``::139 140  wait_iterator = gen.WaitIterator(awaitable1, awaitable2)141  while not wait_iterator.done():142      try:143          result = yield wait_iterator.next()144      except Exception as e:145          print("Error {} from {}".format(e, wait_iterator.current_future))146      else:147          print("Result {} received from {} at {}".format(148              result, wait_iterator.current_future,149              wait_iterator.current_index))150 151Because results are returned as soon as they are available the152output from the iterator *will not be in the same order as the153input arguments*. If you need to know which future produced the154current result, you can use the attributes155``WaitIterator.current_future``, or ``WaitIterator.current_index``156to get the index of the awaitable from the input list. (if keyword157arguments were used in the construction of the `WaitIterator`,158``current_index`` will use the corresponding keyword).159 160`WaitIterator` implements the async iterator161protocol, so it can be used with the ``async for`` statement (note162that in this version the entire iteration is aborted if any value163raises an exception, while the previous example can continue past164individual errors)::165 166  async for result in gen.WaitIterator(future1, future2):167      print("Result {} received from {} at {}".format(168          result, wait_iterator.current_future,169          wait_iterator.current_index))170 171.. versionadded:: 4.1172 173.. versionchanged:: 4.3174   Added ``async for`` support in Python 3.5.175 176r>rgr:Nc���U(aU(a[S5eU(aDUR5VVs0sHup4XC_M	 snnUl[UR	55nO'[U5VVs0sHupdXF_M	 snnUlUn[R"5UlSUl	SUl177SUlUHn[XpR5 M gs snnfs snnf)Nz)You must provide args or kwargs, not both)�178ValueError�items�_unfinished�list�values�	enumerate�collections�deque�	_finished�
current_index�current_future�_running_futurer179�_done_callback)rwr>rg�krJ�futures�irFs        r*rv�WaitIterator.__init__qs����F��H�I�I��39�<�<�>�B�>��!���>�B�D���6�=�=�?�+�G�3<�T�?�C�?��!���?�C�D���G�$�*�*�,���!���"���#����F�$�V�-@�-@�A��� C�� Ds�C�3C c�f�UR(dUR(agS=UlUlg)z2Returns True if this iterator has no more results.FNT)r�r�r�r��rws r*�done�WaitIterator.done�s'���>�>�T�-�-��37�7���T�0�r)c��[5UlUR(a)URURR	55$UR$)z�Returns a `.Future` that will yield the next available result.180 181Note that this `.Future` will not be the same object as any of182the inputs.183)rr�r��_return_result�popleftr�s r*r`�WaitIterator.next�s?�� &�x����>�>��&�&�t�~�~�'=�'=�'?�@�@��#�#�#r)r�c��UR(a1URR5(dURU5 gURR	U5 grM)r�r�r�r��append)rwr�s  r*r��WaitIterator._done_callback�s?������(<�(<�(A�(A�(C�(C�����%��N�N�!�!�$�'r)c���URc[S5e[XR5 URnSUlXlURRU5UlU$)zsCalled set the returned future's state that of the future184we yielded, and set the current future for the iterator.185Nzno future is running)r�rdrr�r��popr�)rwr��ress   r*r��WaitIterator._return_result�sa�����'��2�3�3��T�/�/�0��"�"��#���"��!�-�-�1�1�$�7����186r)c��U$rMr"r�s r*�	__aiter__�WaitIterator.__aiter__�s���r)c�v�UR5(a[[S5"5eUR5$)N�StopAsyncIteration)r�rD�builtinsr`r�s r*�	__anext__�WaitIterator.__anext__�s*���9�9�;�;��(�$8�9�;�;��y�y�{�r))r�r�r�r�r�)r$r%r&r'rzr�rrv�boolr�r`r�r��typing�
AsyncIteratorr�r�r(r"r)r*r}r}8s���4�l�K�B�f�B��B�4�B�&�d��$�f�$�(�6�(�d�(�
�6�
�f�
��6�/�/���6�r)r}�children�quiet_exceptionsc��grMr"�r�r�s  r*�multir�����r)c��grMr"r�s  r*r�r��r�r)z3Union[Type[Exception], Tuple[Type[Exception], ...]]z!Union[Future[List], Future[Dict]]c��[XS9$)a�Runs multiple asynchronous operations in parallel.187 188``children`` may either be a list or a dict whose values are189yieldable objects. ``multi()`` returns a new yieldable190object that resolves to a parallel structure containing their191results. If ``children`` is a list, the result is a list of192results in the same order; if it is a dict, the result is a dict193with the same keys.194 195That is, ``results = yield multi(list_of_futures)`` is equivalent196to::197 198    results = []199    for future in list_of_futures:200        results.append(yield future)201 202If any children raise exceptions, ``multi()`` will raise the first203one. All others will be logged, unless they are of types204contained in the ``quiet_exceptions`` argument.205 206In a ``yield``-based coroutine, it is not normally necessary to207call this function directly, since the coroutine runner will208do it automatically when a list or dict is yielded. However,209it is necessary in ``await``-based coroutines, or to pass210the ``quiet_exceptions`` argument.211 212This function is available under the names ``multi()`` and ``Multi()``213for historical reasons.214 215Cancelling a `.Future` returned by ``multi()`` does not cancel its216children. `asyncio.gather` is similar to ``multi()``, but it does217cancel its children.218 219.. versionchanged:: 4.2220   If multiple yieldables fail, any exceptions after the first221   (which is raised) will be logged. Added the ``quiet_exceptions``222   argument to suppress this logging for selected exception types.223 224.. versionchanged:: 4.3225   Replaced the class ``Multi`` and the function ``multi_future``226   with a unified function ``multi``. Added support for yieldables227   other than ``YieldPoint`` and `.Future`.228 229)r�)�multi_futurer�s  r*r�r��s��`��D�Dr)c��^^^^^	�[U[5(a*[UR55mUR	5nOSmUn[[[U55m[ST55(de[T5m	[5mT(d[TTb0O/5 S[SS4UUUUU	4Sjjn[5nTH&nXT;dM230URU5 [XS5 M( T$)a�Wait for multiple asynchronous futures in parallel.231 232Since Tornado 6.0, this function is exactly the same as `multi`.233 234.. versionadded:: 4.0235 236.. versionchanged:: 4.2237   If multiple ``Futures`` fail, any exceptions after the first (which is238   raised) will be logged. Added the ``quiet_exceptions``239   argument to suppress this logging for selected exception types.240 241.. deprecated:: 4.3242   Use `multi` instead.243Nc3�f# �UH'n[U5=(d [U[5v� M) g7frM)rr_�_NullFuture)�.0r�s  r*�	<genexpr>�multi_future.<locals>.<genexpr>s#���Q�=�a�y��|�9�z�!�[�9�9�=�s�/1�futr:c	�>�TRU5 T(dq/nTH#nURUR55 M% TR	5(d0Tb [T[[TU555 g[TU5 ggg![aqnTR	5(a2[UT5(d[R"SSS9 SnAM�SnAM�[T[R"55 SnAM�SnAff=f)Nz!Multiple exceptions in yield listT�rf)�remover�rirdr�r_r
�errorr	rerfr�dict�zip)	r��result_listrJr8�
children_futsrF�keysr��unfinished_childrens	    �����r*�callback�multi_future.<locals>.callbacks�����"�"�3�'�"��K�"��	D��&�&�q�x�x�z�2�#��;�;�=�=��#�6���S��{�%;� <��7�v�{�K�
!�#��244!�D��{�{�}�}�)�!�-=�>�>�#�M�M� C�d��� ?�245,�F�C�L�L�N�C�C��D�s�B�246D�;D�D�D)r_r�r�r�r��map�convert_yielded�all�setrIrr�addr247)248r�r��children_seqr��	listeningrJr�rFr�r�s249 `    @@@@r*r�r��s����$�(�D�!�!��H�M�M�O�$�����(��������_�l�;�<�M��Q�=�Q�Q�Q�Q�Q��m�,��
�
�F��*�6��9I�2�r�R�L�f�L��L�L�.��I�
�����M�M�!��$�Q�1���Mr)�xc�`�[U5(aU$[5nURU5 U$)a�Converts ``x`` into a `.Future`.250 251If ``x`` is already a `.Future`, it is simply returned; otherwise252it is wrapped in a new `.Future`.  This is suitable for use as253``result = yield gen.maybe_future(f())`` when you don't know whether254``f()`` returns a `.Future` or not.255 256.. deprecated:: 4.3257   This function only handles ``Futures``, not other yieldable objects.258   Instead of `maybe_future`, check for the non-future result types259   you expect (often just ``None``), and ``yield`` anything unknown.260)rrI�261set_result)r�r�s  r*�maybe_futurer�;s+����|�|���������q���262r)�timeoutrFc�R^^^^^^�[U5m[5m[TT5 [R"5mS[263SS4U4SjjmSUUU4SjjnTR
X5m[T[2645(a[TUU4Sj5 T$TRTUU4Sj5 T$)	a|Wraps a `.Future` (or other yieldable object) in a timeout.265 266Raises `tornado.util.TimeoutError` if the input future does not267complete before ``timeout``, which may be specified in any form268allowed by `.IOLoop.add_timeout` (i.e. a `datetime.timedelta` or269an absolute time relative to `.IOLoop.time`)270 271If the wrapped `.Future` fails after it has timed out, the exception272will be logged unless it is either of a type contained in273``quiet_exceptions`` (which may be an exception type or a sequence of274types), or an ``asyncio.CancelledError``.275 276The wrapped `.Future` is not canceled when the timeout expires,277permitting it to be reused. `asyncio.wait_for` is similar to this278function but it does cancel the wrapped `.Future` on timeout.279 280.. versionadded:: 4.0281 282.. versionchanged:: 4.1283   Added the ``quiet_exceptions`` argument and the logging of unhandled284   exceptions.285 286.. versionchanged:: 4.4287   Added support for yieldable objects other than `.Future`.288 289.. versionchanged:: 6.0.3290   ``asyncio.CancelledError`` is now always considered "quiet".291 292.. versionchanged:: 6.2293   ``tornado.util.TimeoutError`` is now an alias to ``asyncio.TimeoutError``.294 295rFr:Nc��>�UR5 g![Ra g[a6n[	UT5(d"SUSS9 SnAgSnAgSnAff=f)Nz$Exception in Future %r after timeoutTr�)ri�asyncio�CancelledErrorrdr_r
r�)rFr8r�s  �r*�error_callback�$with_timeout.<locals>.error_callbacksX���	��M�M�O���%�%�	���	��a�!1�2�2��
�
�:�F�T��3��	�s��A)�	A)�'A$�$A)c�|>�TR5(dTR[S55 [TT5 g)N�Timeout)r��
set_exceptionrr297)r��future_convertedris���r*�timeout_callback�&with_timeout.<locals>.timeout_callback�s,����{�{�}�}�� � ��i�!8�9� �!1�>�Br)c�&>�TRT5$rM��remove_timeout�rF�io_loop�timeout_handles ��r*rZ�with_timeout.<locals>.<lambda>�����W�-C�-C�N�-Sr)c�&>�TRT5$rMr�r�s ��r*rZr��r�r)�r:N)298r�rIrr�currentr�add_timeoutr_r299�300add_future)	r�rFr�r�r�r�r�rir�s	  ` @@@@@r*�with_timeoutr�Ps����T'�v�.��
�
�F��!�6�*��n�n��G�	�v�	�$�	�C�C��(�(��C�N��"�F�+�+�	!��S�	301��M�	����S�	302��Mr)�durationzFuture[None]c�n^�[5m[R"5RUU4Sj5 T$)a�Return a `.Future` that resolves after the given number of seconds.303 304When used with ``yield`` in a coroutine, this is a non-blocking305analogue to `time.sleep` (which should not be used in coroutines306because it is blocking)::307 308    yield gen.sleep(0.5)309 310Note that calling this function on its own does nothing; you must311wait on the `.Future` it returns (usually by yielding it).312 313.. versionadded:: 4.1314c�>�[TS5$rM)r)rJs�r*rZ�sleep.<locals>.<lambda>�s
���<�Q��Er))rIrr��315call_later)r�rJs @r*�sleepr��s/���	��A�316�N�N�����E��
�Hr)c�0�\rSrSrSrSSjrS\4SjrSrg)	r�i�a�_NullFuture resembles a Future that finished with a result of None.317 318It's not actually a `Future` to avoid depending on a particular event loop.319Handled as a special case in the coroutine runner.320 321We lie and tell the type checker that a _NullFuture is a Future so322we don't have to leak _NullFuture into lots of public APIs. But323this means that the type checker can't warn us when we're passing324a _NullFuture into a code path that doesn't understand what to do325with it.326r:Nc��grMr"r�s r*ri�_NullFuture.result����r)c��g)NTr"r�s r*r��_NullFuture.done�r�r)r"r�)	r$r%r&r'rzrir�r�r(r"r)r*r�r��s��327���d�r)r�a�A special object which may be yielded to allow the IOLoop to run for328one iteration.329 330This is not needed in normal use but it can be helpful in long-running331coroutines that are likely to yield Futures that are ready instantly.332 333Usage: ``yield gen.moment``334 335In native coroutines, the equivalent of ``yield gen.moment`` is336``await asyncio.sleep(0)``.337 338.. versionadded:: 4.0339 340.. deprecated:: 4.5341   ``yield None`` (or ``yield`` with no argument) is now equivalent to342    ``yield gen.moment``.343c344��\rSrSrSrS\SSSSS\S	S3454346SjrSSjrS
\S	\	4Sjr347S\\S\S\
RS	\	4SjrSrg348)rai�z�Internal implementation of `tornado.gen.coroutine`.349 350Maintains information about pending callbacks and their results.351 352The results of the generator are stored in ``result_future`` (a353`.Future`)354rh�genzGenerator[_Yieldable, Any, _T]�
result_futurerP�
first_yieldedr:Nc��XlX lX0l[UlSUlSUl[R"5Ul	URURU5(a!S=n=p4URUR5 gg)NF)rhr�r��_null_futurerF�running�finishedrr�r��handle_yieldr^)rwrhr�r�r�s     r*rv�Runner.__init__�sp������*��"��������
��~�~�'����<�<��)�)�=�9�9�26�6�C�6�-��L�L����"�:r)c��UR(dUR(agSUlURnUc[S5eUR	5(d	SUlgSUlUR5nSnSnUbURRU5nAOURRW5nUR%U5(d	SUlgSnM�![anUnSnANsSnAff=f!Snf=f!Af=f![[4aInSUl[Ul[UR[U55 SUl
SnASUlgSnAf[aL SUl[Ul[UR[ R""55 SUl
SUlgf=f!SUlf=f)z[Starts or resumes the generator, running until it reaches a355yield point that is not ready.356NTzNo pending futureF)r�r�rFrdr�rir��throw�sendrcr9r�rr�r@r	rerfr)rwrFr<�excr8rjs      r*r^�357Runner.run�s����<�<�4�=�=��2	!��D�L�������>�#�$7�8�8��{�{�}�}��V!�D�L�U#���$�358&� &�
�
���#��!%����$�&*�h�h�n�n�S�&9�G�!$�"&�(�(�-�-��"6�� �(�(��1�1��!�D�L���]��%�5�45���	5��"&���!$��&�v�.��$(�D�M�".�D�K�6��*�*�,E�a�,H��*.�D�&��!�D�L��!��$(�D�M�".�D�K�'��(:�(:�C�L�L�N�K�)-�D�&��359!�D�L���!�D�L�s��7F8�%F8�.C"�>C;�D�D�!D�"F8�#D�>F8�F8�"360C8�,C3�.C;�3C8�8C;�;C?�?D�D�D�F5�8E�F8�AF5�+F8�4F5�5F8�8	Grjc�^�[U5TlTR[La1TRRTRTR5 gTRc[S5eTRR5(d7S[SS4U4SjjnTRRTRU5 gg![a; [5Tl[	TR[361R"55 N�f=f)NFzno pending futurerJr:c�@>�SnTRTR5 grM)rhr^)rJrws �r*�inner�"Runner.handle_yield.<locals>.innerFs��������T�X�X�&r)T)r�rFr3rr	rerf�momentr��add_callbackrhr^rdr�rr�)rwrjr	s`  r*r�Runner.handle_yield8s����	=�)�'�2�D�K�362�;�;�&� ��L�L�%�%�d�l�l�D�H�H�=��
�[�[�
 ��/�0�0����!�!�#�#�
'��
'��
'�363
�L�L�#�#�D�K�K��7����%�	=� �(�D�K�����S�\�\�^�<�	=�s�C�AD�364D�typr<�tbc���UR(dTUR(dC[5Ul[	URXU45 URUR5 gg)NTF)r�r�rrFr	rhr^)rwrr<rs    r*�handle_exception�Runner.handle_exceptionOsC���|�|�D�M�M� �(�D�K�����c�"�-=�>��L�L����"��r))rhr�rFr�r�r�r�r�)r$r%r&r'rzr�365_Yieldablervr^r�rrrd�types�
TracebackTyperr(r"r)r*rara�s����#��#�.�#�$�	#�366"�#�367�
#�$8!�t�J��4��.	��	�?�	�+4�	�:?�:M�:M�	�	
�	r)ra�	awaitablec�^�[R"U5n[R"5mTR	U5 URU4Sj5 U$)Nc�&>�TRU5$rM)�_unregister_task)rJ�loops �r*rZ�!_wrap_awaitable.<locals>.<lambda>ds���D�$9�$9�!�$<r))r��
ensure_futurerr��_register_taskrb)rr�rs  @r*�_wrap_awaitabler[sC���368�369�370�	�371*�C��>�>��D���������<�=��Jr)rjc�:�Ub	U[La[$U[La[$[U[[45(a[U5$[
U5(a[R"[U5$[U5(a[U5$[SU<35e)aConvert a yielded object into a `.Future`.372 373The default implementation accepts lists, dictionaries, and374Futures. This has the side effect of starting any coroutines that375did not start themselves, similar to `asyncio.ensure_future`.376 377If the `~functools.singledispatch` library is available, this function378may be extended to support additional types. For example::379 380    @convert_yielded.register(asyncio.Future)381    def _(asyncio_future):382        return tornado.platform.asyncio.to_tornado_future(asyncio_future)383 384.. versionadded:: 4.1385 386zyielded unknown object )
rr�r_r�r�r�rr��castrrrr3)rjs r*r�r�hs���"��'�V�+��
�	�L�	 ���	�G�d�D�\�	*�	*��W�~��	�7�	�	��{�{�6�7�+�+�	�W�	�	��w�'�'��5�g�[�A�B�Br))r")Qrzr�r�r��collections.abcr�concurrent.futures�387concurrent�datetimermr�inspectrrer�tornado.concurrentrrrr	r388r�tornado.ioloopr�tornado.logr
�tornado.utilrr\�ImportErrorr�rrrrrrrrrrr�
TYPE_CHECKINGrrrr�TypeVarrr�rrdr r-r0r3r6rcr@rIrNrSr�rrr9r}r��Multir�r��float�	timedeltar�r�r�r r�rrarr�r"r)r*�<module>r0s@��=�~���%����$��389����"��%��������390���5�5��^�^�D���
��)�T�)�_�d�3�	�>�&:�J�<N�<N�<U�<U�U��391�392	�I�	�	�i�	�	�)�	�	�I�	�	�i�	���}�h�'>�!?��C������X�c�2�g�&��s��#��"��393�&�394�1�3952�&�
�� �&�396�&�397398�J�H�S�"�W�%�J�(�3D�*E�J�399�J�]�400��7�8�(�3��7�:K�K�401L�]�
�� �]�@9��9��9��Y��2}�}�@402�MO���z�"���D��O�U�4�	�?�C�3G�-H�H�I���D�\��403��404�MO���c�:�o�&���D��O�U�4�	�?�C�3G�-H�H�I���D�\��405��OQ�0E��H�Z�(�'�#�z�/�*B�B�C�0E�K�0E�)�0E�f	��406OQ�<��H�Z�(�'�#�z�/�*B�B�C�<�K�<�)�<�~�C��F��0OQ�N�
�5�(�,�,�,�
-�N��N�L�N��	N�b
�E�
�n�
�*��.�{�{�6�;�=�1��	���V�[�]�	+�����&u�u�p407�y�408�V�409�C�Z�C�F�C�>!��1���[���K��s�J1�1J=�<J=
codekingpro/portable-devtools · Team Ai