HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/pip/_vendor/pyparsing/__pycache__/common.cpython-310.pyc
o

@%Ne�2�@sPddlTddlmZmZmZddlmZGdd�d�Zdd�ee���D�Z	d	S)
�)�*)�delimited_list�any_open_tag�
any_close_tag�)�datetimec@s$eZdZdZee�Z	ee�Z	e	e
��d��e�Z
	e	e��d��eed��Z	ed��d��e�Z	e��e�de��e��d�Z	e�d	d
��eeeed���e�B�d�Z	e�e�ed
��d��e�Z	ed��d��e�Z	eeBeB�d���Z	ed��d��e�Z	e	ee��d�Z 	ed��d�Z!	ed��d�Z"e"de"d�d�Z#ee"de"d�dee"de"d��d�Z$e$�%dd
��d e!�d!�Z&e'e#e&Be$B�d"���d"�Z(	ed#��d$�Z)	e*dCd&e+fd'd(��Z,e*dDd&e+fd*d+��Z-ed,��d-�Z.	ed.��d/�Z/	ed0��d1�Z0	e1��e2��BZ3e*d2e+d3ed4e4fd5d6��Z5e'e6e7d7�e8�e	e9d7d8�ee:d9�e;e8�d7B�������d:�Z<e=ee>�?�e<Bd;d<���d=�Z@	e*ed>d
���ZA	e*ed?d
���ZB	ed@��dA�ZCeZDeZEe,ZFe-ZGe5ZHeAZIeBZJdBS)E�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�/�fractioncCs|d|dS)Nr����)�ttrr�>/usr/lib/python3/dist-packages/pip/_vendor/pyparsing/common.py�<lambda>�szpyparsing_common.<lambda>�-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 addresscCstdd�|D��dkS)Ncss �|]}tj�|�rdVqdS)rN)r�
_ipv6_part�matches)�.0rrrr�	<genexpr>�s�z,pyparsing_common.<lambda>.<locals>.<genexpr>�)�sum��trrrr�sz::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��fdd�}|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
s@zt�|d����WSty}zt||t|���d}~ww�Nr)r�strptime�date�
ValueError�ParseException�str)�ss�llr�ve�r#rr�cvt_fns��z0pyparsing_common.convert_to_date.<locals>.cvt_fnr�r#r/rr.r�convert_to_date��z pyparsing_common.convert_to_date�%Y-%m-%dT%H:%M:%S.%fcr$)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
s<z	t�|d��WSty}zt||t|���d}~wwr%)rr&r(r)r*)�s�lr!r-r.rrr/*s��z4pyparsing_common.convert_to_datetime.<locals>.cvt_fnrr0rr.r�convert_to_datetimer2z$pyparsing_common.convert_to_datetimez7(?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}�UUIDr4r5�tokenscCstj�|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)r4r5r8rrr�strip_html_tagsAsz pyparsing_common.strip_html_tags�,)�
exclude_charsz 	�	commaItem�)�defaultzcomma separated listcC�|��S�N)�upperr rrrrd�cCrArB)�lowerr rrrrgrDa�^(?:(?:(?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")r3)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�staticmethodr*r1r6�iso8601_date�iso8601_datetime�uuidrrr9�ParseResultsr;�	OneOrMore�Literal�LineEnd�
printables�White�
FollowedBy�
_commasepitemr�
quoted_string�copy�comma_separated_list�
upcase_tokens�downcase_tokensrF�convertToInteger�convertToFloat�
convertToDate�convertToDatetime�
stripHTMLTags�upcaseTokens�downcaseTokensrrrrrs��
�
���
��������������������
��������.�2rcCsg|]	}t|t�r|�qSr)�
isinstance�
ParserElement)r�vrrr�
<listcomp>�s

��r�N)
�core�helpersrrrrr�vars�values�_builtin_exprsrrrr�<module>s!

�