gU8dZddlZgdZd0dZd1dZdZdZeZdZeZ d Z d e d dd fd Z e dd fd Z dZdZGddeZdZdZdZdZdZdZdZdZd2dddZ d3dZGdd eZGd!d"eZd#Zefej@d$d%Z!d&Z" dd'l#m$Z$m%Z%m&Z&mZmZm'Z'e%Z(e&Z)d(Z*eejZe*sAe.ed+s8e d)e/d,d-e d.e/d/e d.e0d/e d.e1d/e d.e2d/[*y#e+$rgZ$d)Z(iZ)da,d*Z'd Z*YkwxYw)4z&Python part of the warnings subsystem.N)warn warn_explicit showwarning formatwarningfilterwarnings simplefilter resetwarningscatch_warningsc:t||||||}t|y)7Hook to write a warning to a file; replace if you like.N)WarningMessage_showwarnmsg_impl)messagecategoryfilenamelinenofilelinemsgs //opt/alt/python312/lib64/python3.12/warnings.pyrr s (HfdD ICcc8t||||d|}t|S).Function to format a warning the standard way.N)r _formatwarnmsg_impl)rrrrrrs rrrs! (HfdD IC s ##rc|j}|tj}|yt|} |j |y#t $rYywxYwN)rsysstderr_formatwarnmsgwriteOSError)rrtexts rrrsP 88D |zz <  # D  4    sA A  A cv|jj}|jd|jd|d|jd}|j ;|jdk7r, ddl}|j|j|j}n |j }|r|j}|d|zz }|j ddl } |j }|j|j}|u|dz }|D]i}|d |jd |jdz } '|j|j|j}nd}|sR|j}|d |zz }k|S|r||d z }|S#t$rd}d}YwxYw#t$rd}d}YwxYw#t$rd}d}YwxYw#t$rd}YqwxYw) N:z:  rrz %s Fz-Object allocated at (most recent call last): z File "z ", lineno z %s z<: Enable tracemalloc to get the object allocation traceback )r__name__rrrr linecachegetline Exceptionstripsource tracemalloc is_tracingget_object_traceback) rrsr'rr,suggest_tracemalloctbframes rrr#s||$$H LL>3::,b "S[[M DA xxCLLE1  $$S\\3::>Dxx zz| X_ zz   *5*@*@*B&B# 55cjjA > A AA78  ,(00N#::||j|j|j|j |j St|S#t$r Yt|SwxYw)r) r_formatwarning_origrrrrrr7r)rfws rrrxso:  ( (ckk3<<llCJJ: : s ##   s ## sA A/.A/Fc|s|rddl}|rj||j}nd}|rj|}nd}t||||||y)aInsert an entry into the list of warnings filters (at the front). 'action' -- one of "error", "ignore", "always", "default", "module", or "once" 'message' -- a regex that the warning message must match 'category' -- a class that the warning must be a subclass of 'module' -- a regex that the module name must match 'lineno' -- an integer line number, 0 matches all warnings 'append' -- if true, append to the list of filters rNappend)recompileI _add_filter)actionrrmodulerr@rAs rrrsP*&**Wbdd+ F#66&Irc&t|d|d||y)aInsert a simple entry into the list of warnings filters (at the front). A simple filter matches all modules and messages. 'action' -- one of "error", "ignore", "always", "default", "module", or "once" 'category' -- a class that the warning must be a subclass of 'lineno' -- an integer line number, 0 matches all warnings 'append' -- if true, append to the list of filters Nr?)rD)rErrr@s rrrshfVDrc|s7 tj|tjd|t y|tvrtj|t y#t$rYTwxYw)Nr)filtersremove ValueErrorinsertr@_filters_mutated)r@items rrDrDs`   NN4  q$ w  NN4     sA"" A.-A.c*gtddty)zAClear the list of warning filters, so that no filters are active.N)rIrMrrr r sGAJrceZdZdZy) _OptionErrorz,Exception used by option processing helpers.N)r& __module__ __qualname____doc__rPrrrRrRs6rrRc|D]} t|y#t$r&}td|tjYd}~z'_is_filename_to_skip..sL9Kvx""6*9Ks)any)rskip_file_prefixess` r_is_filename_to_skiprs L9KL LLrc@t|jjS)zFSignal whether the frame is an internal CPython implementation detail.)rf_code co_filename)r2s r_is_internal_framers !9!9 ::rc|j}|jt|jjx}s t ||r=|j}|/t|jjx}r0t ||r=|S)zBFind the next frame that doesn't involve Python or user internals.)f_backrrrr)r2rrs r_next_external_framer sk LLE   !ell.F.F"F( G += >    !ell.F.F"F( G += > LrrP)rc &t|tr |j}|t}t|trt |ts-t djt |jt|ts t d|r td|} |dksttjdrtj|}n__warningregistry__) isinstancerq __class__ UserWarningtyperxr6formatr&tuplemaxrr _getframerangerrK f_globalsrrf_lineno__dict__ setdefaultr) rr stacklevelr+rr2xglobalsrrrFregistrys rrr+su'7#$$ x &:h+H%%+VDN,C,C%DF F (% 0EFFJ'  ?0q1ABMM*-EMM!$E:a<(,U4FG=$$)//<<++W$!!"7z.pyversionrrjrlrkrrirFrgzUnrecognized action (z) in warnings.filters: )rclowerget_filters_versionclearrrqstrrrImatchrx defaultactionr'getlines onceregistry RuntimeErrorr r9)rrrrrFrmodule_globalsr+r"keyrNrErr|modlnr'oncekeyaltkeys rrrYs[F ~([ "#;   % 'CR[F||Iq!%55.'7#7|$$7# 6 "C||C$(!S#r [CIIdO x % [CIIf- 1W"    x0    "   G $  ! W 8  8  !$ <<   9  t  (Hff ECrc"eZdZdZ ddZdZy)r )rrrrrrr+Nc||_||_||_||_||_||_||_|r|j|_yd|_yr) rrrrrrr+r&_category_name)selfrrrrrrr+s r__init__zWarningMessage.__init__sJ         3;h//rc d|jd|jd|jd|jd|jd S)Nz {message : z , category : z , filename : z , lineno : z , line : })rrrrr)rs r__str__zWarningMessage.__str__s0$(LL$2E2E$(MM4;; K Lr)NNN)r&rSrT_WARNING_DETAILSrrrPrrr r s *BF#' FLrr c8eZdZdZdddeddddZdZdZd Zy) r a9A context manager that copies and restores the warnings filter upon exiting the context. The 'record' argument specifies whether warnings should be captured by a custom implementation of warnings.showwarning() and be appended to a list returned by the context manager. Otherwise None is returned by the context manager. The objects appended to the list are arguments whose attributes mirror the arguments to showwarning(). The 'module' argument is to specify an alternative module to the module named 'warnings' and imported under that name. This argument is only useful when testing the warnings module itself. If the 'action' argument is not None, the remaining arguments are passed to warnings.simplefilter() as if it were called immediately on entering the context. FNr)recordrFrErrr@c||_|tjdn||_d|_|d|_y||||f|_y)zSpecify whether to record warnings and if an alternative module should be used other than sys.modules['warnings']. For compatibility with Python 3.0, please consider all arguments to be keyword-only. NwarningsF)_recordrmodules_module_entered_filter)rrrFrErrr@s rrzcatch_warnings.__init__sD 28.s{{:.f  >DL"Hff=DLrcg}|jr|jd|jtjdur|jd|jzt |j }|ddj|dS)Nz record=Truerz module=%r(z, ))rr@rrrrr&join)rrYnames r__repr__zcatch_warnings.__repr__sf << KK & < >  ,, #}}Q/  %%' LL44!%!?!? << # $,, ' <<C-0ZZDLL *(,||'E'EDLL $Jrc|jstd|z|j|j_|jj |j |j_|j|j_y)Nz%Cannot exit %r without entering first) rrrrrIrMrrr)rexc_infos r__exit__zcatch_warnings.__exit__s^}}FMN N#}}  %%'#'#4#4  )-)?)? &r) r&rSrTrUrqrrrrrPrrr r s,$"'twq>"2*@rr z@{name!r} is deprecated and slated for removal in Python {remove})_versionc|dd|d}|dd|kDs|dd|k(r|ddk7r|d|d }t||j|| }t|td y) a;Warn that *name* is deprecated or should be removed. RuntimeError is raised if *remove* specifies a major/minor tuple older than the current Python version or the same version but past the alpha. The *message* argument is formatted with *name* and *remove* as a Python version (e.g. "3.11"). rrprNralphaz% was slated for removal after Python z alpha)rrJ)r)rrrDeprecationWarning)rrrJrremove_formattedrs r _deprecatedrs!)AfQi[1! v8BQ<6#9hqkW>T=>N=OvV3nn$/?n@ S$3rc*djdg}jAddlddl}fd}|j d||j t |z }dj|jd}t|td y) Nz coroutine 'z' was never awaited rc3~KtjD] \}}}j||}||||f"ywr)reversed cr_originr()rrfuncnamercoror's rextractz*_warn_unawaited_coroutine..extractsC.6t~~.F*&( ((6:488/Gs:=z-Coroutine created at (most recent call last) r=r%r)rrr+) rTrr' tracebackr@ format_listlistrrstriprRuntimeWarning)r msg_linesrrrr's` @r_warn_unawaited_coroutiners d''((=>I ~~!# 9 IJY**4 ?;; '')  # #D )C ~!DAr)rI_defaultaction _onceregistryrrrMTrgctdz ay)Nr)rrPrrrMrMCs Argettotalrefcount__main__)rrFr@rj)rr@)NNr)NrN)NNNN)3rUr__all__rrrrr4r9r;rrqrrrDr r)rRr[rWr`rarrrrrrobjectr r _DEPRECATED_MSG version_inforr _warningsrIrrrMrr_warnings_defaultsrur warnoptionshasattrrPendingDeprecationWarning ImportWarningResourceWarningrPrrrs,  . $  ; | &$ $$&1!JF#*!EE   9 F>89*@M; ,#!,#^>BDNLVL,I@VI@XU-43CSCS4(B<BB"M L   3* +y+=( 4X(:1EX(A!LX a@XB5 GML sDDD