AlkantarClanX12

Your IP : 18.217.10.200


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

�

�܋f����R�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZmZmZmZmZmZmZmZmZmZmZddlmZddlmZddl m!Z!m"Z"dd	l#m$Z$m%Z%dd
l&m'Z'm(Z(ddl)m*Z*m+Z+ddl,m-Z-m.Z.m/Z/m0Z0m1Z1dd
l2m3Z3ddl4m5Z5m6Z6m7Z7m8Z8ddl9m:Z:m;Z;m<Z<m=Z=ddl>m?Z?ddl@mAZAddlBmCZCddlDmEZEddlFmGZGmHZHddlFmIZImJZJmKZKddlLmMZMddlNmOZOddlPmQZQddlRmSZSddlTmUZUddlVmWZWddlXmYZYddlZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbddlcmdZdeKe��Zejed2d%���ZfeId&��ZgegZhGd'�d e\��Ziejejk�ld(d����r)dd)l,mmZmmnZnemend*�+��d,g�-��ei��Zid3d/�Zod4d1�ZpdS)5z#Core control stuff for coverage.py.�)�annotationsN)�	FrameType)�cast�Any�Callable�Dict�IO�Iterable�Iterator�List�Optional�Tuple�Union)�env)�AnnotateReporter)�	Collector�HAS_CTRACER)�CoverageConfig�read_coverage_config)�"should_start_context_test_function�combine_context_switchers)�CoverageData�combine_parallel_data)�DebugControl�NoDebugging�short_stack�write_formatted_info�relevant_environment_display)�disposition_debug_msg)�ConfigError�CoverageException�CoverageWarning�PluginError)�PathAliases�abs_file�relative_filename�set_relative_directory)�HtmlReporter)�InOrOut)�JsonReporter)�LcovReporter)�bool_or_none�
join_regex)�DefaultValue�ensure_dir_for_file�isolate_module)�patch_multiprocessing)�FileReporter)�Plugins)�PythonFileReporter)�SummaryReporter)�
render_report)�Analysis)�FilePath�
TConfigurable�TConfigSectionIn�TConfigValueIn�TConfigValueOut�TFileDisposition�TLineNo�TMorf)�XmlReporter�cov�Coverage�kwargsr;�return�Iterator[None]c+�K�|j}|j���|_	|jjdi|��dV�||_dS#||_wxYw)z�Temporarily tweak the configuration of `cov`.

    The arguments are applied to `cov.config` with the `from_args` method.
    At the end of the with-statement, the old configuration is restored.
    N�)�config�copy�	from_args)rArC�original_configs   �c/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib64/python3.11/site-packages/coverage/control.py�override_configrM;si�����j�O�����"�"�C�J�%���
��&�&�v�&�&�&�
����$��
�
�
��_��
�$�$�$�$s�A�	A�MISSINGc�2�eZdZUdZgZded<ed�d���Zedddddd	dddddddddfd�d#�Z	d�d$�Z
d�d%�Zd�d&�Zd�d,�Z
d�d-�Zd�d�d1�Zd�d2�Zd�d5�Zd�d8�Zd�d9�Zd�d:�Zd�d<�Zd�d=�Zd�d>�Zd�d�dA�Zd�dF�Zd�dG�Zd�dI�Zd�d�dL�Zd�d�dN�Zd�dO�Zd�dP�Zd�d�dR�Z d�dS�Z!d�dU�Z"			d�d�dY�Z#d�d[�Z$d�d\�Z%d�d`�Z&d�db�Z'd�df�Z(d�dh�Z)d�d�dl�Z*d�dm�Z+												d�d�d|�Z,						d�d�d~�Z-												d�d�d��Z.							d�d�d��Z/								d�d�d��Z0						d�d�d��Z1d�d��Z2dS)�rBaProgrammatic access to coverage.py.

    To use::

        from coverage import Coverage

        cov = Coverage()
        cov.start()
        #.. call your code ..
        cov.stop()
        cov.html_report(directory="covhtml")

    Note: in keeping with Python custom, names starting with underscore are
    not part of the public API. They might stop working at any point.  Please
    limit yourself to documented methods to avoid problems.

    Methods can raise any of the exceptions described in :ref:`api_exceptions`.

    zList[Coverage]�
_instancesrD�Optional[Coverage]c�.�|jr
|jdSdS)z�Get the latest started `Coverage` instance, if any.

        Returns: a `Coverage` instance, or None.

        .. versionadded:: 5.0

        ���N)rP)�clss rL�currentzCoverage.currentfs ���>�	��>�"�%�%��4�NFT�	data_file�'Optional[Union[FilePath, DefaultValue]]�data_suffix�Optional[Union[str, bool]]�cover_pylib�Optional[bool]�	auto_data�bool�timid�branch�config_file�Union[FilePath, bool]�source�Optional[Iterable[str]]�source_pkgs�omit�#Optional[Union[str, Iterable[str]]]�include�debug�concurrency�check_preimported�context�
Optional[str]�messages�Nonec�N�t��|_|du|_t|t��rd}|�tj|��}d|_|x|_|_	||_
d|_d|_||_
g|_||_g|_t#��|_d|_t)��|_d|_d|_t0|_dx|_|_i|_d|_d|_d|_d|_ d|_!t|tD��stj|��}tGdid|�d|j$�d|�d|�d|�d	|�d
tK|���d|�d|	�d
|
�d|�d|�d|
�d|�d|
�d|��|_tLj'stQ��dSdS)a�
        Many of these arguments duplicate and override values that can be
        provided in a configuration file.  Parameters that are missing here
        will use values from the config file.

        `data_file` is the base name of the data file to use. The config value
        defaults to ".coverage".  None can be provided to prevent writing a data
        file.  `data_suffix` is appended (with a dot) to `data_file` to create
        the final file name.  If `data_suffix` is simply True, then a suffix is
        created with the machine and process identity included.

        `cover_pylib` is a boolean determining whether Python code installed
        with the Python interpreter is measured.  This includes the Python
        standard library and any packages installed with the interpreter.

        If `auto_data` is true, then any existing data file will be read when
        coverage measurement starts, and data will be saved automatically when
        measurement stops.

        If `timid` is true, then a slower and simpler trace function will be
        used.  This is important for some environments where manipulation of
        tracing functions breaks the faster trace function.

        If `branch` is true, then branch coverage will be measured in addition
        to the usual statement coverage.

        `config_file` determines what configuration file to read:

            * If it is ".coveragerc", it is interpreted as if it were True,
              for backward compatibility.

            * If it is a string, it is the name of the file to read.  If the
              file can't be read, it is an error.

            * If it is True, then a few standard files names are tried
              (".coveragerc", "setup.cfg", "tox.ini").  It is not an error for
              these files to not be found.

            * If it is False, then no configuration file is read.

        `source` is a list of file paths or package names.  Only code located
        in the trees indicated by the file paths or package names will be
        measured.

        `source_pkgs` is a list of package names. It works the same as
        `source`, but can be used to name packages where the name can also be
        interpreted as a file path.

        `include` and `omit` are lists of file name patterns. Files that match
        `include` will be measured, files that match `omit` will not.  Each
        will also accept a single string argument.

        `debug` is a list of strings indicating what debugging information is
        desired.

        `concurrency` is a string indicating the concurrency library being used
        in the measured code.  Without this, coverage.py will get incorrect
        results if these libraries are in use.  Valid strings are "greenlet",
        "eventlet", "gevent", "multiprocessing", or "thread" (the default).
        This can also be a list of these strings.

        If `check_preimported` is true, then when coverage is started, the
        already-imported files will be checked to see if they should be
        measured by coverage.  Importing measured files before coverage is
        started can mean that code is missed.

        `context` is a string to use as the :ref:`static context
        <static_contexts>` label for collected data.

        If `messages` is true, some messages will be printed to stdout
        indicating what is happening.

        .. versionadded:: 4.0
            The `concurrency` parameter.

        .. versionadded:: 4.2
            The `concurrency` parameter can now be a list of strings.

        .. versionadded:: 5.0
            The `check_preimported` and `context` parameters.

        .. versionadded:: 5.3
            The `source_pkgs` parameter.

        .. versionadded:: 6.0
            The `messages` parameter.

        NTFra�warnrWr[r_r`�parallelrcre�run_omit�run_includeri�report_omit�report_includerjrlrG))rrH�_no_disk�
isinstancer.�os�fspath�_debug_file�
_auto_load�
_auto_save�_data_suffix_specified�
_warn_no_data�_warn_unimported_source�_warn_preimported_source�_no_warn_slugs�	_messages�	_warningsr�_debug�_inoroutr3�_plugins�_data�
_collectorr%�_file_mapper�_data_suffix�_run_suffix�_exclude_re�_old_sigterm�_inited�_inited_for_start�_started�_should_write_debugr^r�_warnr,r�METACOV� _prevent_sub_process_measurement)�selfrWrYr[r]r_r`rarcrerfrhrirjrkrlrns                 rL�__init__zCoverage.__init__ts;��Z%�&�&���"�T�)��
��i��.�.�	��I�� ��	�)�,�,�I�/3���,5�5���$�/�&1��#�"���'+��$�(9��%�)+���!���%'���%0�M�M���+/��
�!(����
�-1��
�/3���2:���/3�3���D�,�+-���QU������!&�����
�#'�� ��+�t�,�,�	1��)�K�0�0�K�*�
�
�
�#��
����
� �i�
�$��	
�
�%�
��6�

�"�+�.�.�.�
��6�
�$��
��T�
� ��
��%�
���
�#�7�
�$��
� �G�!
���0�{�	/�,�.�.�.�.�.�	/�	/rVc��|jrdSd|_t|jj|j|jj��|_d|jjpdvrd|j_i|_	t��|jjrt|_
tj|jj|j|j��|_|jjD]E}|�||jgt)t+j����dz���FdS)z�Set all the initial state.

        This is called by the public methods to initialize state. This lets us
        construct a :class:`Coverage` object, then tweak its state before this
        function is called.

        NT�multiprocessingrG�)r�rrHrir{�
debug_filer�rjrrr�r'�relative_filesr&r�r3�load_plugins�pluginsr��configurers�	configure�int�time�r��plugins  rL�_initzCoverage._init/s���<�	��F����#�4�;�#4�d�6F���H^�_�_������!8�!>�B�?�?�$(�D�K� ����� � � ��;�%�	2� 1�D�� �,�T�[�-@�$�+�t�{�[�[��
��m�/�	H�	H�F�

���d�D�K�0��T�Y�[�[�1A�1A�A�1E�F�G�G�G�G�	H�	HrVc���|jrd|_|���|jjr8|jjt	d���vrtd|jj�����dSdS)z,Stuff to do after everything is initialized.F�)�limitzCrashing because called by N)r��_write_startup_debugrH�_crashr�RuntimeError�r�s rL�
_post_initzCoverage._post_initVs���#�	(�',�D�$��%�%�'�'�'��;��	S�$�+�"4��!�8L�8L�8L�"L�"L��Q�T�[�=O�Q�Q�R�R�R�	S�	S�"L�"LrVc���d}|j���5|j�d��r6|j���}t|jjd|��d}|j�d��rrt|jjd|�����|jD];}d|j	z}|���}t|jj||���<d}|j�d��r.t|jjdtj����d}ddd��n#1swxYwY|rt|jjdd	��dSdS)
z*Write out debug info at startup if needed.FrHT�syszsys: �pybehaveN�endrG)r��without_callers�shouldrH�
debug_infor�write�sys_infor��_coverage_plugin_namer)r��	wrote_any�config_infor��header�infos      rLr�zCoverage._write_startup_debugas����	�
�[�
(�
(�
*�
*�	!�	!��{�!�!�(�+�+�
!�"�k�4�4�6�6��$�T�[�%6��+�N�N�N� �	��{�!�!�%�(�(�
!�$�T�[�%6��t�}�}���O�O�O�"�m�J�J�F�$�v�'C�C�F�!�?�?�,�,�D�(���):�F�D�I�I�I�I� �	��{�!�!�*�-�-�
!�$�T�[�%6�
�C�N�DT�DT�U�U�U� �	�!	!�	!�	!�	!�	!�	!�	!�	!�	!�	!�	!����	!�	!�	!�	!�$�	?� ���!2�E�2�>�>�>�>�>�	?�	?s�D%E
�
E�E�filename�str�framerr=c���|j�J�|j�||��}|j�d��r'|j�t|����|S)z�Decide whether to trace execution in `filename`.

        Calls `_should_trace_internal`, and returns the FileDisposition.

        N�trace)r��should_tracer�r�r�r)r�r�r��disps    rL�
_should_tracezCoverage._should_traceyse���}�(�(�(��}�)�)�(�E�:�:���;���g�&�&�	;��K���3�D�9�9�:�:�:��rVc���|j�J�|j�||��}|j�d��r*|sd|��}nd|�d|��}|j�|��|S)z�Check a file name against the include/omit/etc, rules, verbosely.

        Returns a boolean: True if the file should be traced, False if not.

        Nr�z
Including zNot including z: )r��check_include_omit_etcr�r�r�)r�r�r��reason�msgs     rL�_check_include_omit_etcz Coverage._check_include_omit_etc�s����}�(�(�(���5�5�h��F�F���;���g�&�&�	#��
>�/�8�/�/���=�x�=�=�V�=�=���K���c�"�"�"��z�rVr��slug�oncec��|jst|jj��|_||jvrdS|j�|��|r|�d|�d�}|j�d��rdtj	���d|��}tj|td���|r |�J�|j�|��dSdS)	z�Use `msg` as a warning.

        For warning suppression, use `slug` as the shorthand.

        If `once` is true, only show this warning once (determined by the
        slug.)

        Nz (�)�pid�[z] r�)�category�
stacklevel)
r��listrH�disable_warningsr��appendr�r�ry�getpid�warningsrqr")r�r�r�r�s    rLr�zCoverage._warn�s����"�	E�"&�t�{�'C�"D�"D�D���4�&�&�&��F�����c�"�"�"��	$��#�#�D�#�#�#�C��;���e�$�$�	+�*�b�i�k�k�*�*�S�*�*�C��
�c�O��B�B�B�B��	-��#�#�#���&�&�t�,�,�,�,�,�	-�	-rVc�6�|jrt|��dSdS)z4Write a message to the user, if configured to do so.N)r��print)r�r�s  rL�_messagezCoverage._message�s%���>�	��#�J�J�J�J�J�	�	rV�option_name�Optional[TConfigValueOut]c�6�|j�|��S)aGet an option from the configuration.

        `option_name` is a colon-separated string indicating the section and
        option name.  For example, the ``branch`` option in the ``[run]``
        section of the config file would be indicated with `"run:branch"`.

        Returns the value of the option.  The type depends on the option
        selected.

        As a special case, an `option_name` of ``"paths"`` will return an
        dictionary with the entire ``[paths]`` section value.

        .. versionadded:: 4.0

        )rH�
get_option)r�r�s  rLr�zCoverage.get_option�s�� �{�%�%�k�2�2�2rV�value�'Union[TConfigValueIn, TConfigSectionIn]c�<�|j�||��dS)ahSet an option in the configuration.

        `option_name` is a colon-separated string indicating the section and
        option name.  For example, the ``branch`` option in the ``[run]``
        section of the config file would be indicated with ``"run:branch"``.

        `value` is the new value for the option.  This should be an
        appropriate Python value.  For example, use True for booleans, not the
        string ``"True"``.

        As an example, calling:

        .. code-block:: python

            cov.set_option("run:branch", True)

        has the same effect as this configuration file:

        .. code-block:: ini

            [run]
            branch = True

        As a special case, an `option_name` of ``"paths"`` will replace the
        entire ``[paths]`` section.  The value should be a dictionary.

        .. versionadded:: 4.0

        N)rH�
set_option)r�r�r�s   rLr�zCoverage.set_option�s"��<	
����{�E�2�2�2�2�2rVc�~�|���|j�|j���|jjo)t
j�|jj��}|s|�	d���|�
��|s$|j�J�|j���dSdS)z;Load previously-collected coverage data from the data file.N��suffix)
r�r��resetrHrrry�path�existsrW�
_init_datar�r��read)r��should_skips  rL�loadz
Coverage.load�s����
�
�����?�&��O�!�!�#�#�#��k�*�X�2�7�>�>�$�+�BW�3X�3X�/X���	)��O�O�4�O�(�(�(��������	��:�)�)�)��J�O�O������	�	rVc
�r�|jjpg}d|vr5|jj�td���t	|jj���|jj}|r|dkrg}n!|dkr	tg}ntd|�����|�d�|jj	D����t|��}t|j|j
||j|jj|jj|j|�	��|_|j}|rt)|t*��sd
}n8|jjr*|�d
}n't)|t*��st/|��}nd}|�|��|j�J�|j�|j|jj��|jjr�|jjs}|�d�d�d
�|jjD����|j� ������|jjD]	}d|_!�
tE|j|j|j#�$d��r|j#nd|jj%���|_&|j|j&_'|jj(|j&_)d
|_*tWj,|j-��|jj.rat_j0��t_j1��k}|r9tdj3s/tij4thj5|j6��|_7dSdSdSdS)zInitialization for start()r�Nz-multiprocessing requires a configuration file)�rcfile�none�
test_functionz*Don't understand dynamic_context setting: c3�$K�|]}|jV��dS�N)�dynamic_context��.0r�s  rL�	<genexpr>z+Coverage._init_for_start.<locals>.<genexpr>s6����!
�!
�'-�F�"�!
�!
�!
�!
�!
�!
rV)r��
check_include�should_start_context�file_mapperr_r`rqrjTz1Plugin file tracers ({}) aren't supported with {}z, c3�$K�|]}|jV��dSr�)r�r�s  rLr�z+Coverage._init_for_start.<locals>.<genexpr>-s9������ &��4������rVFr�)rHrqri�include_namespace_packages)8rHrjrar r1r�r�extendr��context_switchersrrr�r�r�r_r`r�r�r~rxr�rrr^r�r��use_datarl�file_tracers�supports_plugins�format�join�tracer_name�_coverage_enabledr)r�r�r�r�r��file_disposition_class�
disp_classr��atexit�register�_atexit�sigterm�	threading�current_thread�main_threadr�WINDOWS�signal�SIGTERM�_on_sigtermr�)r�rj�dyconr�r�r�r��is_mains        rL�_init_for_startzCoverage._init_for_start�s}��"&��!8�!>�B����+�+��{�&�.�!�"Q�R�R�R�!���)@�A�A�A�A���+���	V����� "���
�o�
%�
%�!C� D����T�5�T�T�U�U�U�� � �!
�!
�15��1P�!
�!
�!
�	
�	
�	
� 9�9J�K�K��#��+��6�!5��)��+�#��;�%���#�	
�	
�	
����,���
	��f�c�*�*�
����
�[�
!�	��~�������,�,�
&��f������F���������z�%�%�%��� � ���T�[�-@�A�A�A��=�%�	1�d�o�.N�	1��J�J�C�J�J��I�I���*.�-�*D�������O�/�/�1�1���
�
�
��-�4�
1�
1��+0��(�(� ��;���"&�+�"4�"4�W�"=�"=�G�4�;�;�4�'+�{�'M�	
�
�
��
�!%�
��
��#'�?�#I��
� �$(�� �	����%�%�%��;��	� �/�1�1�Y�5J�5L�5L�L�G��
�s�{�
�%+�M��N�D�$4�%�%��!�!�!�
	�	�
�
�
�
rVr�c��|j�Mt|jj��t	|jj||j|j|j���|_dSdS)z,Create a data file if we don't have one yet.N)�basenamer�rqri�no_disk)r�r/rHrWrr�r�rw)r�r�s  rLr�zCoverage._init_dataPs[���:��
 ��� 5�6�6�6�%���.���Z��k��
����D�J�J�J��rVc���|���|jsd|_|���|���|j�J�|j�J�|j���|jr|j���|j	r|�
��|j���d|_|j
�|��dS)aaStart measuring code coverage.

        Coverage measurement only occurs in functions called after
        :meth:`start` is invoked.  Statements in the same scope as
        :meth:`start` won't be measured.

        Once you invoke :meth:`start`, you must also call :meth:`stop`
        eventually, or your process might not shut down cleanly.

        TN)r�r�rr�r�r��warn_conflicting_settingsr��warn_already_imported_filesr|r��startr�rPr�r�s rLrzCoverage.start_s���	
�
�
�����%�	#�%)�D�"�� � �"�"�"���������*�*�*��}�(�(�(�	
�
�/�/�1�1�1��(�	8��M�5�5�7�7�7��?�	��I�I�K�K�K����������
�����t�$�$�$�$�$rVc���|jr(|jd|ur|j���|jr"|j�J�|j���d|_dS)zStop measuring code coverage.rSNF)rP�popr�r��stopr�s rLrz
Coverage.stop�si���?�	&���r�"�d�*�*���#�#�%�%�%��=�	#��?�.�.�.��O� � �"�"�"���
�
�
rVr�eventc��|j�d��r3|j�|�dtj���d|����|jr|���|js|dkr|���dSdS)zClean up on process shutdown.�processz: pid: z, instance: rN)	r�r�r�ryr�r�rr}�save)r�rs  rLrzCoverage._atexit�s����;���i�(�(�	R��K����P�P�r�y�{�{�P�P��P�P�Q�Q�Q��=�	��I�I�K�K�K��?�	�e�y�0�0��I�I�K�K�K�K�K�1�0rV�
signum_unusedr��frame_unused�Optional[FrameType]c���|�d��tjtj|j��t	jt	j��tj��dS)zA handler for signal.SIGTERM.rN)rr
rr�ry�killr�)r�r!r"s   rLrzCoverage._on_sigterm�sM�����Y����	�
�f�n�d�&7�8�8�8�
���	���V�^�,�,�,�,�,rVc�:�|���|���|j�|j���|�d���|j�J�|j�|jj���d|_d|_	dS)z�Erase previously collected coverage data.

        This removes the in-memory data collected in this session as well as
        discarding the data file.

        Nr�)rrF)
r�r�r�r�r�r��eraserHrrr�r�s rLr'zCoverage.erase�s���	
�
�
�����������?�&��O�!�!�#�#�#����t��$�$�$��z�%�%�%��
���$�+�"6��7�7�7���
�!&����rV�new_contextc��|jstd���|j�J�|jjr|�ddd���|j�|��dS)a�Switch to a new dynamic context.

        `new_context` is a string to use as the :ref:`dynamic context
        <dynamic_contexts>` label for collected data.  If a :ref:`static
        context <static_contexts>` is in use, the static and dynamic context
        labels will be joined together with a pipe character.

        Coverage collection must be started already.

        .. versionadded:: 5.0

        z.Cannot switch context, coverage is not startedNzConflicting dynamic contextszdynamic-conflictT)r�r�)r�r!r�r�r��switch_context)r�r(s  rLr*zCoverage.switch_context�sq���}�	V�#�$T�U�U�U���*�*�*��?�/�	[��J�J�5�<N�UY�J�Z�Z�Z���&�&�{�3�3�3�3�3rV�exclude�whichc��|���t|j|dzg��|���dS)zClear the exclude list.�_listN)r��setattrrH�_exclude_regex_stale�r�r,s  rL�
clear_excludezCoverage.clear_exclude�s?���
�
�������U�W�_�b�1�1�1��!�!�#�#�#�#�#rV�regexc��|���t|j|dz��}|�|��|���dS)a|Exclude source lines from execution consideration.

        A number of lists of regular expressions are maintained.  Each list
        selects lines that are treated differently during reporting.

        `which` determines which list is modified.  The "exclude" list selects
        lines that are not considered executable at all.  The "partial" list
        indicates lines with branches that are not taken.

        `regex` is a regular expression.  The regex is added to the specified
        list.  If any of the regexes in the list is found in a line, the line
        is marked for special treatment during reporting.

        r.N)r��getattrrHr�r0)r�r3r,�	excl_lists    rLr+zCoverage.exclude�sR��	
�
�
�����D�K����9�9�	���������!�!�#�#�#�#�#rVc�8�|j���dS)z=Drop all the compiled exclusion regexes, a list was modified.N)r��clearr�s rLr0zCoverage._exclude_regex_stale�s������ � � � � rVc��||jvr/t|j|dz��}t|��|j|<|j|S)z3Return a regex string for the given exclusion list.r.)r�r5rHr-)r�r,r6s   rL�_exclude_regexzCoverage._exclude_regex�sH����(�(�(����U�W�_�=�=�I�&0��&;�&;�D��U�#����&�&rV�	List[str]c��|���tttt	|j|dz����S)z�Return a list of excluded regex strings.

        `which` indicates which list is desired.  See :meth:`exclude` for the
        lists that are available, and their meaning.

        r.)r�rrr�r5rHr1s  rL�get_exclude_listzCoverage.get_exclude_list�s5��	
�
�
�����D��I�w�t�{�E�G�O�D�D�E�E�ErVc�V�|���}|���dS)z2Save the collected coverage data to the data file.N)�get_datar�)r��datas  rLr z
Coverage.save�s ���}�}�����
�
�����rVr$c� �t|j�d��r|jjnd|jj���}|jj���D]-}|d}|dd�D]}|�||����.|S)z,Create a PathAliases from our configuration.�pathmapN)�debugfn�relativer�)	r$r�r�r�rHr��paths�values�add)r��aliasesrF�result�patterns     rL�
_make_aliaseszCoverage._make_aliases�s����*.�+�*<�*<�Y�*G�*G�Q�T�[�&�&�T��[�/�
�
�
���[�&�-�-�/�/�	-�	-�E��1�X�F� ����9�
-�
-�����G�V�,�,�,�,�
-��rV�
data_paths�strict�keepc��|���|�d���|���|���|j�J�t|j|���||||j���dS)a�Combine together a number of similarly-named coverage data files.

        All coverage data files whose name starts with `data_file` (from the
        coverage() constructor) will be read, and combined together into the
        current measurements.

        `data_paths` is a list of files or directories from which data should
        be combined. If no list is passed, then the data files from the
        directory indicated by the current data file (probably the current
        directory) will be combined.

        If `strict` is true, then it is an error to attempt to combine when
        there are no data files to combine.

        If `keep` is true, then original input data files won't be deleted.

        .. versionadded:: 4.0
            The `data_paths` parameter.

        .. versionadded:: 4.3
            The `strict` parameter.

        .. versionadded: 5.5
            The `keep` parameter.
        Nr�)rIrMrNrO�message)r�r�r�r?r�rrLr�)r�rMrNrOs    rL�combinezCoverage.combines���>	
�
�
�������t��$�$�$��������
�
�����z�%�%�%���J��&�&�(�(�!����M�
	
�	
�	
�	
�	
�	
rVrc�\�|���|�d���|���|j�X|jD]#}|js|j�|���$|j���r|���|j	�J�|j	S)z�Get the collected data.

        Also warn about various problems collecting data.

        Returns a :class:`coverage.CoverageData`, the collected coverage data.

        .. versionadded:: 4.0

        Nr�)
r�r�r�r�r�r�plugin_was_disabled�
flush_data�_post_save_workr�r�s  rLr?zCoverage.get_data2s���	
�
�
�������t��$�$�$��������?�&��-�
@�
@���/�@��O�7�7��?�?�?����)�)�+�+�
'��$�$�&�&�&��z�%�%�%��z�rVc���|j�J�|j�J�|jr|j���|js|jr|�dd���t
jt��}|j�	��D]5\}}|�
|��}||�|���6|���D] \}}|j�
||���!dS)z�After saving data, look for warnings, post-work, etc.

        Warn about things that should have happened but didn't.
        Look for un-executed files.

        NzNo data was collected.zno-data-collected)r�)r�r�r��warn_unimported_sourcerr��collections�defaultdictr��find_possibly_unexecuted_filesr�r��items�touch_files)r��
file_paths�	file_path�plugin_namerFs     rLrVzCoverage._post_save_workKs���z�%�%�%��}�(�(�(��'�	3��M�0�0�2�2�2��z�	K�d�0�	K��J�J�/�6I�J�J�J�J�!�,�T�2�2�
�&*�m�&R�&R�&T�&T�	6�	6�"�I�{��)�)�)�4�4�I��{�#�*�*�9�5�5�5�5�",�"2�"2�"4�"4�	7�	7��K���J�"�"�5�+�6�6�6�6�	7�	7rV�morfr?�-Tuple[str, List[TLineNo], List[TLineNo], str]c�D�|�|��\}}}}}||||fS)z:Like `analysis2` but doesn't return excluded line numbers.)�	analysis2)r�ra�f�s�_�m�mfs       rL�analysiszCoverage.analysishs+������-�-���1�a��B��!�Q��{�rV�<Tuple[str, List[TLineNo], List[TLineNo], List[TLineNo], str]c���|�|��}|jt|j��t|j��t|j��|���fS)aGAnalyze a module.

        `morf` is a module or a file name.  It will be analyzed to determine
        its coverage statistics.  The return value is a 5-tuple:

        * The file name for the module.
        * A list of line numbers of executable statements.
        * A list of line numbers of excluded statements.
        * A list of line numbers of statements not run (missing from
          execution).
        * A readable formatted string of the missing line numbers.

        The analysis uses the source file itself and the current measured
        coverage data.

        )�_analyzer��sorted�
statements�excluded�missing�missing_formatted)r�rarjs   rLrdzCoverage.analysis2ms^��(�=�=��&�&�����8�&�'�'��8�$�%�%��8�#�$�$��&�&�(�(�
�	
rV�it�Union[FileReporter, TMorf]r7c��|���|���|���}t|t��r|}n|�|��}t
||jj||j	��S)zTAnalyze a single morf or code unit.

        Returns an `Analysis` object.

        )
r�r�r?rxr2�_get_file_reporterr7rH�	precisionr�)r�rsr@�frs    rLrmzCoverage._analyze�sv��	
�
�
�����������}�}�����b�,�'�'�	-��B�B��(�(��,�,�B���d�k�3�R��9J�K�K�KrVr2c��|j�J�d}d}t|t��r�|�|��}|j�|��}|r[|j�|��}|r?|�|��}|�(td�	|j
|�����|dkrt||��}t|t��sJ�|S)z-Get a FileReporter for a module or file name.N�pythonz5Plugin {!r} did not provide a file reporter for {!r}.)
r�rxr�r��file_tracerr��get�
file_reporterr#r�r�r4r2)r�rar�r}�mapped_morfr`s      rLrvzCoverage._get_file_reporter�s����z�%�%�%���2:�
��d�C� � �
	��+�+�D�1�1�K��*�0�0��=�=�K��

���*�*�;�7�7����$*�$8�$8��$E�$E�M�$�,�)�S�Z�Z� &� <�d�������H�$�$�.�t�T�:�:�M��-��6�6�6�6�6��rV�morfs�Optional[Iterable[TMorf]]�List[FileReporter]c����j�J�|s�j���}t|ttt
f��s|g}�fd�|D��}|S)a�Get a list of FileReporters for a list of modules or file names.

        For each module or file name in `morfs`, find a FileReporter.  Return
        the list of FileReporters.

        If `morfs` is a single module or file name, this returns a list of one
        FileReporter.  If `morfs` is empty or None, then the list of all files
        measured is used to find the FileReporters.

        Nc�:��g|]}��|����SrG)rv)r�rar�s  �rL�
<listcomp>z0Coverage._get_file_reporters.<locals>.<listcomp>�s'���J�J�J�D�$�1�1�$�7�7�J�J�JrV)r��measured_filesrxr��tuple�set)r�r�file_reporterss`  rL�_get_file_reporterszCoverage._get_file_reporters�so����z�%�%�%��	0��J�-�-�/�/�E��%�$��s�!3�4�4�	��G�E�J�J�J�J�E�J�J�J���rVc���|jjrZt|j|jd���}|j�.|�|j|������||_dSdS)zARe-map data before reporting, to get implicit "combine" behavior.T)rqrirN)rI)rHrFrr�r�r��updaterL)r��mapped_datas  rL�_prepare_data_for_reportingz$Coverage._prepare_data_for_reporting�sl���;��	%�&�D�J�d�k�SW�X�X�X�K��z�%��"�"�4�:�t�7I�7I�7K�7K�"�L�L�L�$�D�J�J�J�		%�	%rV�show_missing�
ignore_errors�file�Optional[IO[str]]�Optional[Union[str, List[str]]]�skip_covered�contexts�Optional[List[str]]�
skip_emptyrw�
Optional[int]�sort�
output_format�floatc

���|���t||||||||	|
||���5t|��}
|
�||���cddd��S#1swxYwYdS)aWrite a textual summary report to `file`.

        Each module in `morfs` is listed, with counts of statements, executed
        statements, missing statements, and a list of lines missed.

        If `show_missing` is true, then details of which lines or branches are
        missing will be included in the report.  If `ignore_errors` is true,
        then a failure while reporting a single file will not stop the entire
        report.

        `file` is a file-like object, suitable for writing.

        `output_format` determines the format, either "text" (the default),
        "markdown", or "total".

        `include` is a list of file name patterns.  Files that match will be
        included in the report. Files matching `omit` will not be included in
        the report.

        If `skip_covered` is true, don't report on files with 100% coverage.

        If `skip_empty` is true, don't report on empty files (those that have
        no statements).

        `contexts` is a list of regular expression strings.  Only data from
        :ref:`dynamic contexts <dynamic_contexts>` that match one of those
        expressions (using :func:`re.search <python:re.search>`) will be
        included in the report.

        `precision` is the number of digits to display after the decimal
        point for percentages.

        All of the arguments default to the settings read from the
        :ref:`configuration file <config>`.

        Returns a float, the total percentage covered.

        .. versionadded:: 4.0
            The `skip_covered` parameter.

        .. versionadded:: 5.0
            The `contexts` and `skip_empty` parameters.

        .. versionadded:: 5.2
            The `precision` parameter.

        .. versionadded:: 7.0
            The `format` parameter.

        )
r�rurvr�r��report_contextsr�rwr�r�)�outfileN)r�rMr5�report)r�rr�r�r�rfrhr�r�r�rwr�r��reporters              rLr�zCoverage.report�s���B	
�(�(�*�*�*�
��'��"�%�%�$�!��� �
�
�
�	8�	8�'�t�,�,�H��?�?�5�$�?�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8�	8�	8s�&A"�"A&�)A&�	directoryc��td��td��|���t|||||���5t|��}|�||���ddd��dS#1swxYwYdS)aDAnnotate a list of modules.

        .. note::

            This method has been obsoleted by more modern reporting tools,
            including the :meth:`html_report` method.  It will be removed in a
            future version.

        Each module in `morfs` is annotated.  The source is written to a new
        file, named with a ",cover" suffix, with each line prefixed with a
        marker to indicate the coverage of the line.  Covered lines have ">",
        excluded lines have "-", and missing lines have "!".

        See :meth:`report` for other arguments.

        z9The annotate command will be removed in a future version.z7Get in touch if you still use it: ned@nedbatchelder.com)r�rurvr�)r�N)r�r�rMrr�)r�rr�r�rfrhr�r�s        rL�annotatezCoverage.annotate's���2	�I�J�J�J�
�G�H�H�H��(�(�*�*�*�
��'��"�$�
�
�
�	8�	8�(��-�-�H��O�O�E�Y�O�7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8�	8�	8s�'A;�;A?�A?�	extra_css�title�
show_contextsc
���|���t|||||||||	|
||���5t|��}
|
�|��}|cddd��S#1swxYwYdS)aEGenerate an HTML report.

        The HTML is written to `directory`.  The file "index.html" is the
        overview starting point, with links to more detailed pages for
        individual modules.

        `extra_css` is a path to a file of other CSS to apply on the page.
        It will be copied into the HTML directory.

        `title` is a text string (not HTML) to use as the title of the HTML
        report.

        See :meth:`report` for other arguments.

        Returns a float, the total percentage covered.

        .. note::

            The HTML report files are generated incrementally based on the
            source files and coverage results. If you modify the report files,
            the changes will not be considered.  You should be careful about
            changing the files in the report folder.

        )r�rurv�html_dirr��
html_title�html_skip_coveredr�r��html_skip_emptyrwN)r�rMr(r�)r�rr�r�rfrhr�r�r�r�r�r�rwr��rets               rL�html_reportzCoverage.html_reportNs���N	
�(�(�*�*�*�
��'��"����*�'�$�&��

�

�

�	�	�$�D�)�)�H��/�/�%�(�(�C��!	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�&A#�#A'�*A'r�c	���|���t|||||||���5t|jjt|��||j��cddd��S#1swxYwYdS)abGenerate an XML report of coverage results.

        The report is compatible with Cobertura reports.

        Each module in `morfs` is included in the report.  `outfile` is the
        path to write the file to, "-" will write to stdout.

        See :meth:`report` for other arguments.

        Returns a float, the total percentage covered.

        )r�rurv�
xml_outputr�r�N)r�rMr6rHr�r@r�)r�rr�r�rfrhr�r�s        rL�
xml_reportzCoverage.xml_report�s���,	
�(�(�*�*�*�
��'��"��$�!�
�
�
�		b�		b�!���!7��T�9J�9J�E�SW�S`�a�a�		b�		b�		b�		b�		b�		b�		b�		b�		b�		b�		b�		b����		b�		b�		b�		b�		b�		bs�.A&�&A*�-A*�pretty_printc	
���|���t||||||||���5t|jjt|��||j��cddd��S#1swxYwYdS)a�Generate a JSON report of coverage results.

        Each module in `morfs` is included in the report.  `outfile` is the
        path to write the file to, "-" will write to stdout.

        `pretty_print` is a boolean, whether to pretty-print the JSON output or not.

        See :meth:`report` for other arguments.

        Returns a float, the total percentage covered.

        .. versionadded:: 5.0

        )r�rurv�json_outputr��json_pretty_print�json_show_contextsN)r�rMr6rHr�r*r�)	r�rr�r�rfrhr�r�r�s	         rL�json_reportzCoverage.json_report�s���2	
�(�(�*�*�*�
��'��"��$�*�,�	
�	
�	
�
	d�
	d�!���!8�,�t�:L�:L�e�UY�Ub�c�c�
	d�
	d�
	d�
	d�
	d�
	d�
	d�
	d�
	d�
	d�
	d�
	d����
	d�
	d�
	d�
	d�
	d�
	ds�.A'�'A+�.A+c���|���t||||||���5t|jjt|��||j��cddd��S#1swxYwYdS)aGenerate an LCOV report of coverage results.

        Each module in `morfs` is included in the report. `outfile` is the
        path to write the file to, "-" will write to stdout.

        See :meth:`report` for other arguments.

        .. versionadded:: 6.3
        )r�rurv�lcov_outputr�N)r�rMr6rHr�r+r�)r�rr�r�rfrhr�s       rL�lcov_reportzCoverage.lcov_report�s���$	
�(�(�*�*�*�
��'��"��$�

�
�
�	d�	d�!���!8�,�t�:L�:L�e�UY�Ub�c�c�	d�	d�	d�	d�	d�	d�	d�	d�	d�	d�	d�	d����	d�	d�	d�	d�	d�	ds�.A%�%A)�,A)�Iterable[Tuple[str, Any]]c��ddl}|���|���d'd�}d|jfd	|jfd
|j�|j���ndfdtrd
ndfd||jj	��fd||jj
��fd||jj��fd|jj
fd|jjfd|jjfd|jjrt#|jj��ndfd|j�|j���ndfdt(j�dd��fdt/j��fdt/j��fdt(jfdt)j��fdt)j��fdt9j��fd t9j��fd!t(jfd"d#�tAt8j!��D��fd$d%�"tGt(d&dg����fg}|j$�,|�%|j$�&����|�%tOj&����|S)(zAReturn a list of (key, value) pairs showing internal information.rNr��	List[Any]rDr;c�d�g}|D]*}|j}|js|dz
}|�|���+|S)z7Make an entry for the sys_info from a list of plug-ins.z (disabled))r�rr�)r��entriesr��entrys    rL�plugin_infoz&Coverage.sys_info.<locals>.plugin_info�sM���G�!�
&�
&���4���/�+��]�*�E����u�%�%�%�%��NrV�coverage_version�coverage_module�tracerz-none-�CTracer�	available�unavailablezplugins.file_tracerszplugins.configurerszplugins.context_switchers�configs_attempted�configs_readra�config_contentsrWrz�
��platform�implementation�
executable�def_encoding�fs_encodingr��cwdr��environmentc�"�g|]\}}|�d|����
S)z = rG)r��k�vs   rLr�z%Coverage.sys_info.<locals>.<listcomp>s&��_�_�_�d�a���\�\�a�\�\�_�_�_rV�command_line� �argv)r�r�rDr;)(�coverager�r��__version__�__file__r�rrr�r�r�r�rH�attempted_config_files�config_files_readra�_config_contents�reprr��
data_filenamer��version�replacer��python_implementationr��getdefaultencoding�getfilesystemencodingryr��getcwdr�r�environrr5r�r�r�r)r��covmodr�r�s    rLr�zCoverage.sys_info�sj��	"�!�!�!��
�
����������	�	�	�	� ��!3�4�
���0�
���8S�t��2�2�4�4�4�Ya�b�
�{�E���
�F�
#�[�[���1K�%L�%L�M�
"�K�K��
�0I�$J�$J�K�
(�+�+�d�m�6U�*V�*V�W�
 �$�+�"D�E�
�T�[�:�;�
�D�K�3�4�
�6:�k�6R�`��T�[�1�2�2�2�X`�
���
�8N�$�*�2�2�4�4�4�T\�]�
�s�{�*�*�4��4�4�5�
��*�,�,�-�
�x�=�?�?�@�
�3�>�*�
�S�3�5�5�6�
�C�5�7�7�8�
�B�I�K�K� �
�B�I�K�K� �
�S�X��
�_�_�6R�SU�S]�6^�6^�_�_�_�`�
�S�X�X�g�c�6�H�:�&F�&F�G�G�H�3
��8�=�$��K�K��
�.�.�0�0�1�1�1����L�)�+�+�,�,�,��rV�rDrQ)"rWrXrYrZr[r\r]r^r_r\r`r\rarbrcrdrerdrfrgrhrgrirdrjrgrkr^rlrmrnr^rDro�rDro)r�r�r�rrDr=)r�r�r�rrDr^)NF)r�r�r�rmr�r^rDro)r�r�rDro)r�r�rDr�)r�r�r�r�rDro)r�rZrDro)r)rr�rDro)r!r�r"r#rDro)r(r�rDro)r+)r,r�rDro)r3r�r,r�rDro)r,r�rDr�)r,r�rDr;)rDr$)NFF)rMrdrNr^rOr^rDro)rDr)rar?rDrb)rar?rDrk)rsrtrDr7)rar?rDr2r�)rr�rDr�)NNNNNNNNNNNN)rr�r�r\r�r\r�r�rfr�rhr�r�r\r�r�r�r\rwr�r�rmr�rmrDr�)NNNNNN)rr�r�rmr�r\rfr�rhr�r�r�rDro)rr�r�rmr�r\rfr�rhr�r�rmr�rmr�r\r�r\r�r�r�r\rwr�rDr�)NNNNNNN)rr�r�rmr�r\rfr�rhr�r�r�r�r\rDr�)NNNNNNNN)rr�r�rmr�r\rfr�rhr�r�r�r�r\r�r\rDr�)rr�r�rmr�r\rfr�rhr�r�r�rDr�)rDr�)3�__name__�
__module__�__qualname__�__doc__rP�__annotations__�classmethodrU�DEFAULT_DATAFILEr�r�r�r�r�r�r�r�r�r�r�rr�rrrrr'r*r2r+r0r:r=r rLrRr?rVrjrdrmrvr�r�r�r�r�r�r�r�r�rGrVrLrBrBNs����������*"$�J�#�#�#�#������[��>N�26�&*�� $�!%�-1�*.�/3�48�7;�)-�;?�"'�!%��#y/�y/�y/�y/�y/�v%H�%H�%H�%H�N	S�	S�	S�	S�?�?�?�?�0
�
�
�
�����"-�-�-�-�-�6����
3�3�3�3�$3�3�3�3�@����Y�Y�Y�Y�v
�
�
�
�!%�!%�!%�!%�F���������-�-�-�-�'�'�'�'�"4�4�4�4�,$�$�$�$�$�$�$�$�$�$�(!�!�!�!�'�'�'�'�F�F�F�F�F�����

�
�
�
�/3���	,
�,
�,
�,
�,
�\����27�7�7�7�:����

�
�
�
�:L�L�L�L�$����6�����,%�%�%�%�,0�'+�(,�"&�04�37�'+�(,�%)�#'�"�'+�P8�P8�P8�P8�P8�h,0�#'�(,�04�37�(,�%8�%8�%8�%8�%8�R,0�#'�(,�04�37�#'�#�'+�(,�(,�%)�#'�8�8�8�8�8�x,0�!%�(,�04�37�(,�%)� b� b� b� b� b�H,0�!%�(,�04�37�(,�'+�(,�$d�$d�$d�$d�$d�P,0�!%�(,�04�37�(,�d�d�d�d�d�:3�3�3�3�3�3rV�COVERAGE_DEBUG_CALLS)�decorate_methods�
show_callsT)�	show_argsr?)�butnotrQc��tj�d��}|sdSttd��rdSt|���}|t_d|_d|_d|_	d|_
|���|S)a�Call this at Python start-up to perhaps measure coverage.

    If the environment variable COVERAGE_PROCESS_START is defined, coverage
    measurement is started.  The value of the variable is the config file
    to use.

    There are two ways to configure your Python installation to invoke this
    function when Python starts:

    #. Create or append to sitecustomize.py to add these lines::

        import coverage
        coverage.process_startup()

    #. Create a .pth file in your Python installation containing::

        import coverage; coverage.process_startup()

    Returns the :class:`Coverage` instance that was started, or None if it was
    not started by this call.

    �COVERAGE_PROCESS_STARTNr�)raFT)ryr�r|�hasattr�process_startuprBr�rr�r�r}r)�cpsrAs  rLr�r�.s���.
�*�.�.�1�
2�
2�C����t���
�+�+���t�
�s�
#�
#�
#�C�"�O���C��"'�C��#(�C� ��C�N��I�I�K�K�K��JrVroc�H�ttdd��}|�	d|_dSdS)z7Stop any subprocess auto-measurement from writing data.r�NF)r5r�r})�auto_created_coverages rLr�r�cs1��#�O�Z��F�F���(�+0��(�(�(�)�(rV)rArBrCr;rDrEr�r�)qr��
__future__rrrY�
contextlibry�os.pathr�r
r�r	r�r��typesr�typingrrrrr	r
rrr
rrr�r�coverage.annotater�coverage.collectorrr�coverage.configrr�coverage.contextrr�
coverage.datarr�coverage.debugrrrrr�coverage.dispositionr�coverage.exceptionsr r!r"r#�coverage.filesr$r%r&r'�
coverage.htmlr(�coverage.inoroutr)�coverage.jsonreportr*�coverage.lcovreportr+�
coverage.miscr,r-r.r/r0�coverage.multiprocr1�coverage.pluginr2�coverage.plugin_supportr3�coverage.pythonr4�coverage.reportr5�coverage.report_corer6�coverage.resultsr7�coverage.typesr8r9r:r;r<r=r>r?�coverage.xmlreportr@�contextmanagerrMr��_DEFAULT_DATAFILErBr�r�r|r�r�r�r�rGrVrL�<module>rs���*�)�"�"�"�"�"�"�
�
�
�
���������	�	�	�	���������
�
�
�
�
�
�
�
���������������������������������������������
������.�.�.�.�.�.�5�5�5�5�5�5�5�5�@�@�@�@�@�@�@�@�Z�Z�Z�Z�Z�Z�Z�Z�=�=�=�=�=�=�=�=���������������7�6�6�6�6�6�\�\�\�\�\�\�\�\�\�\�\�\�[�[�[�[�[�[�[�[�[�[�[�[�&�&�&�&�&�&�$�$�$�$�$�$�,�,�,�,�,�,�,�,�,�,�,�,�2�2�2�2�2�2�2�2�K�K�K�K�K�K�K�K�K�K�4�4�4�4�4�4�(�(�(�(�(�(�+�+�+�+�+�+�.�.�.�.�.�.�+�+�+�+�+�+�.�.�.�.�.�.�%�%�%�%�%�%���������������������+�*�*�*�*�*��^�B������%�%�%���%� �<�	�*�*��$��R�R�R�R�R�}�R�R�R�n&�3�r�z�~�~�,�a�0�0�1�1��;�;�;�;�;�;�;�;�����
�T�"�"�"��|�������H�2�2�2�2�j1�1�1�1�1�1rV