ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/__pycache__/tracemalloc.cpython-311.opt-2.pyc

�

�fF���ddlmZmZddlmZddlZddlZddlZddl	Z	ddl
Tddl
mZmZd�Z
Gd�d��ZGd	�d
��Zd�ZeGd�d
����ZeGd�de����Zd�ZGd�d��ZGd�de��Zd�ZGd�d��ZGd�de��ZGd�de��ZGd�d��Zd�ZdS)�)�Sequence�Iterable)�total_orderingN)�*)�_get_object_traceback�_get_tracesc���dD]a}t|��dkr|dkr|r	d||fzcSd||fzcSt|��dks|dkr|r	d||fzcSd	||fzcS|d
z}�bdS)N)�B�KiB�MiB�GiB�TiB�dr
z%+.1f %sz%.1f %si(rz%+.0f %sz%.0f %si)�abs)�size�sign�units   �2/opt/alt/python311/lib64/python3.11/tracemalloc.py�_format_sizer
s���1�
�
���t�9�9�s�?�?�t�s�{�{��
0�!�T�4�L�0�0�0�0� �D�$�<�/�/�/�/��t�9�9�y� � �D�E�M�M��
0�!�T�4�L�0�0�0�0� �D�$�<�/�/�/�/������
�
�c�8�eZdZ	dZd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�	Statistic��	tracebackr�countc�0�||_||_||_dS�Nr)�selfrrrs    r�__init__zStatistic.__init__%s��"�����	���
�
�
rc�D�t|j|j|jf��Sr)�hashrrr�rs r�__hash__zStatistic.__hash__*s���T�^�T�Y��
�;�<�<�<rc��t|t��stS|j|jko|j|jko|j|jkSr)�
isinstancer�NotImplementedrrr�r�others  r�__eq__zStatistic.__eq__-sM���%��+�+�	"�!�!���%�/�1�.��I���+�.��J�%�+�-�	/rc��d|jt|jd��|jfz}|jr%|j|jz}|dt|d��zz
}|S)Nz%s: size=%s, count=%iF�, average=%s)rrrr�r�text�averages   r�__str__zStatistic.__str__4sc��'��N� ���E�2�2��J� � ���:�	B��i�$�*�,�G��N�\�'�5�%A�%A�A�A�D��rc�0�d|j|j|jfzS)Nz)<Statistic traceback=%r size=%i count=%i>rr"s r�__repr__zStatistic.__repr__>s��;��>�4�9�d�j�9�:�	;rc�*�|j|j|jfSr)rrrr"s r�	_sort_keyzStatistic._sort_keyBs���	�4�:�t�~�6�6rN�
�__name__�
__module__�__qualname__�	__slots__rr#r)r/r1r3�rrrrsz�������/�I����
=�=�=�/�/�/����;�;�;�7�7�7�7�7rrc�8�eZdZ	dZd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�
StatisticDiff�rr�	size_diffr�
count_diffc�L�||_||_||_||_||_dSrr<)rrrr=rr>s      rrzStatisticDiff.__init__Ms)��"�����	�"�����
�$����rc�\�t|j|j|j|j|jf��Sr)r!rrr=rr>r"s rr#zStatisticDiff.__hash__Ts.���T�^�T�Y����Z���2�3�3�	3rc���t|t��stS|j|jko?|j|jko/|j|jko|j|jko|j|jkSr)r%r;r&rrr=rr>r's  rr)zStatisticDiff.__eq__Xst���%��/�/�	"�!�!���%�/�1�8��I���+�8��N�e�o�5�8��J�%�+�-�8��O�u�'7�7�		9rc���d|jt|jd��t|jd��|j|jfz}|jr%|j|jz}|dt|d��zz
}|S)Nz %s: size=%s (%s), count=%i (%+i)FTr+)rrrr=rr>r,s   rr/zStatisticDiff.__str__asw��2��>���	�5�1�1�����5�5��:��?�	$�$���:�	B��i�$�*�,�G��N�\�'�5�%A�%A�A�A�D��rc�H�d|j|j|j|j|jfzS)Nz9<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>r<r"s rr1zStatisticDiff.__repr__ms*��K��>�4�9�d�n��:�t��0�0�	1rc�v�t|j��|jt|j��|j|jfSr)rr=rr>rrr"s rr3zStatisticDiff._sort_keyrs3���D�N�#�#�T�Y��D�O�$�$�d�j��� �	 rNr4r9rrr;r;Fs{�������J�I�%�%�%�3�3�3�9�9�9�
�
�
�1�1�1�
 � � � � rr;c	���g}|���D]�\}}|�|d��}|�8t||j|j|jz
|j|j|jz
��}n't||j|j|j|j��}|�|����|���D]9\}}t|d|jd|j��}|�|���:|S�Nr)�items�popr;rr�append)�	old_group�	new_group�
statisticsr�stat�previouss      r�_compare_grouped_statsrOxs���J�$�?�?�,�,�
 �
 ��	�4��=�=��D�1�1���� ��!%��D�I��
�,E�!%��T�Z�(�.�-H�J�J�D�D�!��!%��D�I�!%��T�Z�9�9�D�	���$�����$�?�?�,�,� � ��	�4��Y��D�I�:�q�4�:�+�F�F�����$������rc�d�eZdZ	dZd�Zed���Zed���Zd�Zd�Z	d�Z
d�Zd	�Zd
S)�Frame��_framec��||_dSrrR�r�frames  rrzFrame.__init__�s
������rc��|jdSrFrRr"s r�filenamezFrame.filename�����{�1�~�rc��|jdS�N�rRr"s r�linenozFrame.lineno�rYrc�Z�t|t��stS|j|jkSr�r%rQr&rSr's  rr)zFrame.__eq__��)���%��'�'�	"�!�!���u�|�+�,rc�Z�t|t��stS|j|jkSrr_r's  r�__lt__zFrame.__lt__�s)���%��'�'�	"�!�!���e�l�*�+rc�*�t|j��Sr)r!rSr"s rr#zFrame.__hash__�����D�K� � � rc�$�|j�d|j��S)N�:�rXr]r"s rr/z
Frame.__str__�s���-�-�-����5�5rc�(�d|j�d|j�d�S)Nz<Frame filename=z lineno=�>rgr"s rr1zFrame.__repr__�s���26�-�-�-�����M�MrN)
r5r6r7r8r�propertyrXr]r)rbr#r/r1r9rrrQrQ�s���������I��������X������X��-�-�-�
,�,�,�
!�!�!�6�6�6�N�N�N�N�NrrQc�j�eZdZ	dZdd�Zed���Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zdd�ZdS)�	Traceback)�_frames�
_total_nframeNc�~�tj|��tt|����|_||_dSr)rr�tuple�reversedrmrn)r�frames�total_nframes   rrzTraceback.__init__�s:����$����
�X�f�-�-�.�.���)����rc��|jSr)rnr"s rrszTraceback.total_nframe�s���!�!rc�*�t|j��Sr)�lenrmr"s r�__len__zTraceback.__len__�����4�<� � � rc��t|t��r$td�|j|D����St	|j|��S)Nc3�4K�|]}t|��V��dSr)rQ��.0�traces  r�	<genexpr>z(Traceback.__getitem__.<locals>.<genexpr>��(����G�G�%��u���G�G�G�G�G�Gr)r%�slicerprmrQ�r�indexs  r�__getitem__zTraceback.__getitem__��M���e�U�#�#�	.��G�G�4�<��3F�G�G�G�G�G�G����e�,�-�-�-rc��|j|jvSr)rSrmrUs  r�__contains__zTraceback.__contains__�����|�t�|�+�+rc�*�t|j��Sr)r!rmr"s rr#zTraceback.__hash__�s���D�L�!�!�!rc�Z�t|t��stS|j|jkSr�r%rlr&rmr's  rr)zTraceback.__eq__�s)���%��+�+�	"�!�!����
�-�.rc�Z�t|t��stS|j|jkSrr�r's  rrbzTraceback.__lt__�s)���%��+�+�	"�!�!���u�}�,�-rc�,�t|d��SrF)�strr"s rr/zTraceback.__str__�s���4��7�|�|�rc�`�dt|����}|j�|dz
}n|d|j�d�z
}|S)Nz<Traceback riz total_nframe=)rprnrs)r�ss  rr1zTraceback.__repr__�sG��'�%��+�+�'�'����%�
��H�A�A�
�6�$�"3�6�6�6�6�A��rFc�X�g}|�|dkr||d�}n
|d|�}n|}|rt|��}|D]r}|�d|j�d|j����t	j|j|j�����}|r|�d|z���s|S)Nrz  File "z", line z    %s)rqrIrXr]�	linecache�getline�strip)r�limit�most_recent_first�lines�frame_slicerV�lines       r�formatzTraceback.format�s��������q�y�y�"�E�6�7�7�m���"�6�E�6�l����K��	0�"�;�/�/�K� �	.�	.�E��L�L�L�!�N�N�N�E�L�L�:�
;�
;�
;��$�U�^�U�\�B�B�H�H�J�J�D��
.����X��_�-�-�-���rr)NF)r5r6r7r8rrjrsrwr�r�r#r)rbr/r1r�r9rrrlrl�s��������-�I�*�*�*�*��"�"��X�"�!�!�!�.�.�.�,�,�,�"�"�"�/�/�/�
.�.�.�
�����������rrlc�H�	t|��}|�t|��SdSr)rrl)�objrrs  r�get_object_tracebackr�s/���#�3�
'�
'�F�
���� � � ��trc�t�eZdZ	dZd�Zed���Zed���Zed���Zd�Z	d�Z
d�Zd	�Zd
S)�Trace��_tracec��||_dSrr��rr}s  rrzTrace.__init__s������rc��|jdSrFr�r"s r�domainzTrace.domainrYrc��|jdSr[r�r"s rrz
Trace.sizerYrc�.�t|jdd��S)N�)rlr�r"s rrzTrace.traceback#s���$�+�a�b�b�/�*�*rc�Z�t|t��stS|j|jkSr)r%r�r&r�r's  rr)zTrace.__eq__'r`rc�*�t|j��Sr)r!r�r"s rr#zTrace.__hash__,rdrc�@�|j�dt|jd����S)Nz: F)rrrr"s rr/z
Trace.__str__/s"���>�>�>�<��	�5�+I�+I�+I�J�Jrc�T�d|j�dt|jd���d|j�d�S)Nz<Trace domain=z size=Fz, traceback=ri)r�rrrr"s rr1zTrace.__repr__2s5����;�;�;��T�Y�� >� >� >� >�����P�	QrN)
r5r6r7r8rrjr�rrr)r#r/r1r9rrr�r�s���������I����
����X������X���+�+��X�+�-�-�-�
!�!�!�K�K�K�Q�Q�Q�Q�Qrr�c�2�eZdZd�Zd�Zd�Zd�Zd�Zd�ZdS)�_Tracesc�<�tj|��||_dSr)rr�_traces)r�tracess  rrz_Traces.__init__8s����$��������rc�*�t|j��Sr)rvr�r"s rrwz_Traces.__len__=rxrc��t|t��r$td�|j|D����St	|j|��S)Nc3�4K�|]}t|��V��dSr)r�r{s  rr~z&_Traces.__getitem__.<locals>.<genexpr>Brr)r%r�rpr�r�r�s  rr�z_Traces.__getitem__@r�rc��|j|jvSr)r�r�r�s  rr�z_Traces.__contains__Fr�rc�Z�t|t��stS|j|jkSr)r%r�r&r�r's  rr)z_Traces.__eq__Is)���%��)�)�	"�!�!����
�-�.rc�&�dt|��zS)Nz<Traces len=%s>)rvr"s rr1z_Traces.__repr__Ns�� �3�t�9�9�,�,rN)	r5r6r7rrwr�r�r)r1r9rrr�r�7sn���������
!�!�!�.�.�.�,�,�,�/�/�/�
-�-�-�-�-rr�c��tj�|��}|�d��r
|dd�}|S)Nz.pyc���)�os�path�normcase�endswith)rXs r�_normalize_filenamer�Rs?���w����)�)�H����� � �!��C�R�C�=���Orc��eZdZd�Zd�ZdS)�
BaseFilterc��||_dSr)�	inclusive)rr�s  rrzBaseFilter.__init__Zs
��"����rc��t�r)�NotImplementedErrorr�s  r�_matchzBaseFilter._match]s��!�!rN)r5r6r7rr�r9rrr�r�Ys2������#�#�#�"�"�"�"�"rr�c�P��eZdZ	d	�fd�	Zed���Zd�Zd�Zd�Zd�Z	�xZ
S)
�FilterNFc���t���|��||_t|��|_||_||_||_dSr)�superrr�r��_filename_patternr]�
all_framesr�)rr��filename_patternr]r�r��	__class__s      �rrzFilter.__init__bsL���
������#�#�#�"���!4�5E�!F�!F������$�������rc��|jSr)r�r"s rr�zFilter.filename_patternks���%�%rc��t|��}tj||j��sdS|j�dS||jkS)NFT)r��fnmatchr�r]�rrXr]s   r�_match_frame_implzFilter._match_frame_implosE��&�x�0�0����x��)?�@�@�	��5��;���4��d�k�)�*rc�@�|�||��|jzSr)r�r�r�s   r�_match_framezFilter._match_framexs"���%�%�h��7�7�t�~�;M�N�Nrc����jr*t�fd�|D����r�jS�jS|d\}}��||��S)Nc3�J�K�|]\}}��||��V��dSr)r�)r|rXr]rs   �rr~z*Filter._match_traceback.<locals>.<genexpr>}sK�����6�6�'�x���)�)�(�F�;�;�6�6�6�6�6�6rr)r��anyr�r�)rrrXr]s`   r�_match_tracebackzFilter._match_traceback{s|����?�	7��6�6�6�6�+4�6�6�6�6�6�
,��~�%� �N�*�+�(��|��H�f��$�$�X�v�6�6�6rc��|\}}}}|�|��}|j�!|jr
|o
||jkS|p
||jkS|Sr)r�r�r�)rr}r�rrrs�ress       rr�z
Filter._match�s^��05�-���i���#�#�I�.�.���;�"��~�
6��6��$�+� 5�6��5�v���4�5��
r)NFN)r5r6r7rrjr�r�r�r�r��
__classcell__�r�s@rr�r�as��������7;��������&�&��X�&�+�+�+�O�O�O�	7�	7�	7�������rr�c�:��eZdZ�fd�Zed���Zd�Z�xZS)�DomainFilterc�X��t���|��||_dSr)r�r�_domain)rr�r�r�s   �rrzDomainFilter.__init__�s&���
������#�#�#�����rc��|jSr)r�r"s rr�zDomainFilter.domain�s
���|�rc�8�|\}}}}||jk|jzSr)r�r�)rr}r�rrrss      rr�zDomainFilter._match�s'��05�-���i���$�+�%�d�n�*<�=�=r)r5r6r7rrjr�r�r�r�s@rr�r��sb����������������X��>�>�>�>�>�>�>rr�c�T�eZdZ	d�Zd�Zed���Zd�Zd�Zd�Z	dd�Z
dd	�Zd
S)�Snapshotc�<�t|��|_||_dSr)r�r��traceback_limit)rr�r�s   rrzSnapshot.__init__�s���f�o�o���.����rc��	t|d��5}tj||tj��ddd��dS#1swxYwYdS)N�wb)�open�pickle�dump�HIGHEST_PROTOCOL)rrX�fps   rr�z
Snapshot.dump�s���	��(�D�
!�
!�	;�R��K��b�&�"9�:�:�:�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;�	;����	;�	;�	;�	;�	;�	;s�!A�A�Ac��	t|d��5}tj|��cddd��S#1swxYwYdS)N�rb)r�r��load)rXr�s  rr�z
Snapshot.load�s���	��(�D�
!�
!�	#�R��;�r�?�?�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	#�	#s�3�7�7c���|rt�fd�|D����sdS|rt�fd�|D����rdSdS)Nc3�B�K�|]}|����V��dSr�r��r|�trace_filterr}s  �rr~z)Snapshot._filter_trace.<locals>.<genexpr>�sE�����<�<�'�$�*�*�5�1�1�<�<�<�<�<�<rFc3�D�K�|]}|����V��dSrr�r�s  �rr~z)Snapshot._filter_trace.<locals>.<genexpr>�sH�����8�8�#�$�*�*�5�1�1�1�8�8�8�8�8�8rT)r�)r�include_filters�exclude_filtersr}s   `r�
_filter_tracezSnapshot._filter_trace�s�����	��<�<�<�<�+:�<�<�<�<�<�
��u��	��8�8�8�8�'6�8�8�8�8�8�
��u��trc�����	t|t��s$tdt|��jz���|rVg�g�|D]4}|jr��|�����|���5���fd��jjD��}n�jj�	��}t|�j��S)Nz)filters must be a list of filters, not %sc�B��g|]}����|���|��Sr9)r�)r|r}r�r�rs  ���r�
<listcomp>z*Snapshot.filter_traces.<locals>.<listcomp>�sE���8�8�8�E�!�/�/��0?�05�7�7�8�%�8�8�8r)r%r�	TypeError�typer5r�rIr�r��copyr�r�)r�filtersr��
new_tracesr�r�s`   @@r�
filter_traceszSnapshot.filter_traces�s�����	�
�'�8�,�,�	6��G�"�7�m�m�4�5�6�6�
6��
	4� �O� �O� '�
9�
9���)�9�#�*�*�<�8�8�8�8�#�*�*�<�8�8�8�8�8�8�8�8�8�8�T�[�-@�8�8�8�J�J�
��,�1�1�3�3�J��
�D�$8�9�9�9rc�>�|dvrtd|�����|r|dvrtd|z���i}i}|s�|jjD]�}|\}}}}		||}
nO#t$rB|dkr|}n"|dkr|dd�}n|dddff}t	|��}
|
||<YnwxYw	||
}|xj|z
c_|xjdz
c_��#t$rt|
|d��||
<Y��wxYwn�|jjD]�}|\}}}}	|D]�}
	||
}
n9#t$r,|dkr|
f}n|
ddff}t	|��}
|
||
<YnwxYw	||
}|xj|z
c_|xjdz
c_�o#t$rt|
|d��||
<Y��wxYw��|S)	N)rrXr]zunknown key_type: )r]rXz/cumulative mode cannot by used with key type %rrr]r\r)�
ValueErrorr�r��KeyErrorrlrrr)r�key_type�
cumulative�stats�
tracebacksr}r�r�trace_tracebackrsrrrrMrVs              r�	_group_byzSnapshot._group_by�s����>�>�>��*�x�x�A�B�B�B��	<�(�*@�@�@��0�2:�;�<�<�
<����
��'	I���,�
E�
E��>C�;���o�|�
<� *�?� ;�I�I���<�<�<��;�.�.�!0���!�X�-�-�!0��!��!4���#2�1�#5�a�#8�!�"<�!>�� )�&� 1� 1�I�2;�J��/�/�/�<����E� ��+�D��I�I��%�I�I��J�J�!�O�J�J�J���E�E�E�'0��D�!�'D�'D�E�)�$�$�$�E����#
E�*��,�
I�
I��>C�;���o�|�,�I�I�E�6�$.�u�$5�	�	��#�6�6�6�#�x�/�/�&+�X�F�F�',�Q�x��m�%5�F�$-�f�$5�$5�	�,5�
�5�)�)�)�
6����I�$�Y�/���	�	�T�)�	�	��
�
�a��
�
�
��#�I�I�I�+4�Y��a�+H�+H��i�(�(�(�I����I� �sI�A�A	B �B �$(C
�
C.�-C.�D�3E�
E�(E8�8F�FFc��	|�||��}t|�����}|�dtj���|S�NT)�reverse�key)r
�list�values�sortrr3)rrr�groupedrLs     rrLzSnapshot.statisticssR��	��.�.��:�6�6���'�.�.�*�*�+�+�
�����)�*=��>�>�>��rc���	|�||��}|�||��}t||��}|�dtj���|Sr)r
rOrr;r3)r�old_snapshotrrrKrJrLs       r�
compare_tozSnapshot.compare_tos_��	�
�N�N�8�Z�8�8�	� �*�*�8�Z�@�@�	�+�I�y�A�A�
�����-�*A��B�B�B��rN)F)r5r6r7rr��staticmethodr�r�rr
rLrr9rrr�r��s��������/�/�/�;�;�;��#�#��\�#�	�	�	�:�:�:�21�1�1�f����
�
�
�
�
�
rr�c��	t��std���t��}t��}t	||��S)NzLthe tracemalloc module must be tracing memory allocations to take a snapshot)�
is_tracing�RuntimeErrorr�get_traceback_limitr�)r�r�s  r�
take_snapshotr'sP����<�<�=��<�=�=�	=�
�]�]�F�)�+�+�O��F�O�,�,�,r)�collections.abcrr�	functoolsrr�r��os.pathr�r��_tracemallocrrrrr;rOrQrlr�r�r�r�r�r�r�r�rr9rr�<module>r s���.�.�.�.�.�.�.�.�$�$�$�$�$�$�������������
�
�
�
�����;�;�;�;�;�;�;�;����"%7�%7�%7�%7�%7�%7�%7�%7�P/ �/ �/ �/ �/ �/ �/ �/ �d���(�#N�#N�#N�#N�#N�#N�#N���#N�L�J�J�J�J�J��J�J���J�Z���$Q�$Q�$Q�$Q�$Q�$Q�$Q�$Q�N-�-�-�-�-�h�-�-�-�6���"�"�"�"�"�"�"�"�-�-�-�-�-�Z�-�-�-�`>�>�>�>�>�:�>�>�>�E�E�E�E�E�E�E�E�P	-�	-�	-�	-�	-r

Zerion Mini Shell 1.0