AlkantarClanX12

Your IP : 18.223.237.246


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__/common.cpython-311.pyc

�

�܋f�2���ddlTddlmZmZmZddlmZGd�d��Zd�ee�����D��Z	dS)	�)�*)�delimited_list�any_open_tag�
any_close_tag�)�datetimec�
�eZdZdZee��Z	ee��Z	e	e
���d���e��Z
	e	e���d���eed����Z	ed���d���e��Z	e���e��dze���e��z�d��Z	e�d	���eeeed
�����ez��zz�d��Z	e�e��ed���d
���e��Z	ed���d���e��Z	eezez�d�����Z	ed���d���e��Z	e	ee���d��Z 	ed���d��Z!	ed���d��Z"e"de"zdzz�d��Z#ee"de"zdzz��dzee"de"zdzz��z�d��Z$e$�%d���de!z�d ��Z&e'e#e&ze$z�d!�����d!��Z(	ed"���d#��Z)	e*d?d%e+fd&���Z,e*d@d%e+fd(���Z-ed)���d*��Z.	ed+���d,��Z/	ed-���d.��Z0	e1j��e2j��zZ3e*d/e+d0ed1e4fd2���Z5e'e6e7d3��e8��ze	e9d3�4��zee:d5��e;e8��d3z��z��z��������d6��Z<e=ee>�?��e<zd7�8�����d9��Z@	e*ed:�����ZA	e*ed;�����ZB	ed<���d=��ZCeZDeZEe,ZFe-ZGe5ZHeAZIeBZJd>S)A�pyparsing_commona"Here are some common low-level expressions that may be useful in
    jump-starting parser development:

    - numeric forms (:class:`integers<integer>`, :class:`reals<real>`,
      :class:`scientific notation<sci_real>`)
    - common :class:`programming identifiers<identifier>`
    - network addresses (:class:`MAC<mac_address>`,
      :class:`IPv4<ipv4_address>`, :class:`IPv6<ipv6_address>`)
    - ISO8601 :class:`dates<iso8601_date>` and
      :class:`datetime<iso8601_datetime>`
    - :class:`UUID<uuid>`
    - :class:`comma-separated list<comma_separated_list>`
    - :class:`url`

    Parse actions:

    - :class:`convertToInteger`
    - :class:`convertToFloat`
    - :class:`convertToDate`
    - :class:`convertToDatetime`
    - :class:`stripHTMLTags`
    - :class:`upcaseTokens`
    - :class:`downcaseTokens`

    Example::

        pyparsing_common.number.runTests('''
            # any int or real number, returned as the appropriate type
            100
            -100
            +100
            3.14159
            6.02e23
            1e-12
            ''')

        pyparsing_common.fnumber.runTests('''
            # any int or real number, returned as float
            100
            -100
            +100
            3.14159
            6.02e23
            1e-12
            ''')

        pyparsing_common.hex_integer.runTests('''
            # hex numbers
            100
            FF
            ''')

        pyparsing_common.fraction.runTests('''
            # fractions
            1/2
            -3/4
            ''')

        pyparsing_common.mixed_integer.runTests('''
            # mixed fractions
            1
            1/2
            -3/4
            1-3/4
            ''')

        import uuid
        pyparsing_common.uuid.setParseAction(tokenMap(uuid.UUID))
        pyparsing_common.uuid.runTests('''
            # uuid
            12345678-1234-5678-1234-567812345678
            ''')

    prints::

        # any int or real number, returned as the appropriate type
        100
        [100]

        -100
        [-100]

        +100
        [100]

        3.14159
        [3.14159]

        6.02e23
        [6.02e+23]

        1e-12
        [1e-12]

        # any int or real number, returned as float
        100
        [100.0]

        -100
        [-100.0]

        +100
        [100.0]

        3.14159
        [3.14159]

        6.02e23
        [6.02e+23]

        1e-12
        [1e-12]

        # hex numbers
        100
        [256]

        FF
        [255]

        # fractions
        1/2
        [0.5]

        -3/4
        [-0.75]

        # mixed fractions
        1
        [1]

        1/2
        [0.5]

        -3/4
        [-0.75]

        1-3/4
        [1.75]

        # uuid
        12345678-1234-5678-1234-567812345678
        [UUID('12345678-1234-5678-1234-567812345678')]
    �integerzhex integer�z[+-]?\d+zsigned integer�/�fractionc�$�|d|dzS)Nr����)�tts �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pyparsing/common.py�<lambda>zpyparsing_common.<lambda>�s���A���B�����-z"fraction or mixed integer-fractionz[+-]?(?:\d+\.\d*|\.\d+)zreal numberz@[+-]?(?:\d+(?:[eE][+-]?\d+)|(?:\d+\.\d*|\.\d+)(?:[eE][+-]?\d+)?)z$real number with scientific notation�numberz[+-]?\d+\.?\d*([eE][+-]?\d+)?�fnumber�
identifierzK(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})){3}zIPv4 addressz[0-9a-fA-F]{1,4}�hex_integer�:�zfull IPv6 address)r�z::zshort IPv6 addressc�<�td�|D����dkS)Nc3�XK�|]%}tj�|���!dV��&dS)rN)r
�
_ipv6_part�matches)�.0rs  r�	<genexpr>z,pyparsing_common.<lambda>.<locals>.<genexpr>�s9����O�O�B�'7�'B�'J�'J�2�'N�'N�O�a�O�O�O�O�O�Or�)�sum��ts rrzpyparsing_common.<lambda>�s#��#�O�O�!�O�O�O�O�O�RS�S�rz::ffff:zmixed IPv6 addresszIPv6 addressz:[0-9a-fA-F]{2}([:.-])[0-9a-fA-F]{2}(?:\1[0-9a-fA-F]{2}){4}zMAC address�%Y-%m-%d�fmtc����fd�}|S)a�
        Helper to create a parse action for converting parsed date string to Python datetime.date

        Params -
        - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%d"``)

        Example::

            date_expr = pyparsing_common.iso8601_date.copy()
            date_expr.setParseAction(pyparsing_common.convertToDate())
            print(date_expr.parseString("1999-12-31"))

        prints::

            [datetime.date(1999, 12, 31)]
        c���	tj|d������S#t$r#}t	||t|�����d}~wwxYw�Nr)r�strptime�date�
ValueError�ParseException�str)�ss�llr�ver)s    �r�cvt_fnz0pyparsing_common.convert_to_date.<locals>.cvt_fnsb���
6��(��A���4�4�9�9�;�;�;���
6�
6�
6�$�R��S��W�W�5�5�5�����
6���s�,0�
A�A�Ar�r)r5s` r�convert_to_datez pyparsing_common.convert_to_date�s#���&	6�	6�	6�	6�	6��
r�%Y-%m-%dT%H:%M:%S.%fc����fd�}|S)aHelper to create a parse action for converting parsed
        datetime string to Python datetime.datetime

        Params -
        - fmt - format to be passed to datetime.strptime (default= ``"%Y-%m-%dT%H:%M:%S.%f"``)

        Example::

            dt_expr = pyparsing_common.iso8601_datetime.copy()
            dt_expr.setParseAction(pyparsing_common.convertToDatetime())
            print(dt_expr.parseString("1999-12-31T23:59:59.999"))

        prints::

            [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)]
        c���	tj|d���S#t$r#}t||t	|�����d}~wwxYwr,)rr-r/r0r1)�s�lr'r4r)s    �rr5z4pyparsing_common.convert_to_datetime.<locals>.cvt_fn*sV���
4��(��1��s�3�3�3���
4�
4�
4�$�Q��3�r�7�7�3�3�3�����
4���s��
A�A�Arr6s` r�convert_to_datetimez$pyparsing_common.convert_to_datetimes#���&	4�	4�	4�	4�	4��
rz7(?P<year>\d{4})(?:-(?P<month>\d\d)(?:-(?P<day>\d\d))?)?zISO8601 datez�(?P<year>\d{4})-(?P<month>\d\d)-(?P<day>\d\d)[T ](?P<hour>\d\d):(?P<minute>\d\d)(:(?P<second>\d\d(\.\d*)?)?)?(?P<tz>Z|[+-]\d\d:?\d\d)?zISO8601 datetimez2[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}�UUIDr;r<�tokensc�L�tj�|d��S)aParse action to remove HTML tags from web page HTML source

        Example::

            # strip HTML links from normal text
            text = '<td>More info at the <a href="https://github.com/pyparsing/pyparsing/wiki">pyparsing</a> wiki page</td>'
            td, td_end = makeHTMLTags("TD")
            table_text = td + SkipTo(td_end).setParseAction(pyparsing_common.stripHTMLTags)("body") + td_end
            print(table_text.parseString(text).body)

        Prints::

            More info at the pyparsing wiki page
        r)r
�_html_stripper�transform_string)r;r<r?s   r�strip_html_tagsz pyparsing_common.strip_html_tagsAs��  �.�?�?��q�	�J�J�Jr�,)�
exclude_charsz 	�	commaItem�)�defaultzcomma separated listc�*�|���S�N)�upperr&s rrzpyparsing_common.<lambda>ds��Q�W�W�Y�Y�rc�*�|���SrJ)�lowerr&s rrzpyparsing_common.<lambda>gs��q�w�w�y�y�ra�^(?:(?:(?P<scheme>https?|ftp):)?\/\/)(?:(?P<auth>\S+(?::\S*)?)@)?(?P<host>(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(:(?P<port>\d{2,5}))?(?P<path>\/[^?# ]*)?(\?(?P<query>[^#]*))?(#(?P<fragment>\S*))?$�urlN)r()r8)K�__name__�
__module__�__qualname__�__doc__�	token_map�int�convert_to_integer�float�convert_to_float�Word�nums�set_name�set_parse_actionr�hexnumsr�Regex�signed_integerr�add_parse_action�Opt�suppress�
mixed_integerr%�real�sci_real�setName�
streamlinerr�
identchars�identbodycharsr�ipv4_addressr �_full_ipv6_address�_short_ipv6_address�
add_condition�_mixed_ipv6_address�Combine�ipv6_address�mac_address�staticmethodr1r7r=�iso8601_date�iso8601_datetime�uuidrrrA�ParseResultsrC�	OneOrMore�Literal�LineEnd�
printables�White�
FollowedBy�
_commasepitemr�
quoted_string�copy�comma_separated_list�
upcase_tokens�downcase_tokensrN�convertToInteger�convertToFloat�
convertToDate�convertToDatetime�
stripHTMLTags�upcaseTokens�downcaseTokensrrrr
r
s�������O�O�b#��3�����!�y��'�'����d�4�j�j�!�!�)�,�,�=�=�>P�Q�Q�G�D�	
��W�
�
���}�-�-�>�>�y�y��b�?Q�?Q�R�R��G�	��k���	��"�	#�	#�	�	�,�	-�	-��
W�	����)�)�*:�;�;�

�	�
�.�
�
�
+�
+�,<�
=�
=�	>��h�z���	
�
U����7�7�8�8�8�	�>�C�C���C���(9�(9�(;�(;�h�(F�$G�$G�G�G��h�3�4�4��g��"�"�3�'�'�'�	��(�)�)�	��-�	 �	 �	�	�*�	+�	+�	�
M�	��Q�R�R�	��8�	9�	9�	�	�*�	+�	+�
�
/���o��.�
7�
7��
A�
A�
L�
L�
N�
N�F�G�	��.�/�/�	��)�	�	�	�	�*�	+�	+��
4���j�.�1�1�:�:�<�H�H�J�d��5�V����h�~����3���*�+�+�4�4�]�C�C�J�$��j�(8�A�'=�=�G�G�����	��J�#�
�*�f�4�4�5�5�
�	�

�#�j�C�*�,��6�6�
7�
7�	8��h�#�$�$�	�
�%�%�S�S����%�|�3�=�=�>R�S�S���7�	�1�	1�4G�	G�Q�Q��	
�	
����h�~���	�
0��%�E����h�}����G����S�����\��4��������\��4�5�B����h�~����$��u�	R����h�!�"�"��]��5�F�G�G�P�P�QW�X�X�D�5�*�\�*�,�,�/E�}�/E�/G�/G�G�N��K�3�K�3�K��K�K�K��\�K�$	���I������
��7�9�9�*���$�z��5�5�5�6��#�e�e�E�l�l�j�j�����S��&A�&A�%A�A�B�B�C�
�
�	
�	
�
����	��+�	�	��*�>���M��� � �=�0�"�=�=�=����h�%�&�&��e� �L���+>�+>�!?�!?�@�@�M�7�"�l�9�9�-@�-@�#A�#A�B�B�O�7��%�*	
�.�.�\�h�u�o�o�]�d*��%�N�#�M�+��#�M� �L�$�N�N�Nrr
c�<�g|]}t|t���|��Sr)�
isinstance�
ParserElement)r"�vs  r�
<listcomp>r��s7�����
�*�Q�
�2N�2N�����rN)
�core�helpersrrrrr
�vars�values�_builtin_exprsrrr�<module>r�s�������@�@�@�@�@�@�@�@�@�@�������[%�[%�[%�[%�[%�[%�[%�[%�|���t�$�%�%�,�,�.�.������r