403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/pandas/core/computation/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/pandas/core/computation/__pycache__/parsing.cpython-312.pyc
�

-	�g����dZddlmZddlmZddlmZddlZddlZddl	m
Z
e
rddlmZm
Z
dZdd	�Zdd
�Zdd�Z								dd�Zdd
�Zy)z6
:func:`~pandas.eval` source string parsing functions
�)�annotations)�StringIO)�	iskeywordN)�
TYPE_CHECKING)�Hashable�Iterator�dc��|j�r
t|�s|Stjj	�D��cic]\}}|dt
j|�d���}}}|jddddddddd	��d
j|D�cgc]}|j||���c}�}d|��}|j�std|�d
���|Scc}}wcc}w)a=
    Create valid Python identifiers from any string.

    Check if name contains any special characters. If it contains any
    special characters, the special characters will be replaced by
    a special string and a prefix is added.

    Raises
    ------
    SyntaxError
        If the returned name is not a Python valid identifier, raise an exception.
        This can happen if there is a hashtag in the name, as the tokenizer will
        than terminate and not find the backtick.
        But also for characters that fall out of the range of (U+0001..U+007F).
    �_�_QUESTIONMARK_�_EXCLAMATIONMARK_�_DOLLARSIGN_�
_EUROSIGN_�_DEGREESIGN_�
_SINGLEQUOTE_�
_DOUBLEQUOTE_)� �?�!�$u€�°�'�"��BACKTICK_QUOTED_STRING_zCould not convert 'z' to a valid Python identifier.)�isidentifierr�tokenize�EXACT_TOKEN_TYPES�items�token�tok_name�update�join�get�SyntaxError)�name�char�tokval�special_characters_replacementss    �AC:\Python312\Lib\site-packages\pandas/core/computation/parsing.py�create_valid_python_identifierr+s��� ����9�T�?���&�7�7�=�=�?�'��D�&�	
��%�.�.��(�)��+�+�'�#�'�$�*�*��!�$��� � � �	
�� �7�7�PT�U��3�7�7��d�C�U�V�D�
$�T�F�+�D������/��v�5T�U�V�V��K��5'��(Vs�"C�
Cc�\�|\}}|tk(rtjt|�fS||fS)a[
    Clean up a column name if surrounded by backticks.

    Backtick quoted string are indicated by a certain tokval value. If a string
    is a backtick quoted token it will processed by
    :func:`_create_valid_python_identifier` so that the parser can find this
    string when the query is executed.
    In this case the tok will get the NAME tokval.

    Parameters
    ----------
    tok : tuple of int, str
        ints correspond to the all caps constants in the tokenize module

    Returns
    -------
    tok : Tuple[int, str]
        Either the input or token or the replacement values
    )�BACKTICK_QUOTED_STRINGr�NAMEr+)�tok�toknumr(s   r*�clean_backtick_quoted_toksr1Is5��(�N�F�F�
�'�'��}�}�<�V�D�D�D��6�>��c�v�	td|�d��}t|�d}t|�S#t$r|cYSwxYw)a�
    Function to emulate the cleaning of a backtick quoted name.

    The purpose for this function is to see what happens to the name of
    identifier if it goes to the process of being parsed a Python code
    inside a backtick quoted string and than being cleaned
    (removed of any special characters).

    Parameters
    ----------
    name : hashable
        Name to be cleaned.

    Returns
    -------
    name : hashable
        Returns the name after tokenizing and cleaning.

    Notes
    -----
        For some cases, a name cannot be converted to a valid Python identifier.
        In that case :func:`tokenize_string` raises a SyntaxError.
        In that case, we just return the name unmodified.

        If this name was used in the query string (this makes the query call impossible)
        an error will be raised by :func:`tokenize_backtick_quoted_string` instead,
        which is not caught and propagates to the user level.
    �`�)�tokenize_string�nextr+r%)r&�	tokenizedr(s   r*�clean_column_namer9csF��:�#�a��v�Q�K�0�	��i���#��-�f�5�5�������s�'*�8�8c�J�|D]\}}}}}|dk(s�|d}nt||fS)a�
    Creates a token from a backtick quoted string.

    Moves the token_generator forwards till right after the next backtick.

    Parameters
    ----------
    token_generator : Iterator[tokenize.TokenInfo]
        The generator that yields the tokens of the source string (Tuple[int, str]).
        The generator is at the first token after the backtick (`)

    source : str
        The Python source code string.

    string_start : int
        This is the start of backtick quoted string inside the source string.

    Returns
    -------
    tok: Tuple[int, str]
        The token that represents the backtick quoted string.
        The integer is equal to BACKTICK_QUOTED_STRING (100).
    r4r5)r-)�token_generator�source�string_startrr(�start�
string_ends       r*�tokenize_backtick_quoted_stringr@�sE��4#2����6�5�!�Q��S�=��q��J���
"�6�,�z�#B�B�Br2c#�K�t|�j}tj|�}|D]+\}}}}}|dk(r	t	|||ddz�����&||f���-y#t
$r}t
d|�d��|�d}~wwxYw�w)a$
    Tokenize a Python source code string.

    Parameters
    ----------
    source : str
        The Python source code string.

    Returns
    -------
    tok_generator : Iterator[Tuple[int, str]]
        An iterator yielding all tokens with only toknum and tokval (Tuple[ing, str]).
    r4r5)r=zFailed to parse backticks in 'z'.N)r�readliner�generate_tokensr@�	Exceptionr%)r<�line_readerr;r0r(r>r�errs        r*r6r6�s������6�"�+�+�K��.�.�{�;�O�(7�	!�#����q�!��S�=�
X�5�#�V�%��(�Q�,����&�.� �	!���
X�!�$B�6�(�"�"M�N�TW�W��
X�s(�;A?�A�
A?�	A<�'A7�7A<�<A?)r&�str�returnrG)r/�tuple[int, str]rHrI)r&rrHr)r;zIterator[tokenize.TokenInfo]r<rGr=�intrHrI)r<rGrHzIterator[tuple[int, str]])�__doc__�
__future__r�ior�keywordrr r�typingr�collections.abcrrr-r+r1r9r@r6�r2r*�<module>rRso���#����� �����0�f�4"�JC�1�C�;>�C�NQ�C��C�D!r2

Youez - 2016 - github.com/yon3zu
LinuXploit