$97 GRAYBYTE WORDPRESS FILE MANAGER $39

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.216.39
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/coverage/__pycache__/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/coverage/__pycache__//numbits.cpython-311.pyc
�

�|oi=��z�dZddlmZddlZddlZddlmZddlmZm	Z	dd
�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zd d�ZdS)!a�
Functions to manipulate packed binary representations of number sets.

To save space, coverage stores sets of line numbers in SQLite using a packed
binary representation called a numbits.  A numbits is a set of positive
integers.

A numbits is stored as a blob in the database.  The exact meaning of the bytes
in the blobs should be considered an implementation detail that might change in
the future.  Use these functions to work with those binary blobs of data.

�)�annotationsN)�zip_longest)�Iterable�List�nums�
Iterable[int]�return�bytesc���	t|��dzdz}n#t$rYdSwxYwt|��}|D]}||dzxxd|dzzzcc<�t|��S)z�Convert `nums` into a numbits.

    Arguments:
        nums: a reusable iterable of integers, the line numbers to store.

    Returns:
        A binary blob.
    ���)�max�
ValueError�	bytearrayr
)r�nbytes�b�nums    �d/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib64/python3.11/site-packages/coverage/numbits.py�nums_to_numbitsrs�����T���a��!�#���������s�s�����	�&���A��"�"��	�#�q�&�	�	�	�Q�#��'�\�!�	�	�	�	���8�8�Os��
&�&�numbits�	List[int]c��g}t|��D]:\}}td��D]%}|d|zzr|�|dz|z���&�;|S)a$Convert a numbits into a list of numbers.

    Arguments:
        numbits: a binary blob, the packed number set.

    Returns:
        A list of ints.

    When registered as a SQLite function by :func:`register_sqlite_functions`,
    this returns a string, a JSON-encoded list of ints.

    rr
)�	enumerate�range�append)rr�byte_i�byte�bit_is     r�numbits_to_numsr .sr���D�!�'�*�*�0�0�����1�X�X�	0�	0�E���U�
�#�
0����F�Q�J��.�/�/�/��	0��Kr�numbits1�numbits2c�X�t||d���}td�|D����S)zsCompute the union of two numbits.

    Returns:
        A new numbits, the union of `numbits1` and `numbits2`.
    r��	fillvaluec3�&K�|]\}}||zV��
dS�N���.0�b1�b2s   r�	<genexpr>z numbits_union.<locals>.<genexpr>Js*����2�2�V�R���b��2�2�2�2�2�2r)rr
�r!r"�
byte_pairss   r�
numbits_unionr0Cs5���X�x�1�=�=�=�J��2�2�z�2�2�2�2�2�2rc��t||d���}td�|D����}|�d��S)z~Compute the intersection of two numbits.

    Returns:
        A new numbits, the intersection `numbits1` and `numbits2`.
    rr$c3�&K�|]\}}||zV��
dSr'r(r)s   rr-z'numbits_intersection.<locals>.<genexpr>Ts*����@�@�6�2�r�r�B�w�@�@�@�@�@�@r�)rr
�rstrip)r!r"r/�intersection_bytess    r�numbits_intersectionr6MsI���X�x�1�=�=�=�J��@�@�Z�@�@�@�@�@���$�$�U�+�+�+r�boolc�X�t||d���}td�|D����S)a
Is there any number that appears in both numbits?

    Determine whether two number sets have a non-empty intersection. This is
    faster than computing the intersection.

    Returns:
        A bool, True if there is any number in both `numbits1` and `numbits2`.
    rr$c3�&K�|]\}}||zV��
dSr'r(r)s   rr-z+numbits_any_intersection.<locals>.<genexpr>bs*����0�0�6�2�r�r�B�w�0�0�0�0�0�0r)r�anyr.s   r�numbits_any_intersectionr;Xs5���X�x�1�=�=�=�J��0�0�Z�0�0�0�0�0�0rr�intc��t|d��\}}|t|��krdSt||d|zz��S)zvDoes the integer `num` appear in `numbits`?

    Returns:
        A bool, True if `num` is a member of `numbits`.
    rFr
)�divmod�lenr7)rr�nbyte�nbits    r�num_in_numbitsrBesF����a�.�.�K�E�4���G������u�����!�t�)�,�-�-�-r�
connection�sqlite3.Connection�Nonec��|�ddt��|�ddt��|�ddt��|�ddt��|�ddd���d	S)
a�
    Define numbits functions in a SQLite connection.

    This defines these functions for use in SQLite statements:

    * :func:`numbits_union`
    * :func:`numbits_intersection`
    * :func:`numbits_any_intersection`
    * :func:`num_in_numbits`
    * :func:`numbits_to_nums`

    `connection` is a :class:`sqlite3.Connection <python:sqlite3.Connection>`
    object.  After creating the connection, pass it to this function to
    register the numbits functions.  Then you can use numbits functions in your
    queries::

        import sqlite3
        from coverage.numbits import register_sqlite_functions

        conn = sqlite3.connect("example.db")
        register_sqlite_functions(conn)
        c = conn.cursor()
        # Kind of a nonsense query:
        # Find all the files and contexts that executed line 47 in any file:
        c.execute(
            "select file_id, context_id from line_bits where num_in_numbits(?, numbits)",
            (47,)
        )
    r0�r6r;rBr r
c�D�tjt|����Sr')�json�dumpsr )rs r�<lambda>z+register_sqlite_functions.<locals>.<lambda>�s��t�z�/�Z[�J\�J\�?]�?]�rN)�create_functionr0r6r;rB)rCs r�register_sqlite_functionsrMqs���<�����=�A�A�A����5�q�:N�O�O�O����9�1�>V�W�W�W����/��N�C�C�C����0�!�5]�5]�^�^�^�^�^r)rrr	r
)rr
r	r)r!r
r"r
r	r
)r!r
r"r
r	r7)rr<rr
r	r7)rCrDr	rE)�__doc__�
__future__rrI�sqlite3�	itertoolsr�typingrrrr r0r6r;rBrMr(rr�<module>rSs�����#�"�"�"�"�"���������!�!�!�!�!�!�!�!�!�!�!�!�!�!�����(����*3�3�3�3�,�,�,�,�
1�
1�
1�
1�	.�	.�	.�	.�"_�"_�"_�"_�"_�"_r


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
11 Feb 2026 9.30 AM
root / root
0755
__init__.cpython-311.pyc
0.888 KB
20 Jan 2026 1.01 PM
root / root
0644
__main__.cpython-311.pyc
0.413 KB
20 Jan 2026 1.01 PM
root / root
0644
annotate.cpython-311.pyc
5.876 KB
20 Jan 2026 1.01 PM
root / root
0644
bytecode.cpython-311.pyc
1 KB
20 Jan 2026 1.01 PM
root / root
0644
cmdline.cpython-311.pyc
35.817 KB
20 Jan 2026 1.01 PM
root / root
0644
collector.cpython-311.pyc
21.254 KB
20 Jan 2026 1.01 PM
root / root
0644
config.cpython-311.pyc
24.999 KB
20 Jan 2026 1.01 PM
root / root
0644
context.cpython-311.pyc
3.369 KB
20 Jan 2026 1.01 PM
root / root
0644
control.cpython-311.pyc
58.777 KB
20 Jan 2026 1.01 PM
root / root
0644
data.cpython-311.pyc
10.505 KB
20 Jan 2026 1.01 PM
root / root
0644
debug.cpython-311.pyc
29.91 KB
20 Jan 2026 1.01 PM
root / root
0644
disposition.cpython-311.pyc
2.574 KB
20 Jan 2026 1.01 PM
root / root
0644
env.cpython-311.pyc
4.627 KB
20 Jan 2026 1.01 PM
root / root
0644
exceptions.cpython-311.pyc
3.023 KB
20 Jan 2026 1.01 PM
root / root
0644
execfile.cpython-311.pyc
13.976 KB
20 Jan 2026 1.01 PM
root / root
0644
files.cpython-311.pyc
24.895 KB
20 Jan 2026 1.01 PM
root / root
0644
html.cpython-311.pyc
32.326 KB
20 Jan 2026 1.01 PM
root / root
0644
inorout.cpython-311.pyc
26.482 KB
20 Jan 2026 1.01 PM
root / root
0644
jsonreport.cpython-311.pyc
6.289 KB
20 Jan 2026 1.01 PM
root / root
0644
lcovreport.cpython-311.pyc
6.843 KB
20 Jan 2026 1.01 PM
root / root
0644
misc.cpython-311.pyc
20.034 KB
20 Jan 2026 1.01 PM
root / root
0644
multiproc.cpython-311.pyc
5.571 KB
20 Jan 2026 1.01 PM
root / root
0644
numbits.cpython-311.pyc
6.956 KB
20 Jan 2026 1.01 PM
root / root
0644
parser.cpython-311.pyc
64.447 KB
20 Jan 2026 1.01 PM
root / root
0644
phystokens.cpython-311.pyc
8.55 KB
20 Jan 2026 1.01 PM
root / root
0644
plugin.cpython-311.pyc
23.021 KB
20 Jan 2026 1.01 PM
root / root
0644
plugin_support.cpython-311.pyc
19.213 KB
20 Jan 2026 1.01 PM
root / root
0644
python.cpython-311.pyc
11.627 KB
20 Jan 2026 1.01 PM
root / root
0644
pytracer.cpython-311.pyc
11.316 KB
20 Jan 2026 1.01 PM
root / root
0644
report.cpython-311.pyc
16.259 KB
20 Jan 2026 1.01 PM
root / root
0644
report_core.cpython-311.pyc
5.471 KB
20 Jan 2026 1.01 PM
root / root
0644
results.cpython-311.pyc
19.275 KB
20 Jan 2026 1.01 PM
root / root
0644
sqldata.cpython-311.pyc
75.263 KB
20 Jan 2026 1.01 PM
root / root
0644
templite.cpython-311.pyc
15.035 KB
20 Jan 2026 1.01 PM
root / root
0644
tomlconfig.cpython-311.pyc
11.708 KB
20 Jan 2026 1.01 PM
root / root
0644
types.cpython-311.pyc
8.786 KB
20 Jan 2026 1.01 PM
root / root
0644
version.cpython-311.pyc
1.586 KB
20 Jan 2026 1.01 PM
root / root
0644
xmlreport.cpython-311.pyc
14.494 KB
20 Jan 2026 1.01 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF