403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/IPython/core/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/IPython/core/__pycache__/completerlib.cpython-311.pyc
�

�@�c�/���dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
m
Z
ddlmZddl
mZmZdd	lmZd
dlmZddlmZdd
lmZe	��Zd
ZdZejdd�d�eD����z��Zejd��Zd�Zd�Z d�Z!d�Z"d!de#dee#fd�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d �Z*dS)"z\Implementations for various useful completers.

These are all loaded by default by IPython.
�N)�
import_module)�all_suffixes)�time)�zipimporter�)�expand_user�
compress_user)�TryNext�)�	arg_split)�get_ipython)�List�z?(?P<name>[^\W\d]\w*?)(?P<package>[/\\]__init__)?(?P<suffix>%s)$�|c#�>K�|]}tj|��V��dS�N)�re�escape)�.0�ss  �;/usr/lib/python3/dist-packages/IPython/core/completerlib.py�	<genexpr>r:s*���� A� A�!���1��� A� A� A� A� A� A�z.*(\.ipy|\.ipynb|\.py[w]?)$c���	�|dkrd}tjj�tj�|��r{g}tj|d���D]a\}}}|t|��dzd��	�	r*|���	fd�|D����g|dd�<�L|�|���bn>	tt|��j	�
����}n	#g}YnxYwg}|D]F}t�|��}|r(|�
|�d�����Gtt|����S)	z`
    Return the list containing the names of the modules available in the given
    folder.
    ��.T)�followlinksrNc3�0�K�|]}��|��V��dSr�)r�f�pjoin�subdirs  ��rrzmodule_list.<locals>.<genexpr>Ws/�����?�?�!�U�U�6�1�-�-�?�?�?�?�?�?r�name)�os�path�join�isdir�walk�len�extend�listr�_files�keys�	import_re�match�append�group�set)
r%�files�root�dirs�nondirs�modulesr �mr!r"s
        @@r�module_listr9Csq�����r�z�z���
�G�L�E�	�w�}�}�T������#%�7�4�T�#B�#B�#B�	&�	&��D�$���#�d�)�)�A�+�,�,�'�F��
&����?�?�?�?�?�w�?�?�?�?�?�?���Q�Q�Q������W�%�%�%�%�
	&�	���T�*�*�1�6�6�8�8�9�9�E�E��	��E�E�E�����G�
�,�,���O�O�A�����	,��N�N�1�7�7�6�?�?�+�+�+����G�����s�73C+�+C1c�<�t��}|�ttj��S|j�di��}ttj��}t
��}d}tjD]�}	||}n�#t$r�t|��}	|�
d��n#t$rYnwxYw|dvr|||<t
��|z
tkr@|s>d}td��td��tj���t
��|z
t krtd	��gcYcSYnwxYw|�|����|r
||jd<tt%|����}|S)
z�
    Returns a list containing the names of all the modules available in the
    folders of the pythonpath.

    ip.db['rootmodules_cache'] maps sys.path entries to list of modules.
    N�rootmodules_cacheF�__init__)rrTz/
Caching the list of root modules, please wait!z@(This will only be done once - type '%rehashx' to reset cache!)
z%This is taking too long, we give up.
)r
r+�sys�builtin_module_names�db�getrr%�KeyErrorr9�remove�
ValueError�TIMEOUT_STORAGE�print�stdout�flush�TIMEOUT_GIVEUPr*r2)�ipr;�rootmodules�
start_time�storer%r7s       r�get_root_modulesrMks���
���B�	�z��C�,�-�-�-���	�	�"5�r�:�:���s�/�0�0�K����J��E���$�$��	�'��-�G�G���	�	�	�!�$�'�'�G�
����z�*�*�*�*���
�
�
���
�����9�$�$�*1�!�$�'��v�v�
�"�_�4�4�U�4����H�I�I�I��(�)�)�)��
� � �"�"�"��v�v�
�"�^�3�3��>�?�?�?��	�	�	�	�	�4�3�	����"	���7�#�#�#�#��7�%6���!�"��s�;�'�'�(�(�K��s7�=B�E� B6�5E�6
C�E�C�BE�Ec��|r"tjt||����S|dd�dko
|dd�dkS)Nr�__���)�inspect�ismodule�getattr)�module�attr�only_moduless   r�
is_importablerW�sM���;������ 5� 5�6�6�6�����8�t�#�9��R�S�S�	�T�(9�:�:rc��	t||��}n#t$rYdSt$rYdSwxYwtj|��S)NTF)rS�AttributeError�	TypeErrorrQrR)rTrU�objs   r�is_possible_submoduler\�sf����f�d�#�#���������t�t������u�u�������C� � � s��
-�	-�-F�mod�returnc����|�d��}	t|���n	#gcYSxYwdt�dd��pdv}g}t�d��r�r|r/|���fd�t���D����t�dg��}�r"|��fd�|D����n|�|��|rD|�t
tj�	�j
������d�|D��}|�d��t|��S)	zN
    Try to import given module and return list of potential completions.
    rr<�__file__rc�6��g|]}t�|����|��Sr)rW)rrUr8rVs  ��r�
<listcomp>ztry_import.<locals>.<listcomp>�s@���C�C�C�d�*�1�d�L�A�A�C�T�C�C�Cr�__all__c3�<�K�|]}t�|���|V��dSr)r\)rrUr8s  �rrztry_import.<locals>.<genexpr>�s3�����T�T�D�5J�1�d�5S�5S�T�4�T�T�T�T�T�Trc�<�h|]}t|t���|��Sr)�
isinstance�str�r�cs  r�	<setcomp>ztry_import.<locals>.<setcomp>�s'��D�D�D�Q��A�s�1C�1C�D�q�D�D�Dr)
�rstriprrS�hasattrr*�dirr9r$r%�dirnamer`�discardr+)r]rV�	m_is_init�completions�m_all�completions_setr8s `    @r�
try_importrt�s������*�*�S�/�/�C���#��������	�	�	�����w�q�*�b�9�9�?�R�@�I��K��A�z�"�"�D�L�D�Y�D����C�C�C�C�C�c�!�f�f�C�C�C�	D�	D�	D�
�A�y�"�%�%�E��"����T�T�T�T�E�T�T�T�T�T�T�T����5�!�!�!��E����;�r�w���q�z�'B�'B�C�C�D�D�D�D�D�+�D�D�D�O����J�'�'�'��� � � s�)�/c���t�t��r������fd�}t���d||���dS)a� Easily create a trivial completer for a command.

    Takes either a list of completions, or all completions in string (that will
    be split on whitespace).

    Example::

        [d:\ipython]|1> import ipy_completers
        [d:\ipython]|2> ipy_completers.quick_completer('foo', ['bar','baz'])
        [d:\ipython]|3> foo b<TAB>
        bar baz
        [d:\ipython]|3> foo ba
    c����Srr)�self�eventrqs  �r�do_completez$quick_completer.<locals>.do_complete�s	����r�complete_command)�str_keyN)rfrg�splitr
�set_hook)�cmdrqrys ` r�quick_completerr�si����+�s�#�#�*�!�'�'�)�)��������M�M���-�k�S��I�I�I�I�Irc���|�d��}t|��}|dkr|ddkrdgS|dkr�|ddvr�|dkrt��S|d�d���t���d	krt��Std��d
d���d��}�fd
�|D��S|dkr#|ddkr|d�t���Sd
Sd
S)z�
    Returns a list containing the completion possibilities for an import line.

    The line looks like this :
    'import xml.d'
    'from xml.dom import'
    � �r�fromzimport >�%aimportr��importrrrN���Tc�R��g|]#}d��dd�|gz����$S)rNr�)r&)r�elr]s  �rrbz%module_completion.<locals>.<listcomp>�s3���D�D�D�b�����S�b�S��R�D��)�)�D�D�Dr)r|r)rMrtr&)�line�words�nwords�completion_listr]s    @r�module_completionr��s���
�J�J�s�O�O�E�
��Z�Z�F���{�{�u�Q�x�6�)�)��{����z�z�u�Q�x�#A�A�A��Q�;�;�#�%�%�%��A�h�n�n�S�!�!���s�8�8�a�<�<�#�%�%�%�$�S�X�X�c�#�2�#�h�%7�%7��>�>��D�D�D�D�O�D�D�D�D���{�{�u�Q�x�6�)�)��A�h���#�����{�)�)rc�*�t|j��S)z@Give completions after user has typed 'import ...' or 'from ...')r�r��rwrxs  r�module_completerr�s���U�Z�(�(�(rc�x��	�
�t|jd���}t|��dkr6|j�d��s|d�d��}nd}t
j}tjj�t|��\}�	�
td�|D����r�fd	�||d
z��D��}nd�fd�||d
z��D��}d�||d
z��||dz��z||dz��z||dz��zD��}||z}�	�
fd�|D��S)zKComplete files that end in .py or .ipy or .ipynb for the %run command.
    F)�strictrr�r�z'"rc3�JK�|]}t�|��V��dSr)�magic_run_rer/rhs  rrz&magic_run_completer.<locals>.<genexpr>+s0����
0�
0�Q�<���a� � �
0�
0�
0�
0�
0�
0rc�\��g|](}|�dd���|��rdndz��)S)�\�/r��replace�rr r's  �rrbz'magic_run_completer.<locals>.<listcomp>,sM���9�9�9� !��I�I�d�3�'�'�%�%��(�(�+B�3�3��C�9�9�9r�*c�X��g|]&}�|���
|�dd��dz��'S�r�r�r�r�s  �rrbz'magic_run_completer.<locals>.<listcomp>/s9���R�R�R�a���q���R��	�	�$�s�#�#�c�)�R�R�Rrc�:�g|]}|�dd����Sr�r��rr s  rrbz'magic_run_completer.<locals>.<listcomp>0s<��E�E�E���	�	�$�s�#�#�E�E�Erz*.pyz*.ipyz*.ipynbz*.pywc�2��g|]}t|������Sr�r	�r�p�tilde_expand�	tilde_vals  ��rrbz'magic_run_completer.<locals>.<listcomp>7s%���G�G�G�!�M�!�\�9�5�5�G�G�Gr)rr�r)�endswith�strip�globr$r%r'r�any)rwrx�comps�relpath�lglob�matchesr5�pysr'r�r�s        @@@r�magic_run_completerr�s������
�e�j��/�/�/�E��E�
�
�Q�����!4�!4�S�!9�!9����)�/�/�%�(�(�����
�I�E��G�M�E�'2�7�';�';�$�G�\�9��
0�
0�%�
0�
0�
0�0�0�	�9�9�9�9�%*�U�7�3�;�%7�%7�9�9�9���S�R�R�R�5�5����3E�3E�R�R�R��E�E���w�v�~�.�.���w�w��1G�1G�G���g�i�'�(�(�)�+0�5��7�1B�+C�+C�D�E�E�E����*��H�G�G�G�G�w�G�G�G�Grc
�4����
�t��}�j}�j�d��s	d�jvr3|j�dd��}|r|���SgS�jdkr�tttt|j	d��dz������}d|zd	z��fd
�t|j	d��D��}t|��dkr|SgS�j�d��rd�|j	dD��St|��\}��
|�
d
d��}g}d�tj|dz��D��D]"}d|vrt�|�|���#|set"j�|��rt)|��
��gS|j�di��}	�fd�|	D��}
|
r|
St���
fd�|D��S)z:Completer function for cd, which only returns directories.z-bz -b �	bookmarksN�-�_dhrz-%0zd [%s]c�$��g|]\}}�||fz��
Srr)r�ir�fmts   �rrbz cd_completer.<locals>.<listcomp>Ls%���E�E�E���1���!�u��E�E�Er�--c�R�g|]$}dtj�|��z��%S)r�)r$r%�basename)r�ds  rrbz cd_completer.<locals>.<listcomp>Rs-��F�F�F�q��r�w�'�'��*�*�*�F�F�Frr�r�c�~�g|]:}tj�|���!|�dd��dz��;Sr�)r$r%r'r�r�s  rrbz cd_completer.<locals>.<listcomp>YsM��#�#�#�A�����q�!�!�#�a�i�i��S�!�!�C�'�#�#�#rr�r�c�H��g|]}|��j���|��Sr)�
startswith�symbol)rrrxs  �rrbz cd_completer.<locals>.<listcomp>hs,���B�B�B�1�q�|�|�E�L�'A�'A�B�Q�B�B�Brc�2��g|]}t|������Srr�r�s  ��rrbz cd_completer.<locals>.<listcomp>ns%���E�E�E�!�M�!�\�9�5�5�E�E�Er)r
r�r�r�r?r@r-rgr)�user_ns�	enumerater�rr�r�r
r0r$r%r'r	)rwrxrIr��bkms�width_dh�ents�foundr��bks�	bkmatchesr�r�r�s `         @@@r�cd_completerr�:sF������	���B��l�G�
�z���4� � ��F�e�j�$8�$8��w�{�{�;��-�-���	��9�9�;�;���I��|�s����s�3�s�2�:�e�#4�5�5��9�:�:�;�;�<�<���h���(��E�E�E�E�	�"�*�U�2C�(D�(D�E�E�E���t�9�9�q�=�=��K��	��|���t�$�$�G�F�F�B�J�u�4E�F�F�F�F�(3�7�';�';�$�G�\�9��o�o�d�3�'�'�G��E�#�#���7�3�;�1G�1G�#�#�#�����!�8�8��M�
���Q������
�
�7�=�=��!�!�	E�!�'�<��C�C�D�D��g�k�k�+�b�)�)��B�B�B�B��B�B�B�	��	����
�E�E�E�E�E�u�E�E�E�Erc�*�d���S)zA completer for %reset magicz-f -s in out array dhist)r|r�s  r�reset_completerr�ps��%�+�+�-�-�-r)F)+�__doc__r�rQr$rr=�	importlibr�importlib.machineryrr�	zipimportr�	completerrr	�errorr
�utils._process_commonr�IPythonr
�typingr�	_suffixesrDrH�compiler&r.r�r9rMrWr\rgrtrr�r�r�r�r�rrr�<module>r�s7����"��������	�	�	�	�	�	�	�	�
�
�
�
�#�#�#�#�#�#�,�,�,�,�,�,�������!�!�!�!�!�!�2�1�1�1�1�1�1�1�������-�-�-�-�-�-� ������������

�L�N�N�	�����
�B�J�*��y�y� A� A�y� A� A� A�A�A�B�
C�
C�	��r�z�8�9�9��%�%�%�P)�)�)�X;�;�;�	!�	!�	!�!�!�C�!��S�	�!�!�!�!�DJ�J�J�.���J	)�	)�	)�"H�"H�"H�J4F�4F�4F�l.�.�.�.�.r

Youez - 2016 - github.com/yon3zu
LinuXploit