403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.25
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 :  /lib/python3/dist-packages/pythran/transformations/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/pythran/transformations/__pycache__/handle_import.cpython-311.pyc
�

cR�a9 ���dZddlmZddlmZmZddlmZddlZ	ddl
Z
ddlZe
jd��Z
d�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�ZGd�de��ZdS)zIHandleImport transformation takes care of importing user-defined modules.�)�Transformation)�MODULES�pythran_ward)�PythranSyntaxErrorN�pythranc�B�tj|��D]	}||_�
dS�N)�ast�walk�filename)�noder�
descendants   �G/usr/lib/python3/dist-packages/pythran/transformations/handle_import.py�add_filename_fieldr
s.���h�t�n�n�'�'�
�&�
���'�'�c�J�tdz|�dd��zdzS)N�
imported__�.�$)r�replace��module_names r�mangle_imported_modulers'���,�&��)<�)<�S�#�)F�)F�F��L�Lrc�&�t|��|zSr	)r)r�	func_names  r�mangle_imported_functionrs��!�+�.�.��:�:rc�h�|ttdz��d��dd��S)Nr���rr)�lenrr��names r�demangler"s/����L�<�/�0�0��3�4�<�<�S�#�F�F�Frc� �|tdvS)z9Test if a function is a builtin (like len(), map(), ...).�builtins)r)rs r�is_builtin_functionr%s����
�+�+�+rc�J�|�d��d}|tvS)z8Test if a module is a builtin module (numpy, math, ...).rr)�splitrrs r�is_builtin_moduler(#s%���#�#�C�(�(��+�K��'�!�!rc�,�|�d��S)Nr)�endswithr s r�is_mangled_moduler+)s���=�=����rc��|�dtjj��dz}|�|dks
Jd���|}n3tjj�|gdg|dz
zz|gz��}	t|d��5}ddlm}||�����}t||dz��|cddd��S#1swxYwYdS#t$r#td	�|�����wxYw)
Nrz.pyrz+Cannot use relative path without module_dirz..��r)�	raw_parsezModule '{}' not found.)
r�os�path�sep�join�open�pythran.frontendr/�readr�IOErrorr�format)r!�
module_dir�level�module_base�module_file�fpr/r
s        r�	getsourcer>-si���,�,�s�B�G�K�0�0�5�8�K�����z�z�z�H�z�z�z�!����g�k�&�&����v����7K�(K�+6�-�)8�:�:��0�
�+�s�
#�
#�	�r�2�2�2�2�2�2��9�R�W�W�Y�Y�'�'�D��t�T�E�\�2�2�2��		�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	��
�0�0�0� �!9�"(�&��,�,�0�0�	0�0���s0�2C�8C�:C�C�C�C�C�-Dc���eZdZdZ�fd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZeZeZ
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Z�xZS)�HandleImportz�This pass handle user-defined import, mangling name for function from
    other modules and include them in the current module, patching all call
    site accordingly.
    c���tt|�����ig|_t	��|_dg|_dS)N�)�superr@�__init__�identifiers�set�imported�prefixes)�self�	__class__s �rrDzHandleImport.__init__HsA���
�l�D�!�!�*�*�,�,�,��4�������
����
�
�
rc�P�t|j��D]}||vr
||cS�dSr	)�reversedrE)rIr!�renamings   r�lookupzHandleImport.lookupNsA�� ��!1�2�2�	&�	&�H��x�����~�%�%�%� ��trc��||jvSr	)rG)rIr!s  r�is_importedzHandleImport.is_importedTs���t�}�$�$rc�~�t��|_|�|��|j|jz|_|Sr	)�list�imported_stmts�
generic_visit�body�rIr
s  r�visit_ModulezHandleImport.visit_ModuleWs8��"�f�f������4� � � ��'�$�)�3��	��rc��t||��}|jd|z}t|||��||jd|<dS�Nr)�getattrrH�setattrrE)rIr
�attr�	prev_name�new_names     r�renamezHandleImport.rename]sL���D�$�'�'�	��=��$�y�0����d�H�%�%�%�*2�����Y�'�'�'rc�$�|jD]�}t|tj��r|�|d���3t|tj��r:|jD]2}t|tj��r|�|d���3��dS)Nr!�id)rU�
isinstancer
�FunctionDefr_�Assign�targets�Name)rIr
�stmt�targets    r�rename_top_level_functionsz'HandleImport.rename_top_level_functionscs����I�	2�	2�D��$���0�0�
2����D�&�)�)�)�)��D�#�*�-�-�
2�"�l�2�2�F�!�&�#�(�3�3�2����F�D�1�1�1���
	2�	2rc��|j�i��|�|��|j���|Sr	)rE�appendrT�poprVs  r�visit_FunctionDefzHandleImport.visit_FunctionDeflsG�������#�#�#����4� � � ���������rc�x�|jD]}|�|���|�|j��|Sr	)�
generators�visit�elt�rIr
�	generators   r�visit_ListCompzHandleImport.visit_ListComprsA����	"�	"�I��J�J�y�!�!�!�!��
�
�4�8�����rc��|jD]}|�|���|�|j��|�|j��|Sr	)rorp�key�valuerrs   r�visit_DictCompzHandleImport.visit_DictComp|sU����	"�	"�I��J�J�y�!�!�!�!��
�
�4�8�����
�
�4�:�����rc��|�|j��|jD]}|�|���|�|j��|Sr	)rp�iter�ifsrh)rIr
�if_s   r�visit_comprehensionz HandleImport.visit_comprehension�sQ���
�
�4�9�����8�	�	�C��J�J�s�O�O�O�O��
�
�4�;�����rc�x�|�|j��|jD]}|�|���|Sr	)rprwre)rIr
rhs   r�visit_assignzHandleImport.visit_assign�sA���
�
�4�:�����l�	�	�F��J�J�v������rc�~�t|jtj��s|�|��S|�|jj��}|s|�|��St|��s|�|��Std�|j	D����rtd|���|S)Nc3�LK�|]}t|tj��V�� dSr	)rbr
rf)�.0rhs  r�	<genexpr>z,HandleImport.visit_Assign.<locals>.<genexpr>�s1����K�K�F�:�f�c�h�/�/�/�K�K�K�K�K�KrzInvalid module assignment)rbrwr
rfrrNrar+�anyrer�rIr
rMs   r�visit_AssignzHandleImport.visit_Assign�s����$�*�c�h�/�/�	+��$�$�T�*�*�*��;�;�t�z�}�-�-���	+��$�$�T�*�*�*� ��*�*�	+��$�$�T�*�*�*��K�K�d�l�K�K�K�K�K�	H�$�%@�$�G�G�G��rc���t|jtj��r@|�|jj��}|rt
|��rtd|���|�|��S)NzInvalid module call)	rb�funcr
rfrNrar+rrTr�s   r�
visit_CallzHandleImport.visit_Call�sm���d�i���*�*�	F��{�{�4�9�<�0�0�H��
F�-�h�7�7�
F�(�)>��E�E�E��!�!�$�'�'�'rc�v�t|jtj��r$|�|j��}|r||_nut|jtjtjf��r|j|jd|j<n/t|jtj	��rnt|���|SrY)rb�ctxr
�LoadrNra�Store�ParamrE�Del�NotImplementedErrorr�s   r�
visit_NamezHandleImport.visit_Name�s����d�h���)�)�		,��{�{�4�7�+�+�H��
#�"����
���3�9�c�i�"8�
9�
9�	,�,0�G�D��R� ���)�)�
���#�'�
*�
*�	,��%�d�+�+�+��rc��t|jtj��s|S|j}t|tj��r!|j}t|tj���!t|tj��s|S|�|j��}|s|St|��s|St|��}t|��r|S|�|j��}|}d}t|tj��r.|j}d|jz|z}t|tj���.tj||dd�z|jdd��S)NrBrr-)
rbr�r
r�rw�	AttributerfrNrar+r"r(r\)rIr
�rootrM�base_module�suffixs      r�visit_AttributezHandleImport.visit_Attribute�sL���$�(�C�H�-�-�	��K��z����s�}�-�-�	��:�D���s�}�-�-�	��$���)�)�	��K��;�;�t�w�'�'���	��K� ��*�*�	��K��x�(�(���[�)�)�	��K��;�;�t�w�'�'��������s�}�-�-�	.��:�D��4�9�_�v�-�F���s�}�-�-�	.��x��6�!�"�"�:�-�t�x��t�D�D�Drc��|j�|��t||jj|��}|j�t|����|j�i��|�	|��|�
|��|j���|j���|jSr	)
rG�addr>�passmanagerr9rHrkrrErirTrlrU)rIr�module_level�module_nodes    r�
import_modulezHandleImport.import_module�s����
���+�&�&�&��� $� 0� ;� ,�.�.��	
�
���3�K�@�@�A�A�A������#�#�#��'�'��4�4�4����;�'�'�'��
���������������rc���|jdkrdSt|j��r*|jD] }|jp|j}||jd|<�!|S|jD]8}|jp|j}t
|j|j��|jd|<�9|�|j��rdS|�|j|j	��}|j
�|��dS)N�
__future__r)�moduler(�names�asnamer!rErrPr�r:rS�extend)rIr
�aliasr!�	new_stmtss     r�visit_ImportFromzHandleImport.visit_ImportFrom�s����;�,�&�&��4��T�[�)�)�		-���
2�
2���|�1�u�z��-1�� ��$�T�*�*��K���
-�
-���|�1�u�z��-E��K���.-�.-�� ��$�T�*�*����D�K�(�(�	��4��&�&�t�{�D�J�?�?�	���"�"�9�-�-�-��trc�p�g}|jD]�}|jp|j}t|j��|jd|<|j|jvr�At
|j��r|�|���k|�|jd��}|j	�
|����|r	||_|SdS)Nrr)r�r�r!rrErGr(rkr�rSr�)rIr
�new_aliasesr�r!r�s      r�visit_ImportzHandleImport.visit_Import�s������Z�
	2�
	2�E��<�-�5�:�D�)?��
�)K�)K�D��R� ��&��z�T�]�*�*�� ���,�,�
��"�"�5�)�)�)���*�*�5�:�q�9�9�I���&�&�y�1�1�1�1��	�$�D�J��K��4r)�__name__�
__module__�__qualname__�__doc__rDrNrPrWr_rirmrt�
visit_SetComp�visit_GeneratorExprxr}rr�r�r�r�r�r�r��
__classcell__)rJs@rr@r@AsR���������
��������%�%�%����3�3�3�2�2�2�������#�M�'�������������� (�(�(����E�E�E�B � � ����.������rr@)r��pythran.passmanagerr�pythran.tablesrr�pythran.syntaxr�gastr
�loggingr0�	getLogger�loggerrrrr"r%r(r+r>r@�rr�<module>r�s3��O�O�.�.�.�.�.�.�0�0�0�0�0�0�0�0�-�-�-�-�-�-���������	�	�	�	�	��	�9�	%�	%��'�'�'�
M�M�M�;�;�;�G�G�G�,�,�,�
"�"�"����0�0�0�(J�J�J�J�J�>�J�J�J�J�Jr

Youez - 2016 - github.com/yon3zu
LinuXploit