/snap/core24/1587/usr/lib/python3.12/asyncio/__pycache__
NameSizeModeActions
base_events.cpython-312.pyc866100644editdlrm
base_futures.cpython-312.pyc30860644editdlrm
base_subprocess.cpython-312.pyc161020644editdlrm
base_tasks.cpython-312.pyc40870644editdlrm
constants.cpython-312.pyc9550644editdlrm
coroutines.cpython-312.pyc37690644editdlrm
events.cpython-312.pyc367530644editdlrm
exceptions.cpython-312.pyc30810644editdlrm
format_helpers.cpython-312.pyc38650644editdlrm
futures.cpython-312.pyc172560644editdlrm
locks.cpython-312.pyc275020644editdlrm
log.cpython-312.pyc2810644editdlrm
mixins.cpython-312.pyc10360644editdlrm
proactor_events.cpython-312.pyc445580644editdlrm
protocols.cpython-312.pyc87820644editdlrm
queues.cpython-312.pyc119410644editdlrm
runners.cpython-312.pyc99360644editdlrm
selector_events.cpython-312.pyc631240644editdlrm
sslproto.cpython-312.pyc415470644editdlrm
staggered.cpython-312.pyc62400644editdlrm
streams.cpython-312.pyc333800644editdlrm
subprocess.cpython-312.pyc120960644editdlrm
taskgroups.cpython-312.pyc79270644editdlrm
tasks.cpython-312.pyc403710644editdlrm
threads.cpython-312.pyc12580644editdlrm
timeouts.cpython-312.pyc77970644editdlrm
transports.cpython-312.pyc140040644editdlrm
trsock.cpython-312.pyc50790644editdlrm
unix_events.cpython-312.pyc678140644editdlrm
windows_events.cpython-312.pyc415390644editdlrm
windows_utils.cpython-312.pyc73380644editdlrm
__init__.cpython-312.pyc14570644editdlrm
__main__.cpython-312.pyc51750644editdlrm
Edit: /snap/core24/1587/usr/lib/python3.12/asyncio/__pycache__/runners.cpython-312.pyc (9936B)
ЦidZddlZddlZddlZddlZddlZddlmZddlmZddlm Z ddlm Z ddlm Z Gd d ejZ Gd d Zddd dZdZy))RunnerrunN) coroutines)events) exceptions)tasks) constantsceZdZdZdZdZy)_Statecreated initializedclosedN)__name__ __module__ __qualname__CREATED INITIALIZEDCLOSED&/usr/lib/python3.12/asyncio/runners.pyr r sGK Frr cNeZdZdZddddZdZdZdZdZdd d Z d Z d Z y) ra5A context manager that controls event loop life cycle. The context manager always creates a new event loop, allows to run async functions inside it, and properly finalizes the loop at the context manager exit. If debug is True, the event loop will be run in debug mode. If loop_factory is passed, it is used for new event loop creation. asyncio.run(main(), debug=True) is a shortcut for with asyncio.Runner(debug=True) as runner: runner.run(main()) The run() method can be called multiple times within the runner's context. This can be useful for interactive console (e.g. IPython), unittest runners, console tools, -- everywhere when async code is called from existing sync framework and where the preferred single asyncio.run() call doesn't work. Ndebug loop_factoryctj|_||_||_d|_d|_d|_d|_y)NrF) r r_state_debug _loop_factory_loop_context_interrupt_count_set_event_loop)selfrrs r__init__zRunner.__init__0s:nn  )  !$rc&|j|SN) _lazy_initr%s r __enter__zRunner.__enter__9s  rc$|jyr()close)r%exc_typeexc_valexc_tbs r__exit__zRunner.__exit__=s  rcF|jtjury |j}t ||j |j |j |jtj|jrtjd|jd|_tj|_y#|jrtjdjd|_tj|_wxYw)zShutdown and close event loop.N)rr rr!_cancel_all_tasksrun_until_completeshutdown_asyncgensshutdown_default_executorr THREAD_JOIN_TIMEOUTr$rset_event_loopr-r)r%loops rr-z Runner.close@s ;;f00 0  (::D d #  # #D$;$;$= >  # #..y/L/LM O##%%d+ JJLDJ --DK ##%%d+ JJLDJ --DKs A$CAD c:|j|jS)zReturn embedded event loop.)r)r!r*s rget_loopzRunner.get_loopQs zzrcontextctj|stdj|t j t d|j| |j}|jj||}tjtjurztjtj tj"urGt%j&|j(|} tjtj |nd}d|_ |jj-||Ytjtj |ur3tjtj tj"SSS#t$rd}YwxYw#t.j0$r4|j*dkDr#t3|dd}||dk(r t5wxYw#|Ytjtj |ur3tjtj tj"wwwxYw)z/Run a coroutine inside the embedded event loop.z"a coroutine was expected, got {!r}Nz7Runner.run() cannot be called from a running event loopr<) main_taskruncancel)r iscoroutine ValueErrorformatr_get_running_loop RuntimeErrorr)r"r! create_task threadingcurrent_thread main_threadsignal getsignalSIGINTdefault_int_handler functoolspartial _on_sigintr#r4rCancelledErrorgetattrKeyboardInterrupt)r%coror=tasksigint_handlerr@s rrz Runner.runVs%%d+AHHNO O  # # % 1IK K  ?mmGzz%%dG%<  $ $ &)*?*?*A A  /63M3MM&..t$ON & fmm^<"N ! I::006*$$V]]3~E fmmV-G-GHF+% &"&  &(( $$q("4T:'HJ!O+--   *$$V]]3~E fmmV-G-GHF+s,$F,6F=, F:9F:=AHHAI$c$|jtjur td|jtjury|j Lt j|_|jsz#Runner._on_sigint..sr)r#donecancelr!call_soon_threadsaferS)r%signumframer?s rrPzRunner._on_sigintsT "  A %inn.>     JJ + +L 9 !!r) rrr__doc__r&r+r1r-r;rr)rPrrrrrs=6!%4%(" $(+IZ)&"rrrctj tdt||5}|j |cdddS#1swYyxYw)azExecute the coroutine and return the result. This function runs the passed coroutine, taking care of managing the asyncio event loop, finalizing asynchronous generators and closing the default executor. This function cannot be called when another asyncio event loop is running in the same thread. If debug is True, the event loop will be run in debug mode. This function always creates a new event loop and closes it at the end. It should be used as a main entry point for asyncio programs, and should ideally only be called once. The executor is given a timeout duration of 5 minutes to shutdown. If the executor hasn't finished within that duration, a warning is emitted and the executor is closed. Example: async def main(): await asyncio.sleep(1) print('hello') asyncio.run(main()) Nz8asyncio.run() cannot be called from a running event loopr)rrDrErr)mainrrrunners rrrsT8!- FH H e, 7 6zz$   s AAcBtj|}|sy|D]}|j|jtj|ddi|D]G}|j r|j %|jd|j |dIy)Nreturn_exceptionsTz1unhandled exception during asyncio.run() shutdown)message exceptionrU)r all_tasksr`r4gather cancelledrkcall_exception_handler)r9 to_cancelrUs rr3r3s%I   ELL)LtLM >>   >>  '  ' 'N!^^-)  r)__all__rZenumrNrGrJrrrr r Enumr rrr3rrrrusW   TYY I"I"X$" Jr