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/libpasteurize/fixes/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/libpasteurize/fixes/__pycache__/fix_unpacking.cpython-310.pyc
o

,�]:�@s~dZddlmZddlmZddlmZmZmZm	Z	m
Z
mZmZm
Z
mZmZddlmZmZmZdd�ZGdd	�d	ej�Zd
S)zD
Fixer for:
(a,)* *b (,c)* [,] = s
for (a,)* *b (,c)* [,] in d: ...
�)�
fixer_base)�count)
�Assign�Comma�Call�Newline�Name�Number�token�syms�Node�Leaf)�indentation�suitify�	commatizecCs�g}t|�}t|�}|dkrCttjt|�ttjttjd�ttj	ttj
d�t|�g�ttjd�g�g�}|�
|�|�
ttjddd��ttjttjddd�t|�ttjttjd�ttj	|dkrct|�ntdd	�ttj
d�|dkr~ttjttjd
�t|�g�ntdd	�g�ttjd�ttjd�g�g�}|�
|�|dkr�|�
ttjddd��ttjt|dd�ttjttjd�ttj	ttjttjd
�t|�g�ttj
d�g�ttjd�g�g�}	|�
|	�ttj|�}
|
S)z�
    Accepts num_pre and num_post, which are counts of values
    before and after the starg (not including the starg)
    Returns a source fit for Assign() from fixer_util
    r�[�:�]�+� ��prefix���-)�unicoderr�powerr�trailerr
r
�LSQB�	subscript�COLONr	�RSQB�append�PLUS�factor�MINUS�
arith_expr)�num_pre�num_post�LISTNAME�ITERNAME�children�pre�post�pre_part�	main_part�	post_part�source�r2�C/usr/lib/python3/dist-packages/libpasteurize/fixes/fix_unpacking.py�assignment_sourcesJ
�
b
r4c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�FixUnpackinga9
    expl=expr_stmt< testlist_star_expr<
        pre=(any ',')*
            star_expr< '*' name=NAME >
        post=(',' any)* [','] > '=' source=any > |
    impl=for_stmt< 'for' lst=exprlist<
        pre=(any ',')*
            star_expr< '*' name=NAME >
        post=(',' any)* [','] > 'in' it=any ':' suite=any>c
s��fdd�dD�\}}}}dd�|D�}d|_dd�|D�}dd�t||��g|�D�}|�t��d	|_tt|j�ttd
�|��g��}t|t	t
|�t
|�|j|j��}	||	fS)Nc3��|]}��|�VqdS�N��get��.0�n��resultsr2r3�	<genexpr>3��z4FixUnpacking.fix_explicit_context.<locals>.<genexpr>)r,�namer-r1cS� g|]}|jtjkr|���qSr2��typer
�NAME�cloner:r2r2r3�
<listcomp>4� z5FixUnpacking.fix_explicit_context.<locals>.<listcomp>rcSrBr2rCr:r2r2r3rG6rHcS�g|]}|���qSr2�rFr:r2r2r3rG7�r�list)rrrFr"rrrr)rr4�lenr*)
�self�noder>r,rAr-r1�target�
setup_line�
power_liner2r=r3�fix_explicit_context2s   z!FixUnpacking.fix_explicit_contextcs��fdd�dD�\}}}}dd�|D�}d|_dd�|D�}dd�t||��g|�D�}|�t��|��}d	|_tt|j�ttd
�t|j	�g��}	t|t
t|�t|�|j|j	��}
|	|
fS)z_
        Only example of the implicit context is
        a for loop, so only fix that.
        c3r6r7r8r:r=r2r3r?Er@z4FixUnpacking.fix_implicit_context.<locals>.<genexpr>)r,rAr-�itcSrBr2rCr:r2r2r3rGFrHz5FixUnpacking.fix_implicit_context.<locals>.<listcomp>rcSrBr2rCr:r2r2r3rGHrHcSrIr2rJr:r2r2r3rGIrKrrL)rrrFr"rrrr)rr*r4rM)rNrOr>r,rAr-rTrPr1rQrRr2r=r3�fix_implicit_context@s " z!FixUnpacking.fix_implicit_contextc
CsD|�d�|_|�d�|_|�d�|�d�}}|durH|�||�\}}|j|_t|j�|_|�t	��|j}|�
�}|�||�|�||�dS|dur�|�||�\}}t
|�dd�|jD�d}	d	|_|	jd
j|_t|	jd�|	jd_|	�dt	��|	�d|�|	�dt	��|	�d|�|�d��t|jd
d��dSdS)a�
        a,b,c,d,e,f,*g,h,i = range(100) changes to
        _3to2list = list(range(100))
        a,b,c,d,e,f,g,h,i, = _3to2list[:6] + [_3to2list[6:-2]] + _3to2list[-2:]

        and

        for a,b,*c,d,e in iter_of_iters: do_stuff changes to
        for _3to2iter in iter_of_iters:
            _3to2list = list(_3to2iter)
            a,b,c,d,e, = _3to2list[:2] + [_3to2list[2:-2]] + _3to2list[-2:]
            do_stuff
        �	_3to2list�	_3to2iter�expl�implNcSsg|]
}|jtjkr|�qSr2)rDr�suite)r;�kr2r2r3rGpsz*FixUnpacking.transform.<locals>.<listcomp>rrr��lstrr)�new_namer)r*r9rSrr�parent�append_childr�remove�insert_childrUrr+�value�replacer)
rNrOr>rXrYrQrRr_�irZr2r2r3�	transformSs2�zFixUnpacking.transformN)�__name__�
__module__�__qualname__�PATTERNrSrUrfr2r2r2r3r5&s

r5N)�__doc__�lib2to3r�	itertoolsr�lib2to3.fixer_utilrrrrrr	r
rrr
�libfuturize.fixer_utilrrrr4�BaseFixr5r2r2r2r3�<module>s0

https://t.me/RX1948 - 2025