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 : |
o ,�]: � @ s~ d Z ddlmZ ddlmZ ddlmZmZmZm Z m Z mZmZm Z mZmZ ddlmZmZmZ dd� ZG dd � 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� commatizec C s� g }t | �}t |�}| dkrCttjt|�ttjttjd�ttj ttj d�t|�g�ttjd�g�g�}|� |� |� ttjddd�� ttjttjddd�t|�ttjttjd�ttj | dkrct|�ntdd �ttj d�|dkr~ttjttjd �t|�g�ntdd �g�ttjd�ttjd�g�g�}|� |� |dkr�|� ttjddd�� ttjt|dd�ttjttjd�ttj ttjttjd �t|�g�ttj d�g�ttjd�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_source s J � b r4 c @ s( e Zd ZdZdd� 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 )Nc 3 � � | ]}� � |�V qd S �N��get��.0�n��resultsr2 r3 � <genexpr>3 � � z4FixUnpacking.fix_explicit_context.<locals>.<genexpr>)r, �namer- r1 c S � g | ]}|j tjkr|�� �qS r2 ��typer �NAME�cloner: r2 r2 r3 � <listcomp>4 � z5FixUnpacking.fix_explicit_context.<locals>.<listcomp>r c S rB r2 rC r: r2 r2 r3 rG 6 rH c S � g | ]}|� � �qS r2 �rF r: r2 r2 r3 rG 7 � r �list)r r rF r"