a �DOg�L�@s�ddlZgd�Zdd(d)�Zd?d*d+�ZGd,d-�d-e�ZGd.d/�d/e�Zd0d1�Zz0dd2lmZmZm Z mZmZm!Z!eZ"e Z#d3Z$Wn0e%�y\gZd4Z"iZ#d'a&d5d6�Z!dZ$Yn0eej'�e$�s�e(ed7��s�e d4e)d8d'd9�e d:e)d'd;�e d:e*d'd;�e d:e+d'd;�e d:e,d'd;�[$dS)@�N)�warn� warn_explicit� showwarning� formatwarning�filterwarnings� simplefilter� resetwarnings�catch_warningscCst||||||�}t|�dS�N)�WarningMessage�_showwarnmsg_impl)�message�category�filename�lineno�file�line�msg�r� /usr/lib64/python3.9/warnings.pyr srcCst||||d|�}t|�Sr )r �_formatwarnmsg_impl)r rrrrrrrrrsrcCsN|j}|dur tj}|dur dSt|�}z|�|�WntyHYn0dSr )r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrr s r c Cs�|jj}|j�d|j�d|�d|j�d�}|jdurnzddl}|�|j|j�}Wqttyjd}d}Yqt0n|j}|r�|� �}|d|7}|j du�r�z ddl }Wnty�d}d}Yn20|� �}z|� |j �}Wnty�d}Yn0|du�r||d7}|D]r}|d|j|jf7}z$|du�r<|�|j|j�}nd}Wnt�yZd}Yn0|�r|� �}|d |7}�qn|�s�||�d �7}|S) N�:z: � rz %s Tz-Object allocated at (most recent call last): z File "%s", lineno %s z %s z<: Enable tracemalloc to get the object allocation traceback )r�__name__rrr r� linecache�getline� Exception�strip�source� tracemalloc� is_tracing�get_object_traceback) rr�sr rr%�tracing�tb�framerrrr#sT"            �  rcCsbzt}WntyYn<0|turVt|�s4td��||j|j|j|j|j |j �dSt |�dS)Nz:warnings.showwarning() must be set to a function or method) r� NameError�_showwarning_orig�callable� TypeErrorr rrrrrr )r�swrrr� _showwarnmsg`s �r1cCsFzt}WntyYn$0|tur>||j|j|j|j|j�St|�Sr ) rr,�_formatwarning_origr rrrrr)r�fwrrrrus   �r�FcCsT|s|rddl}|r$|�||j�}nd}|r8|�|�}nd}t||||||d�dS)Nr��append)�re�compile�I� _add_filter)�actionr r�modulerr6r7rrrr�s rcCst|d|d||d�dS)Nr5)r:)r;rrr6rrrr�srcGsP|s4zt�|�Wnty$Yn0t�d|�n|tvrFt�|�t�dS)Nr)�filters�remove� ValueError�insertr6�_filters_mutated)r6�itemrrrr:�s  r:cCsgtdd�<t�dSr )r=rArrrrr�s rc@s eZdZdS)� _OptionErrorN)r� __module__� __qualname__rrrrrC�srCc CsP|D]F}z t|�WqtyH}ztd|tjd�WYd}~qd}~00qdS)NzInvalid -W option ignored:)r)� _setoptionrC�printrr)�args�argrrrr�_processoptions�s  rJc Cs�|�d�}t|�dkr$td|f��t|�dkr<|�d�q$dd�|D�\}}}}}t|�}t|�}|sl|rtddl}|r�|�|�}|r�|�|�d}|r�zt|�}|dkr�t �Wq�t t fy�td |f�d�Yq�0nd}t |||||�dS) Nr�ztoo many fields (max 5): %rr4cSsg|] }|���qSr)r#)�.0r(rrr� �s�z_setoption..rz\Zzinvalid lineno %r) �split�lenrCr6� _getaction� _getcategoryr7�escape�intr?� OverflowErrorr)rI�partsr;r rr<rr7rrrrF�s2    � rFcCsB|sdS|dkrdSdD]}|�|�r|Sqtd|f��dS)N�default�all�always)rVrX�ignorer<�once�errorzinvalid action: %r)� startswithrC)r;�arrrrP�s   rPcCs�|stSd|vrddl}|}nH|�d�\}}}zt|dd|g�}Wn"tydtd|f�d�Yn0zt||�}Wn"ty�td|f�d�Yn0t|t�s�td|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r) �Warning�builtins� rpartition� __import__� ImportErrorrC�getattr�AttributeError� issubclass)r�m�klassr<�_�catrrrrQ�s"   rQcCs|jj}d|vod|vS)N� importlib� _bootstrap)�f_code� co_filename)r+rrrr�_is_internal_framesrocCs"|j}|durt|�r|j}q|Sr )�f_backro)r+rrr�_next_external_framesrq�c Cs t|t�r|j}|durt}t|t�r0t|t�sDtd�t|�j���zV|dks\t t � d��rht � |�}n0t � d�}t |d�D]}t |�}|dur~t�q~Wn ty�t j}d}d}Yn0|j}|jj}|j}d|vr�|d} nd} |�di�} t||||| | ||�dS)Nz/category must be a Warning subclass, not '{:s}'rrrrzZ__warningregistry__)� isinstancer_� __class__� UserWarning�typerfr/�formatrror� _getframe�rangerqr?�__dict__� f_globalsrmrn�f_lineno� setdefaultr) r r� stacklevelr$r+�x�globalsrrr<�registryrrrrs< �       �rcCs�t|�}|dur8|pd}|dd���dkr8|dd�}|durDi}|�dd�tkrd|��t|d<t|t�r~t|�}|j}n |}||�}|||f} |�| �r�dSt D]V} | \} } } }}| dus�| � |�r�t || �r�|dus�|� |�r�|dks�||kr��qq�t } | dk�rdSddl }|�||�| dk�r2|�| dk�rfd || <||f}t�|��r\dSd t|<nf| d k�rrnZ| d k�r�d || <||df}|�|��r�dSd ||<n$| d k�r�d || <ntd | | f��t|||||�} t| �dS)Nz �����z.py�versionrrYr[rZrrrXr<rVz1Unrecognized action (%r) in warnings.filters: %s)rS�lower�get�_filters_version�clearrsr_�strrtr=�matchrf� defaultactionr �getlines� onceregistry� RuntimeErrorr r1)r rrrr<r��module_globalsr$r�keyrBr;rrj�modZlnr ZoncekeyZaltkeyrrrrGs|    �����             ��rc@s"eZdZdZddd�Zdd�ZdS)r )r rrrrrr$NcCs>||_||_||_||_||_||_||_|r4|jnd|_dSr ) r rrrrrr$r�_category_name)�selfr rrrrrr$rrr�__init__�szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r r�rrr)r�rrr�__str__�s  ��zWarningMessage.__str__)NNN)rrDrE�_WARNING_DETAILSr�r�rrrrr �s � r c@s4eZdZddd�dd�Zdd�Zdd �Zd d �ZdS) r FN)�recordr<cCs(||_|durtjdn||_d|_dS)N�warningsF)�_recordr�modules�_module�_entered)r�r�r<rrrr��szcatch_warnings.__init__cCsPg}|jr|�d�|jtjdur4|�d|j�t|�j}d|d�|�fS)Nz record=Truer�z module=%rz%s(%s)z, )r�r6r�rr�rvr�join)r�rH�namerrr�__repr__�s  zcatch_warnings.__repr__cCs~|jrtd|��d|_|jj|_|jdd�|j_|j��|jj|_|jj|_|j rvg}|j |j_|jj |j_|SdSdS)NzCannot enter %r twiceT) r�r�r�r=�_filtersrAr� _showwarningr r�r6r-)r��logrrr� __enter__�s       zcatch_warnings.__enter__cGs>|jstd|��|j|j_|j��|j|j_|j|j_dS)Nz%Cannot exit %r without entering first) r�r�r�r�r=rAr�rr )r��exc_inforrr�__exit__�s     zcatch_warnings.__exit__)rrDrEr�r�r�r�rrrrr �s  r cszd�j�d�g}�jdurVddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t |t d �d �dS) Nz coroutine 'z' was never awaited rc3s4t�j�D]$\}}}��||�}||||fVq dSr )�reversed� cr_originr!)rr�funcnamer��coror rr�extract�s z*_warn_unawaited_coroutine..extractz-Coroutine created at (most recent call last) r4r�)rr~r$) rEr�r � tracebackr6� format_list�listr��rstripr�RuntimeWarning)r�� msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s �  r�)r=�_defaultaction� _onceregistryrrrATrVcCs td7adS)Nrr)r�rrrrrAsrAZgettotalrefcount�__main__)rr<r6rY)rr6)NN)N)NrrN)NNNN)-r�__all__rrr rr-r1r2rr_rrr:rr"rCrJrFrPrQrorqrr�objectr r r�� _warningsr=r�r�rAr�r�Z_warnings_defaultsrcr�� warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning� ImportWarning�ResourceWarningrrrr�sh  ; � #  )� GC    �