Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/coverage/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/coverage/__pycache__/collector.cpython-311.pyc

�

�܋fNP���dZddlmZddlZddlZddlZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddl m!Z!m"Z"dd
l#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.e"e��Z	ddl/m0Z0m1Z1dZ2nK#e3$rCej4d��dkr*ej5�6d��ej7d��dZ2YnwxYwed��Z8Gd�d��Z9dS)z#Raw data collector for coverage.py.�)�annotationsN)�	FrameType)�cast�Any�Callable�Dict�List�Mapping�Optional�Set�Tuple�Type�TypeVar)�env)�CoverageConfig)�CoverageData)�short_stack)�FileDisposition)�ConfigError)�human_sorted_items�isolate_module)�CoveragePlugin)�PyTracer)�TArc�TFileDisposition�TLineNo�
TTraceData�TTraceFn�TTracer�TWarnFn)�CTracer�CFileDispositionT�COVERAGE_TEST_TRACER�cz:*** COVERAGE_TEST_TRACER is 'c' but can't import CTracer!
�F�Tc���eZdZUdZgZded<hd�Zd@d�ZdAd�ZdBd�Z	dAd�Z
dCd�ZdCd �ZdDd"�Z
dEd)�ZdCd*�ZdCd+�ZdCd,�ZdCd-�ZdFd.�ZdGd0�ZdHd3�Zejd4�5��dId7���ZdJd;�ZdKd>�ZdFd?�Zd4S)L�	CollectoraCollects trace data.

    Creates a Tracer object for each thread, since they track stack
    information.  Each Tracer points to the same shared data, contributing
    traced data points.

    When the Collector is started, it creates a Tracer for the current thread,
    and installs a function to create Tracers for each new thread started.
    When the Collector is stopped, all active Tracers are stopped.

    Threads started while the Collector is stopped will never have Tracers
    associated with them.

    zList[Collector]�_collectors>�gevent�eventlet�greenlet�should_trace�,Callable[[str, FrameType], TFileDisposition]�
check_include� Callable[[str, FrameType], bool]�should_start_context�.Optional[Callable[[FrameType], Optional[str]]]�file_mapper�Callable[[str], str]�timid�bool�branch�warnr �concurrency�	List[str]�return�Nonec	�
�||_||_||_||_||_||_||_t|jt��sJd|j�����|d|_	d|_
t��|_d|_
||d}	tr|sd}	|	r't|_t"|_d|_d|_n&t*|_t,|_d|_d|_t/|j��}
|
t0jz
}|r4d�t7|����}t9d|�����|
|jz}
t=|
��dkr4d�t7|
����}t9d|�����d}d	}	d
|
vrd
}ddl}|j |_
n2d|
vrd}ddl!}|j"j |_
nd
|
vrd
}ddl#}|j |_
d|
vrd}n(#tH$r}d|�d�}t9|��|�d}~wwxYw|j
rJtK|jd��s5t9d�&||�'�������|s|
sddl	}||_	|�(��dS)a�Create a collector.

        `should_trace` is a function, taking a file name and a frame, and
        returning a `coverage.FileDisposition object`.

        `check_include` is a function taking a file name and a frame. It returns
        a boolean: True if the file should be traced, False if not.

        `should_start_context` is a function taking a frame, and returning a
        string. If the frame should be the start of a new context, the string
        is the new context. If the frame should not be the start of a new
        context, return None.

        `file_mapper` is a function taking a filename, and returning a Unicode
        filename.  The result is the name that will be recorded in the data
        file.

        If `timid` is true, then a slower simpler trace function will be
        used.  This is important for some environments where manipulation of
        tracing functions make the faster more sophisticated trace function not
        operate properly.

        If `branch` is true, then branches will be measured.  This involves
        collecting data on which statements followed each other (arcs).  Use
        `get_arc_data` to get the arc data.

        `warn` is a warning function, taking a single string message argument
        and an optional slug argument which will be a string or None, to be
        used if a warning needs to be issued.

        `concurrency` is a list of strings indicating the concurrency libraries
        in use.  Valid values are "greenlet", "eventlet", "gevent", or "thread"
        (the default).  "thread" can be combined with one of the other three.
        Other values are ignored.

        zExpected a list: NFTz, zUnknown concurrency choices: r%z"Conflicting concurrency settings: �nothingr,rr+r*�threadz Couldn't trace with concurrency=z, the module isn't installed.�concur_id_funczACan't support concurrency={} with {}, only threads are supported.))r-r/r1r3r7r8r9�
isinstance�list�	threading�static_contextr�originr@�HAS_CTRACERr!�_trace_classr"�file_disposition_class�supports_plugins�packed_arcsrr�setr�CONCURRENCY_CHOICES�join�sortedr�
LIGHT_THREADS�lenr,�
getcurrent�eventlet.greenthread�greenthreadr*�ImportError�hasattr�format�tracer_name�reset)�selfr-r/r1r3r5r7r8r9�use_ctracer�
concurrencies�unknown�show�
light_threads�do_threading�triedr,r+r*�ex�msgrCs                      �e/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/coverage/collector.py�__init__zCollector.__init__Ls��^)���*���$8��!�&��������	�&����$�*�D�1�1�[�[�3[�t�GW�3[�3[�[�[�1��"����-1���!�m�m���"����(��;����	�u�	��K��		%� '�D��*:�D�'�$(�D�!�#�D��� (�D��*9�D�'�$)�D�!�$�D���D�,�-�-�
��.�"D�D���	F��9�9�V�G�_�_�-�-�D��D�d�D�D�E�E�E�%��(:�:�
��}����!�!��9�9�V�M�2�2�3�3�D��I�4�I�I�J�J�J�����	+��]�*�*�"������&.�&9��#�#��}�,�,�"��+�+�+�+�&.�&:�&E��#�#��]�*�*� ���
�
�
�&,�&7��#��=�(�(�#�����	+�	+�	+�Y�U�Y�Y�Y�C��c�"�"��*�����	+������	�w�t�/@�BR�'S�'S�	��S�Z�Z��4�+�+�-�-�����
��	'�}�	'�
����&�D�N��
�
�����s�AG'�'
H�1H�H�strc�T�dt|��d�d|����d�S)Nz<Collector at 0x�x�: �>)�idrW�rYs rc�__repr__zCollector.__repr__�s0��E�"�T�(�(�E�E�E��0@�0@�0B�0B�E�E�E�E��covdatar�context�
Optional[str]c�`�||_||_|j�|j��dS)z!Use `covdata` for recording data.N)rnrD�set_context)rYrnros   rc�use_datazCollector.use_data�s0�����%����� � ��!4�5�5�5�5�5rmc��|jjS)z0Return the class name of the tracer we're using.)rG�__name__rks rcrWzCollector.tracer_name�s��� �)�)rmc��|j���D]}|����|jD]}|����dS)z<Clear out existing data, but stay ready for more collection.N)�data�values�clear�tracers�reset_activity)rY�d�tracers   rc�_clear_datazCollector._clear_data�s`��
��!�!�#�#�	�	�A�
�G�G�I�I�I�I��l�	$�	$�F��!�!�#�#�#�#�	$�	$rmc���i|_i|_t��|_tjrddl}|�d��|_ni|_g|_	|�
��dS)z2Clear collected data, and prepare to collect more.rN�module)rw�file_tracersrK�disabled_pluginsr�PYPY�__pypy__�newdict�should_trace_cacherzr~)rYr�s  rcrXzCollector.reset�sz��!#��	�-/���*-�%�%����8�	)��O�O�O�'/�&6�&6�x�&@�&@�D�#�#�&(�D�#�')����������rmrc��|���}|j|_|j|_|j|_|j|_|j|_t|d��r|j|_t|d��r|j	|_	t|d��r|j
|_
t|d��r|j|_t|d��r|j|_t|d��r|j
|_
t|d��r|j|_|���}|j�|��|S)z8Start a new Tracer object, and store it in self.tracers.r@r�rCr/r1�switch_context�disable_plugin)rGrwr7�
trace_arcsr-r�r8rUr@r�rCr/r1r�r��startrz�append)rYr}�fns   rc�
_start_tracerzCollector._start_tracers<���"�"�$�$���i��� �K���"�/���$(�$;��!��i����6�+�,�,�	8�$(�$7�F�!��6�>�*�*�	4�"&�"3�F���6�;�'�'�	.�#�~�F���6�?�+�+�	6�#'�#5�F� ��6�1�2�2�	D�*.�*C�F�'��6�+�,�,�	8�$(�$7�F�!��6�+�,�,�	8�$(�$7�F�!�
�\�\�^�^������F�#�#�#��	rm�framer�event�argr�Optional[TTraceFn]c�t�tjd��|���}|r
||||��}|S)z0Called on new threads, installs the real tracer.N)�sys�settracer�)rYr�r�r�r�s     rc�_installation_tracezCollector._installation_trace9sG��	��T����!%�!3�!3�!5�!5���	'���E�5�#�&�&�B��	rmc�Z�|jr|jd���g|_g}tj��}|r$t|dd��}|rt|dg��}	|���}n,#|jr|jd����xYw|j�|��|D];\\}}}}	|||||����#t$r}	td��|	�d}	~	wwxYw|jr!|j�|j
��dSdS)z#Start collecting trace information.����__self__N�traces)�linenoz3fullcoverage must be run with the C trace function.)r)�pauserzr��gettrace�getattrr��resumer��	TypeError�RuntimeErrorrCr�r�)
rY�traces0�fn0�tracer0r�r�r�r�r�ras
          rcr�zCollector.startFs�����	)���R� �&�&�(�(�(����EG���l�n�n���	9��c�:�t�4�4�G��
9�!�'�8�R�8�8��	��#�#�%�%�B�B��	���
.�� ��$�+�+�-�-�-�����	
�����%�%�%�,3�	b�	b�'��U�E�3��
b���5�%��V�4�4�4�4�4���
b�
b�
b�"�#X�Y�Y�_a�a�����
b����
�>�	>��N�#�#�D�$<�=�=�=�=�=�	>�	>s$�*A?�?)B(�C!�!
D�+C;�;Dc��|jsJ�|jd|ur3td��|jD]}td|�d|j�����|jd|usJd|�d|jd�����|���|j���|jr!|jd���dSdS)z"Stop collecting trace information.r�zself._collectors:z  �
z!Expected current collector to be z, but it's N)r)�printrEr��popr�)rYr$s  rc�stopzCollector.stopns���������B��t�+�+��%�&�&�&��%�
.�
.���,�1�,�,�!�(�,�,�-�-�-�-����#�t�+�+�+�[��[�[�4�CS�TV�CW�[�[�,�+�+�	
�
�
����	
���������	*���R� �'�'�)�)�)�)�)�	*�	*rmc�J�|jD]w}|���|���}|rKtd��t	|�����D]\}}t|d�d|������x|jr|j�d��dSdS)z+Pause tracing, but be prepared to `resume`.z
Coverage.py tracer stats:z>20rhN)rzr��	get_statsr�r�itemsrCr�)rYr}�stats�k�vs     rcr�zCollector.pause�s����l�	+�	+�F��K�K�M�M�M��$�$�&�&�E��
+��3�4�4�4�.�u�{�{�}�}�=�=�+�+�D�A�q��Q�/�/�/�a�/�/�*�*�*�*���>�	*��N�#�#�D�)�)�)�)�)�	*�	*rmc��|jD]}|����|jr!|j�|j��dS|���dS)zResume tracing after a `pause`.N)rzr�rCr�r�r�)rYr}s  rcr�zCollector.resume�sc���l�	�	�F��L�L�N�N�N�N��>�	!��N�#�#�D�$<�=�=�=�=�=���� � � � � rmc�>�td�|jD����S)zkHas any activity been traced?

        Returns a boolean, True if any trace function was invoked.

        c3�>K�|]}|���V��dS)N)�activity)�.0r}s  rc�	<genexpr>z&Collector._activity.<locals>.<genexpr>�s,����@�@��6�?�?�$�$�@�@�@�@�@�@rm)�anyrzrks rc�	_activityzCollector._activity�s#���@�@�4�<�@�@�@�@�@�@rm�new_contextc��|���|jr|j}|r|d|zz
}n|}|j�|��dS)z Switch to a new dynamic context.�|N)�
flush_datarDrnrr)rYr�ros   rcr�zCollector.switch_context�s`��	
��������	"��)�G��
-��3��,�,���!�G��� � ��)�)�)�)�)rm�dispositionrc��|j}|�J�|j}|j}|�d|�d���d|_d|_dS)z.Disable the plugin mentioned in `disposition`.NzDisabling plug-in z due to previous exceptionF)�file_tracer�_coverage_plugin�_coverage_plugin_namer8�_coverage_enabled�trace)rYr�r��plugin�plugin_names     rcr�zCollector.disable_plugin�sZ��!�-���&�&�&��-���2���	�	�P�{�P�P�P�Q�Q�Q�#(�� �!����rmN)�maxsize�filenamec�,�|�|��S)zBA locally cached version of file names mapped through file_mapper.)r3)rYr�s  rc�cached_mapped_filezCollector.cached_mapped_file�s������)�)�)rmr|�Mapping[str, T]�Dict[str, T]c����d}td��D]>}	t|�����}n2#t$r}|}Yd}~�7d}~wwxYwt	|t
��sJ�|��fd�|D��S)z<Return a dict like d, but with keys modified by file_mapper.N�c�F��i|]\}}|���|��|��S�)r��r�r�r�rYs   �rc�
<dictcomp>z.Collector.mapped_file_dict.<locals>.<dictcomp>�s2���E�E�E�$�!�Q�1�E��'�'��*�*�A�E�E�Erm)�rangerBr�r�rA�	Exception)rYr|�runtime_err�_r�ras`     rc�mapped_file_dictzCollector.mapped_file_dict�s�������q���		�		�A�
��Q�W�W�Y�Y������� �
!�
!�
!� �����������
!����
�k�9�5�5�5�5�5���E�E�E�E�%�E�E�E�Es�!9�
A�A
�
Ar�rc�D�|j�|j��dS)z1Record that `plugin` was disabled during the run.N)r��addr�)rYr�s  rc�plugin_was_disabledzCollector.plugin_was_disabled�s"����!�!�&�">�?�?�?�?�?rmc��������sdS�j�r�jr�i}ttt
ttf�j��}|�	��D]I\}}g}|D]:}|dz}|dzdz	}|dzr|dz}|dzr|dz}|�
||f���;|||<�Jn7ttt
ttf�j��}�j
���|����ndttt
ttf�j��}	�j
���|	�����fd��j�	��D��}
�j
���|
��������d	S)
z�Save the collected data to our associated `CoverageData`.

        Data may have also been saved along the way. This forces the
        last of the data to be saved.

        Returns True if there was data to save, False if not.
        Fi��l���lr�lc�.��i|]\}}|�jv�||��Sr�)r�r�s   �rcr�z(Collector.flush_data.<locals>.<dictcomp>�s7���
�
�
��Q����-�-�-�
�q�-�-�-rmT)r�r7rJrrrer�intrwr�r�r	rrn�add_arcsr��	add_linesr��add_file_tracersr~)rY�arc_data�packed_data�fname�packeds�tuples�packed�l1�l2�	line_datar�s`          rcr�zCollector.flush_data�s�����~�~���	��5��;�	E���
B�35��"�4��S��X�
�#6��	�B�B��&1�&7�&7�&9�&9�
-�
-�N�E�7��F�")�0�0��#�g�-��$�
�6�2�=��!�W�-�%��"�H�B�!�W�-�%��"�H�B��
�
�r�2�h�/�/�/�/�&,�H�U�O�O�
-� ��S�$�t�*�_� 5�t�y�A�A���L�!�!�$�"7�"7��"A�"A�B�B�B�B��T�#�s�3�x�-�0�$�)�<�<�I��L�"�"�4�#8�#8��#C�#C�D�D�D�
�
�
�
�!�.�4�4�6�6�
�
�
��	
��%�%�d�&;�&;�L�&I�&I�J�J�J��������trm)r-r.r/r0r1r2r3r4r5r6r7r6r8r r9r:r;r<)r;re)rnrrorpr;r<)r;r<)r;r)r�rr�rer�rr;r�)r;r6)r�rpr;r<)r�rr;r<)r�rer;re)r|r�r;r�)r�rr;r<)ru�
__module__�__qualname__�__doc__r)�__annotations__rOrdrlrsrWr~rXr�r�r�r�r�r�r�r�r��	functools�	lru_cacher�r�r�r�r�rmrcr(r(4s��������
�
�$$&�K�%�%�%�%�7�6�6�M�B�B�B�B�HF�F�F�F�6�6�6�6�*�*�*�*�	$�	$�	$�	$�*�*�*�*�X����J����&>�&>�&>�&>�P*�*�*�*�&
*�
*�
*�
*�!�!�!�!�A�A�A�A�
*�
*�
*�
*�"�"�"�"��Y���&�&�&�*�*�*�'�&�*�F�F�F�F�(@�@�@�@�+�+�+�+�+�+rmr():r��
__future__rr��osr��typesr�typingrrrrr	r
rrr
rr�coverager�coverage.configr�
coverage.datar�coverage.debugr�coverage.dispositionr�coverage.exceptionsr�
coverage.miscrr�coverage.pluginr�coverage.pytracerr�coverage.typesrrrrrrr �coverage.tracerr!r"rFrT�getenv�stderr�write�exitr&r(r�rmrc�<module>rs���*�)�"�"�"�"�"�"�����	�	�	�	�
�
�
�
���������������������������������������*�*�*�*�*�*�&�&�&�&�&�&�&�&�&�&�&�&�0�0�0�0�0�0�+�+�+�+�+�+�<�<�<�<�<�<�<�<�*�*�*�*�*�*�&�&�&�&�&�&��������������������^�B�����9�9�9�9�9�9�9�9��K�K�������r�y�'�(�(�C�/�/�	�
���V�W�W�W���������K�K�K������G�C�L�L��H�H�H�H�H�H�H�H�H�Hs�
B�AC�C

Hacked By AnonymousFox1.0, Coded By AnonymousFox