https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/pygments/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/pygments/__pycache__/util.cpython-310.pyc
o

���a�#�@s<dZddlZddlmZe�d�Ze�dejejBejB�Z	e�dej
ejBejBejB�Ze�dej
�ZGdd	�d	e�ZGd
d�de�Zd2d
d�Zd3dd�Zd3dd�Zd3dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZiZdd �Zd!d"�Zd4d#d$�Zd5d&d'�Z Gd(d)�d)�Z!d*d+�Z"d,d-�Z#d.d/�Z$Gd0d1�d1e�Z%dS)6z�
    pygments.util
    ~~~~~~~~~~~~~

    Utility functions.

    :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�N)�
TextIOWrapperz[/\\ ]z�
    <!DOCTYPE\s+(
     [a-zA-Z_][a-zA-Z0-9]*
     (?: \s+      # optional in HTML5
     [a-zA-Z_][a-zA-Z0-9]*\s+
     "[^"]*")?
     )
     [^>]*>
z<(.+?)(\s.*?)?>.*?</.+?>z\s*<\?xml[^>]*\?>c@seZdZdZdS)�
ClassNotFoundzCRaised if one of the lookup functions didn't find a matching class.N)�__name__�
__module__�__qualname__�__doc__�rr�//usr/lib/python3/dist-packages/pygments/util.pyrsrc@seZdZdS)�OptionErrorN)rrrrrrr	r
"sr
FcCs@|�||�}|r|��}||vrtd|d�tt|��f��|S)Nz%Value for option %s must be one of %sz, )�get�lowerr
�join�map�str)�options�optname�allowed�default�normcase�stringrrr	�get_choice_opt&s�rcCsv|�||�}t|t�r
|St|t�rt|�St|t�s#td||f��|��dvr+dS|��dvr3dStd||f��)NzBInvalid type %r for option %s; use 1/0, yes/no, true/false, on/off)�1�yes�true�onT)�0�no�false�offFzCInvalid value %r for option %s; use 1/0, yes/no, true/false, on/off)r�
isinstance�bool�intrr
r�rrrrrrr	�get_bool_opt0s$


����r#cCsR|�||�}zt|�WStytd||f��ty(td||f��w)Nz=Invalid type %r for option %s; you must give an integer valuez>Invalid value %r for option %s; you must give an integer value)rr!�	TypeErrorr
�
ValueErrorr"rrr	�get_int_optDs
�����r&cCsD|�||�}t|t�r|��St|ttf�rt|�Std||f��)Nz9Invalid type %r for option %s; you must give a list value)rrr�split�list�tupler
)rrr�valrrr	�get_list_optRs
��r+cCsL|jsdSg}|j����D]}|��r|�d|���qd�|���S)N�� )r�strip�
splitlines�appendr
�lstrip)�obj�res�linerrr	�docstring_headline^sr5cs�fdd�}�j|_t|�S)zAReturn a static text analyser function that returns float values.c	sZz�|�}Wn
tyYdSw|sdSztdtdt|���WSttfy,YdSw)Ngg�?)�	Exception�min�max�floatr%r$)�text�rv��frr	�text_analysels��z%make_analysator.<locals>.text_analyse)r�staticmethod)r=r>rr<r	�make_analysatorjsr@cCs�|�d�}|dkr|d|���}n|��}|�d�rLzdd�t�|dd����D�d}Wn
ty9Yd	Swt�d
|tj	�}|�
|�durLdSd	S)a�Check if the given regular expression matches the last part of the
    shebang if one exists.

        >>> from pygments.util import shebang_matches
        >>> shebang_matches('#!/usr/bin/env python', r'python(2\.\d)?')
        True
        >>> shebang_matches('#!/usr/bin/python2.4', r'python(2\.\d)?')
        True
        >>> shebang_matches('#!/usr/bin/python-ruby', r'python(2\.\d)?')
        False
        >>> shebang_matches('#!/usr/bin/python/ruby', r'python(2\.\d)?')
        False
        >>> shebang_matches('#!/usr/bin/startsomethingwith python',
        ...                 r'python(2\.\d)?')
        True

    It also checks for common windows executable file extensions::

        >>> shebang_matches('#!C:\\Python2.4\\Python.exe', r'python(2\.\d)?')
        True

    Parameters (``'-f'`` or ``'--foo'`` are ignored so ``'perl'`` does
    the same as ``'perl -e'``)

    Note that this method automatically searches the whole string (eg:
    the regular expression is wrapped in ``'^$'``)
    �
rNz#!cSsg|]}|r|�d�s|�qS)�-)�
startswith)�.0�xrrr	�
<listcomp>�s
�
�z#shebang_matches.<locals>.<listcomp>����Fz^%s(\.(exe|cmd|bat|bin))?$T)�findrrC�
split_path_rer'r.�
IndexError�re�compile�
IGNORECASE�search)r:�regex�index�
first_line�foundrrr	�shebang_matches{s 

��rTcCs<t�|�}|durdS|�d�}t�|tj��|���duS)z�Check if the doctype matches a regular expression (if present).

    Note that this method only checks the first part of a DOCTYPE.
    eg: 'html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
    NF�)�doctype_lookup_rerO�grouprLrM�I�matchr.)r:rP�m�doctyperrr	�doctype_matches�s


r\cCs
t|d�S)z3Check if the file looks like it has a html doctype.�html)r\)r:rrr	�html_doctype_matches�s
r^cCsnt�|�rdSt|�}zt|WSty6t�|�}|dur#YdSt�|dd��du}|t|<|YSw)z2Check if a doctype exists or if we have some tags.TNi�)�xml_decl_rerY�hash�_looks_like_xml_cache�KeyErrorrVrO�tag_re)r:�keyrZr;rrr	�looks_like_xml�s


�recCsd|d?d|d@fS)zoGiven a unicode character code with length greater than 16 bits,
    return the two 16 bit surrogate pair.
    i���
i�i�r)�crrr	�
surrogatepair�srhc	Cs�g}d|d}d|dd}|�||d�|r*|D]}|�||d�qn|D]}t|d�}|�||dd�|d	d�q,|�|d
�d�|�S)z)Formats a sequence of strings for output.r-�rUz = (�,�"N���rH�)rA)r0�reprr
)	�var_name�seq�raw�indent_level�lines�base_indent�inner_indent�i�rrrr	�format_lines�s�$
rxrcCs>g}t�}|D]}||vs||vrq|�|�|�|�q|S)za
    Returns a list with duplicates removed from the iterable `it`.

    Order is preserved.
    )�setr0�add)�it�already_seen�lst�seenrvrrr	�duplicates_removed�s
rc@seZdZdZdd�ZdS)�Futurez�Generic class to defer some work.

    Handled specially in RegexLexerMeta, to support regex string construction at
    first use.
    cCst��N)�NotImplementedError��selfrrr	r�sz
Future.getN)rrrrrrrrr	r��sr�cCsxz
|�d�}|dfWSty;zddl}|��}|��}||fWYSttfy:|�d�}|dfYYSww)z�Decode *text* with guessed encoding.

    First try UTF-8; this should fail for non-UTF-8 encodings.
    Then try the preferred locale encoding.
    Fall back to latin-1, which always works.
    zutf-8rN�latin1)�decode�UnicodeDecodeError�locale�getpreferredencoding�LookupError)r:r��prefencodingrrr	�guess_decodes


��r�cCsHt|dd�r z|�|j�}WntyYt|�Sw||jfSt|�S)z�Decode *text* coming from terminal *term*.

    First try the terminal encoding, if given.
    Then try UTF-8.  Then try the preferred locale encoding.
    Fall back to latin-1, which always works.
    �encodingN)�getattrr�r�r�r�)r:�termrrr	�guess_decode_from_terminals�
r�cCs"t|dd�r	|jSddl}|��S)z7Return our best guess of encoding for the given *term*.r�Nr)r�r�r�r�)r�r�rrr	�terminal_encoding)sr�c@seZdZdd�ZdS)�UnclosingTextIOWrappercCs|��dSr�)�flushr�rrr	�close3szUnclosingTextIOWrapper.closeN)rrrr�rrrr	r�1sr�)NFr�)Fr)r)&rrL�iorrMrJ�DOTALL�	MULTILINE�VERBOSErV�UNICODErNrcrXr_r%rr6r
rr#r&r+r5r@rTr\r^rarerhrxrr�r�r�r�r�rrrr	�<module>s@

�	�




-

	



https://t.me/RX1948 - 2025