관리-도구
편집 파일: fix_unpacking.cpython-311.pyc
� �܋f: � � � d Z ddlmZ ddlmZ ddlmZmZmZm Z m Z mZmZm Z mZmZ ddlmZmZmZ d� Z G d� dej � � 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� commatizec � � g }t | � � }t |� � }| dk r�t t j t |� � t t j t t j d� � t t j t t j d� � t |� � g� � t t j d� � g� � g� � }|� |� � |� t t j dd�� � � � t t j t t j dd�� � t |� � t t j t t j d� � t t j | dk rt |� � nt dd � � t t j d� � |dk rAt t j t t j d � � t |� � g� � nt dd � � g� � t t j d� � t t j d� � g� � g� � }|� |� � |dk �r+|� t t j dd�� � � � t t j t |d�� � t t j t t j d� � t t j t t j t t j d � � t |� � g� � t t j d� � g� � t t j d� � g� � g� � } |� | � � t t j |� � } | 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�sources �r/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/libpasteurize/fixes/fix_unpacking.py�assignment_sourcer5 s � � �H� �'� � �C��8���D� ��{�{��� �T�(�^�^�T�$�,��e�j�Z^�I_�I_�ae�fj�ft�w{� }B� }H� JN� xO� xO� QW� X[� Q\� Q\� w]� b^� b^� `d� ej� eo� qu� `v� `v� Iw� 6x� 6x� %y� z� z������!�!�!�����U�Z��d�;�;�;�<�<�<��T�Z�$�u�z�4��"E�"E�"E�t�H�~�~�W[�\`�\h�ko�pu�pz� }A� lB� lB� DH� IM� IW� ip� st� it� it� Z`� ad� Ze� Ze� Ze� z~� @� BE� zF� zF� HL� MR� MX� Z^� H_� H_� _g� jk� _k� _k� ae� fj� fq� tx� y~� yD� FJ� tK� tK� MS� TX� MY� MY� sZ� a[� a[� a[� qu� vw� y|� q}� q}� Y~� D� D� AE� FK� FP� RV� AW� AW� Y]� ^c� ^h� jn� Yo� Yo� kp� Xq� Xq� "r� s� s�I��O�O�I�����!�|�|�����U�Z��d�;�;�;�<�<�<����d�8�D�&A�&A�&A�4���W[�\a�\f�hl�Wm�Wm�os�tx� uC� FJ� KO� KV� Y]� ^c� ^i� ko� Yp� Yp� rx� y}� r~� r~� X� F@� F@� BF� GL� GR� TX� BY� BY� EZ� p[� p[� ]a� bg� bl� nr� ]s� ]s� Wt� Du� Du� &v� w� w� ���� �"�"�"� �$�/�8� ,� ,�F��M� c �$ � e Zd ZdZd� Zd� Zd� 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 �L �� �fd�dD � � \ }}}}d� |D � � }d|_ d� |D � � }d� t ||� � � gz |z � � D � � }|� t � � � � d|_ t t | j � � t t d� � |� � � g� � � � }t |t t |� � t |� � | j | j � � � � } || fS ) Nc 3 �B �K � | ]}�� |� � V � �d S �N��get��.0�n�resultss �r4 � <genexpr>z4FixUnpacking.fix_explicit_context.<locals>.<genexpr>3 s- �� � � �"a�"a�a�7�;�;�q�>�>�"a�"a�"a�"a�"a�"ar6 )r. �namer/ r3 c �` � g | ]+}|j t j k �|� � � ��,S � ��typer �NAME�clone�r? r@ s r4 � <listcomp>z5FixUnpacking.fix_explicit_context.<locals>.<listcomp>4 �. � �>�>�>�Q���5�:�)=�)=�q�w�w�y�y�)=�)=�)=r6 r c �` � g | ]+}|j t j k �|� � � ��,S rE rF rJ s r4 rK z5FixUnpacking.fix_explicit_context.<locals>.<listcomp>6 �. � �@�@�@�a�1�6�U�Z�+?�+?���� � �+?�+?�+?r6 c �6 � g | ]}|� � � ��S rE �rI rJ s r4 rK z5FixUnpacking.fix_explicit_context.<locals>.<listcomp>7 � � �L�L�L��!�'�'�)�)�L�L�Lr6 r �list)r r rI r$ r r r r+ r r5 �lenr, ) �self�noderA r. rC r/ r3 �target� setup_line� power_lines ` r4 �fix_explicit_contextz!FixUnpacking.fix_explicit_context2 s �� �"a�"a�"a�"a�;`�"a�"a�"a���T�4��>�>�#�>�>�>�����@�@�4�@�@�@��L�L�Y�s�d�j�j�l�l�^�/C�d�/J�%K�%K�L�L�L�� � � �e�g�g������ ��D���/�/��d�7�m�m�f�l�l�n�n�EU�1V�1V�W�W� ��F�$5�c�#�h�h��D� � �4�=�Z^�Zg�$h�$h�i�i� ��:�%�%r6 c �t �� �fd�dD � � \ }}}}d� |D � � }d|_ d� |D � � }d� t ||� � � gz |z � � D � � }|� t � � � � |� � � }d|_ t t | j � � t t d� � 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. c 3 �B �K � | ]}�� |� � V � �d S r; r<