관리-도구
편집 파일: fix_kwargs.cpython-37.opt-1.pyc
B �A�[g � @ s� d Z ddlmZ ddlmZmZmZmZmZ ddl m Z mZmZ dZ dZdZdZd d � Zefdd�Zefd d�ZG dd� dej�ZdS )zg Fixer for Python 3 function parameter syntax This fixer is rather sensitive to incorrect py3k syntax. � )� fixer_base)�token�String�Newline�Comma�Name)�indentation�suitify� DoubleStarz=%(name)s = %(kwargs)s['%(name)s']; del %(kwargs)s['%(name)s']z'if '%(name)s' in %(kwargs)s: %(assign)szelse: %(name)s = %(default)sZ_3to2kwargsc c s� | d j tjkrt| �dks t�d}t| �}x�||k r�| | }|j}|j tjkrZ|d7 }q.|dk rp|j tjkrpP |j}|j }|dk r�|j tj kr�|j }|d7 }nd}||fV |d7 }q.W dS )z� Generator that yields tuples of (name, default_value) for each parameter in the list If no default is given, then it is default_value is None (not Leaf(token.NAME, 'None')) r � � N)�typer �STAR�len�AssertionErrorZprev_sibling�NAME� DOUBLESTAR�valueZnext_sibling�EQUAL)� raw_paramsZcurr_idxZmax_idxZ curr_itemZ prev_item�nameZnxt� default_value� r �O/opt/alt/python37/lib/python3.7/site-packages/libpasteurize/fixes/fix_kwargs.py� gen_params s&