AlkantarClanX12

Your IP : 18.218.190.118


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

�

�܋f�����ddlZddlZddlZddlZddlmZddlmZmZm	Z	e
d��ZGd�d��Zed���d	e
d
ede
fd���Zed���d	e
d
ede
fd
���Zed���d	e
d
edefd���ZGd�d��ZGd�d��ZGd�d��ZGd�de��Zdedefd�Z	ddeee	efdedefd�Zdedefd�ZdS)�N)�	lru_cache)�List�Union�Iterable�\c��eZdZUdZgZeeed<gZeeed<dZ	e
d���Ze
d���Ze
d���Z
dS)	�__config_flagsz=Internal class for defining compatibility and debugging flags�
_all_names�_fixed_names�
configurationc
�b�||jvrctjd�|j||jt
t||�����������dS||j	vrt|||��dStd�|j|�����)Nz'{}.{} {} is {} and cannot be overriddenzno such {} {!r})r�warnings�warn�format�__name__�
_type_desc�str�getattr�upperr
�setattr�
ValueError)�cls�dname�values   �_/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pyparsing/util.py�_setz__config_flags._sets����C�$�$�$��M�9�@�@��L���N����U�+�+�,�,�2�2�4�4�	��
�
�
�
�F��C�N�"�"��C���&�&�&�&�&��.�5�5�c�n�e�L�L�M�M�M�c�.�|�|d��S)NT�r�r�names  r�<lambda>z__config_flags.<lambda>$s��3�8�8�D�$�+?�+?�rc�.�|�|d��S)NFrr s  rr"z__config_flags.<lambda>%s��C�H�H�T�5�,A�,A�rN)r�
__module__�__qualname__�__doc__r
rr�__annotations__rr�classmethodr�enable�disable�rrr	r	s��������G�G��J��S�	���� �L�$�s�)� � � � �J��N�N��[�N� �[�?�?�
@�
@�F��k�A�A�B�B�G�G�Grr	�)�maxsize�loc�strg�returnc��|}d|cxkrt|��krnn||dz
dkrdn||�dd|��z
S)a�
    Returns current column within a string, counting newlines as line separators.
    The first column is number 1.

    Note: the default parsing behavior is to expand tabs in the input string
    before starting the parsing process.  See
    :class:`ParserElement.parseString` for more
    information on parsing strings containing ``<TAB>`` s, and suggested
    methods to maintain a consistent view of the parsed string, the parse
    location, and line and column positions within the parsed string.
    r��
)�len�rfind)r.r/�ss   r�colr7(sc��	
�A��C� � � � �#�a�&�&� � � � � �Q�s�Q�w�Z�4�%7�%7�1�1�S�1�7�7�4�QR�TW�CX�CX�=X�Xrc�6�|�dd|��dzS)a�Returns current line number within a string, counting newlines as line separators.
    The first line is number 1.

    Note - the default parsing behavior is to expand tabs in the input string
    before starting the parsing process.  See :class:`ParserElement.parseString`
    for more information on parsing strings containing ``<TAB>`` s, and
    suggested methods to maintain a consistent view of the parsed string, the
    parse location, and line and column positions within the parsed string.
    r3rr2)�count)r.r/s  r�linenor:9s���:�:�d�A�s�#�#�a�'�'rc��|�dd|��}|�d|��}|dkr
||dz|�n||dzd�S)zh
    Returns the line of text containing loc within a string, counting newlines as line separators.
    r3rr2N)r5�find)r.r/�last_cr�next_crs    r�liner?GsZ��
�j�j��q�#�&�&�G��i�i��c�"�"�G�*1�Q�,�,�4��!��g�%�&�&�D��1����<O�Orc��eZdZd�ZdS)�_UnboundedCachec�����i��j�t��x|_���fd�}�fd�}�fd�}d|_t	j||��|_t	j||��|_t	j||��|_dS)Nc����|���S�Nr+��_�key�	cache_get�not_in_caches  ��r�getz%_UnboundedCache.__init__.<locals>.getW�����9�S�,�/�/�/rc���|�|<dSrDr+)rFrGr�caches   �r�set_z&_UnboundedCache.__init__.<locals>.set_Zs����E�#�J�J�Jrc�0������dSrD��clear�rFrMs �rrQz'_UnboundedCache.__init__.<locals>.clear]�����K�K�M�M�M�M�Mr)rJ�objectrI�size�types�
MethodType�setrQ)�selfrJrNrQrMrHrIs    @@@r�__init__z_UnboundedCache.__init__Rs���������I�	�+1�8�8�3���L�	0�	0�	0�	0�	0�	0�	�	�	�	�	�	�	�	�	�	���	��#�C��.�.����#�D�$�/�/����%�e�T�2�2��
�
�
rN�rr$r%rZr+rrrArAQs#������3�3�3�3�3rrAc��eZdZd�ZdS)�
_FifoCachec�8�����t��x|_�tj����j���fd�}��fd�}�fd�}�|_t
j||��|_t
j||��|_t
j||��|_	dS)Nc����|���SrDr+rEs  ��rrJz _FifoCache.__init__.<locals>.getlrKrc���|�|<t����kr+��d���t����k�)dSdS�NF)�last)r4�popitem)rFrGrrMrUs   ��rrNz!_FifoCache.__init__.<locals>.set_osP����E�#�J��e�*�*�t�#�#��
�
�5�
�)�)�)��e�*�*�t�#�#�#�#�#�#rc�0������dSrDrPrRs �rrQz"_FifoCache.__init__.<locals>.cleartrSr)
rTrI�collections�OrderedDictrJrUrVrWrXrQ)rYrUrJrNrQrMrHrIs `   @@@rrZz_FifoCache.__init__gs�������+1�8�8�3���L��'�)�)���I�	�	0�	0�	0�	0�	0�	0�	*�	*�	*�	*�	*�	*�
	�	�	�	�	���	��#�C��.�.����#�D�$�/�/����%�e�T�2�2��
�
�
rNr[r+rrr]r]fs#������3�3�3�3�3rr]c�0�eZdZdZd�Zd�Zd�Zd�Zd�ZdS)�LRUMemoz�
    A memoizing mapping that retains `capacity` deleted items

    The memo tracks retained items by their access order; once `capacity` items
    are retained, the least recently used item is discarded.
    c�R�||_i|_tj��|_dSrD)�	_capacity�_activererf�_memory)rY�capacitys  rrZzLRUMemo.__init__�s$��!������"�.�0�0����rc��	|j|S#t$r*|j�|��|j|cYSwxYwrD)rk�KeyErrorrl�move_to_end�rYrGs  r�__getitem__zLRUMemo.__getitem__�sX��	%��<��$�$���	%�	%�	%��L�$�$�S�)�)�)��<��$�$�$�$�	%���s��1A�Ac�P�|j�|d��||j|<dSrD)rl�poprk�rYrGrs   r�__setitem__zLRUMemo.__setitem__�s,�������d�#�#�#�!���S���rc��	|j�|��}t|j��|jkr8|j�d���t|j��|jk�8||j|<dS#t$rYdSwxYwra)rkrtr4rlrjrcrorus   r�__delitem__zLRUMemo.__delitem__�s���	&��L�$�$�S�)�)�E��d�l�#�#�t�~�5�5���$�$�%�$�0�0�0��d�l�#�#�t�~�5�5� %�D�L�������	�	�	��D�D�	���s�A=�=
B�
Bc�j�|j���|j���dSrD)rkrQrl)rYs rrQz
LRUMemo.clear�s0�����������������rN)	rr$r%r&rZrrrvrxrQr+rrrhrh}si��������1�1�1�
%�%�%�"�"�"�&�&�&�����rrhc��eZdZdZd�ZdS)�
UnboundedMemoz<
    A memoizing mapping that retains all deleted items
    c��dSrDr+rqs  rrxzUnboundedMemo.__delitem__�s���rN)rr$r%r&rxr+rrr{r{�s-��������
�
�
�
�
rr{r6c��dD] }|�|t|z��}�!|�dd��}|�dd��}t|��S)Nz\^-[]r3z\n�	z\t)�replace�_bslashr)r6�cs  r�_escape_regex_range_charsr��s[��
�&�&��
�I�I�a��1��%�%���	�	�	�$����A�	�	�	�$����A��q�6�6�MrT�	re_escapec
�<�	�
��
fd��
d�
_tj���
_d�
_d��	d�}|s|�	g}d�t
t|������}t|��dkr�tj	|�
���D]�\}}t|��x}}tjtj
t|g��|��d	�
�����}||kr|��	|������t#|��t#|��d	zkrdnd}|�d��	|��|�	|��������n�	fd
�|D��}d�|��S)Nc���t|��}|�jc�_}||z
dkrt�j���_�jS)Nr2)�ord�prev�next�counterr)r��c_intr��is_consecutives   �rr�z2_collapse_string_to_ranges.<locals>.is_consecutive�sK����A����$)�>�+>�!���T��4�<�!���#'��(>�#?�#?�N� ��#�#rr���c��|dvrd|zn|S)Nz\^-][�\r+�r�s r�escape_re_range_charz8_collapse_string_to_ranges.<locals>.escape_re_range_char�s����=�=�t�a�x�x�a�/rc��|SrDr+r�s r�no_escape_re_range_charz;_collapse_string_to_ranges.<locals>.no_escape_re_range_char�s���r��)rGr2)�maxlen�-z{}{}{}c�&��g|]
}�|����Sr+r+)�.0r�r�s  �r�
<listcomp>z._collapse_string_to_ranges.<locals>.<listcomp>�s%���2�2�2�1�#�#�A�&�&�2�2�2r)r��	itertoolsr9r�r�join�sortedrXr4�groupbyr�re�deque�chain�iterrt�appendr�r)r6r�r��retrF�chars�firstrb�sepr�r�s         @@r�_collapse_string_to_rangesr��s�����$�$�$�$�$��N��&�_�.�.�N���N��0�0�0�����7�6��
�C�
����s�1�v�v�����A�
�1�v�v��z�z�!�)�!��@�@�@�
	�
	�H�A�u���;�;�&�E�D��$����d�V���e�4�4�Q�����c�e�e�
���}�}��
�
�/�/��6�6�7�7�7�7���I�I��U���a��7�7�b�b�S���
�
��O�O�,�,�U�3�3�S�:N�:N�t�:T�:T�������
	�3�2�2�2��2�2�2��
�7�7�3�<�<�r�llc��g}|D]O}t|t��r#|�t|�����:|�|���P|SrD)�
isinstance�list�extend�_flattenr�)r�r��is   rr�r��sY��
�C�
�����a����	��J�J�x��{�{�#�#�#�#��J�J�q�M�M�M�M��Jr)T)rrVrer��	functoolsr�typingrrr�chrr�r	�intrr7r:r?rAr]rh�dictr{r��boolr�r�r�r+rr�<module>r�s�������������������������(�(�(�(�(�(�(�(�(�(�

�#�b�'�'��C�C�C�C�C�C�C�C�8��3����
Y�S�
Y��
Y��
Y�
Y�
Y���
Y� ��3����
(��
(�3�
(�3�
(�
(�
(���
(���3����P�c�P��P��P�P�P���P�3�3�3�3�3�3�3�3�*3�3�3�3�3�3�3�3�.$�$�$�$�$�$�$�$�N
�
�
�
�
�D�
�
�
���������59�+�+��S�(�3�-�
� �+�-1�+��+�+�+�+�\���$������r