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/libfuturize/__pycache__/ |
Upload File : |
o ,�]VD � @ s\ d Z ddlmZmZmZmZmZmZ ddlm Z m Z ddlmZ mZ ddlmZ ddlm Z mZmZm Z mZmZ ddlZdd � Zd4d d�Zd4dd �Zd4dd�Zdd� Zdd� Zdd� Zdd� Zd5dd�Ze je je je j e j!fZ"e j#e j$fZ%dd� Z&d4dd�Z'dd� Z(d d!� Z)d"d#� Z*d$d%� Z+d&d'� Z,d(d)� Z-d*d+� Z.d,Z/d-Z0d.d/� Z1d0d1� Z2d4d2d3�Z3dS )6z� Utility functions from 2to3, 3to2 and python-modernize (and some home-grown ones). Licences: 2to3: PSF License v2 3to2: Apache Software License (from 3to2/setup.py) python-modernize licence: BSD (from python-modernize/LICENSE) � )� FromImport�Newline� is_import� find_root�does_tree_import�Comma)�Leaf�Node)�python_symbols�python_grammar)�token)r �Call�Name�symsr �NumberNc sx d� v r� S � � d�r� dd� � � fdd�|D �}t|�dkr.tdd �d d� |D �� ��t|�dkr8td ��|d S )al Examples: >>> canonical_fix_name('fix_wrap_text_literals') 'libfuturize.fixes.fix_wrap_text_literals' >>> canonical_fix_name('wrap_text_literals') 'libfuturize.fixes.fix_wrap_text_literals' >>> canonical_fix_name('wrap_te') ValueError("unknown fixer name") >>> canonical_fix_name('wrap') ValueError("ambiguous fixer name") z.fix_�fix_� Nc s g | ]}|� d �� ��r|�qS )zfix_{0})�endswith�format)�.0�f��fix� �8/usr/lib/python3/dist-packages/libfuturize/fixer_util.py� <listcomp>( s �z&canonical_fix_name.<locals>.<listcomp>� zOAmbiguous fixer name. Choose a fully qualified module name instead from these: � c s s � | ]}d | V qdS )z Nr )r �myfr r r � <genexpr>- s � z%canonical_fix_name.<locals>.<genexpr>r z1Unknown fixer. Use --list-fixes or -l for a list.)� startswith�len� ValueError�join)r �avail_fixes�foundr r r �canonical_fix_name s �r&