File manager - Edit - /home/u478019808/domains/bestandroidphones.store/public_html/static/img/logo/fixes.tar
Back
fix_apply.py 0000644 00000004452 15025176000 0007112 0 ustar 00 # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for apply(). This converts apply(func, v, k) into (func)(*v, **k).""" # Local imports from .. import pytree from ..pgen2 import token from .. import fixer_base from ..fixer_util import Call, Comma, parenthesize class FixApply(fixer_base.BaseFix): BM_compatible = True PATTERN = """ power< 'apply' trailer< '(' arglist< (not argument<NAME '=' any>) func=any ',' (not argument<NAME '=' any>) args=any [',' (not argument<NAME '=' any>) kwds=any] [','] > ')' > > """ def transform(self, node, results): syms = self.syms assert results func = results["func"] args = results["args"] kwds = results.get("kwds") # I feel like we should be able to express this logic in the # PATTERN above but I don't know how to do it so... if args: if (args.type == self.syms.argument and args.children[0].value in {'**', '*'}): return # Make no change. if kwds and (kwds.type == self.syms.argument and kwds.children[0].value == '**'): return # Make no change. prefix = node.prefix func = func.clone() if (func.type not in (token.NAME, syms.atom) and (func.type != syms.power or func.children[-2].type == token.DOUBLESTAR)): # Need to parenthesize func = parenthesize(func) func.prefix = "" args = args.clone() args.prefix = "" if kwds is not None: kwds = kwds.clone() kwds.prefix = "" l_newargs = [pytree.Leaf(token.STAR, "*"), args] if kwds is not None: l_newargs.extend([Comma(), pytree.Leaf(token.DOUBLESTAR, "**"), kwds]) l_newargs[-2].prefix = " " # that's the ** token # XXX Sometimes we could be cleverer, e.g. apply(f, (x, y) + t) # can be translated into f(x, y, *t) instead of f(*(x, y) + t) #new = pytree.Node(syms.power, (func, ArgList(l_newargs))) return Call(func, l_newargs, prefix=prefix) __pycache__/fix_paren.cpython-39.opt-2.pyc 0000644 00000002343 15025176000 0014316 0 ustar 00 a �DOg� � @ s2 d dl mZ d dlmZmZ G dd� dej�ZdS )� )� fixer_base)�LParen�RParenc @ s e Zd ZdZdZdd� ZdS )�FixParenTa atom< ('[' | '(') (listmaker< any comp_for< 'for' NAME 'in' target=testlist_safe< any (',' any)+ [','] > [any] > > | testlist_gexp< any comp_for< 'for' NAME 'in' target=testlist_safe< any (',' any)+ [','] > [any] > >) (']' | ')') > c C s8 |d }t � }|j|_d|_|�d|� |�t� � d S )N�target� � )r �prefixZinsert_childZappend_childr )�selfZnode�resultsr Zlparen� r �//usr/lib64/python3.9/lib2to3/fixes/fix_paren.py� transform% s zFixParen.transformN)�__name__� __module__�__qualname__Z BM_compatibleZPATTERNr r r r r r s r N)r r Z fixer_utilr r ZBaseFixr r r r r �<module> s __pycache__/fix_basestring.cpython-39.opt-2.pyc 0000644 00000001145 15025176000 0015351 0 ustar 00 a �DOg@ � @ s. d dl mZ d dlmZ G dd� dej�ZdS )� )� fixer_base)�Namec @ s e Zd ZdZdZdd� ZdS )� FixBasestringTz'basestring'c C s t d|jd�S )N�str)�prefix)r r )�selfZnode�results� r �4/usr/lib64/python3.9/lib2to3/fixes/fix_basestring.py� transform s zFixBasestring.transformN)�__name__� __module__�__qualname__Z BM_compatibleZPATTERNr r r r r r s r N)� r Z fixer_utilr ZBaseFixr r r r r �<module> s __pycache__/fix_apply.cpython-39.pyc 0000644 00000003173 15025176000 0013400 0 ustar 00 a �DOg* � @ sR d Z ddlmZ ddlmZ ddlmZ ddlmZmZm Z G dd� dej �ZdS ) zIFixer for apply(). This converts apply(func, v, k) into (func)(*v, **k).� )�pytree)�token)� fixer_base)�Call�Comma�parenthesizec @ s e Zd ZdZdZdd� ZdS )�FixApplyTa. power< 'apply' trailer< '(' arglist< (not argument<NAME '=' any>) func=any ',' (not argument<NAME '=' any>) args=any [',' (not argument<NAME '=' any>) kwds=any] [','] > ')' > > c C s4 | j }|sJ �|d }|d }|�d�}|rN|j| j jkrN|jd jdv rNd S |rt|j| j jkrt|jd jdkrtd S |j}|�� }|jtj |j fvr�|j|jks�|jd jtjkr�t |�}d|_|�� }d|_|d ur�|�� }d|_t�tjd �|g}|d u�r&|�t� t�tjd�|g� d |d _t|||d�S )N�func�args�kwds� > �*�**r ���� r � )�prefix)�syms�get�type�argumentZchildren�valuer Zcloner �NAMEZatomZpower� DOUBLESTARr r ZLeaf�STAR�extendr r ) �selfZnode�resultsr r r r r Z l_newargs� r �//usr/lib64/python3.9/lib2to3/fixes/fix_apply.py� transform sH �� �� � zFixApply.transformN)�__name__� __module__�__qualname__Z BM_compatibleZPATTERNr r r r r r s r N)�__doc__r r Zpgen2r r Z fixer_utilr r r ZBaseFixr r r r r �<module> s __pycache__/fix_getcwdu.cpython-39.opt-2.pyc 0000644 00000001315 15025176000 0014651 0 ustar 00 a �DOg� � @ s. d dl mZ d dlmZ G dd� dej�ZdS )� )� fixer_base)�Namec @ s e Zd ZdZdZdd� ZdS )� FixGetcwduTzR power< 'os' trailer< dot='.' name='getcwdu' > any* > c C s |d }|� td|jd�� d S )N�name�getcwd)�prefix)�replacer r )�selfZnode�resultsr � r �1/usr/lib64/python3.9/lib2to3/fixes/fix_getcwdu.py� transform s zFixGetcwdu.transformN)�__name__� __module__�__qualname__Z BM_compatibleZPATTERNr r r r r r s r N)� r Z fixer_utilr ZBaseFixr r r r r �<module> s __pycache__/fix_xreadlines.cpython-39.opt-2.pyc 0000644 00000001731 15025176000 0015347 0 ustar 00 a �DOg� � @ s. d dl mZ d dlmZ G dd� dej�ZdS )� )� fixer_base)�Namec @ s e Zd ZdZdZdd� ZdS )� FixXreadlinesTz� power< call=any+ trailer< '.' 'xreadlines' > trailer< '(' ')' > > | power< any+ trailer< '.' no_call='xreadlines' > > c C s@ |� d�}|r$|�td|jd�� n|�dd� |d D �� d S )N�no_call�__iter__)�prefixc S s g | ]}|� � �qS � )Zclone)�.0�xr r �4/usr/lib64/python3.9/lib2to3/fixes/fix_xreadlines.py� <listcomp> � z+FixXreadlines.transform.<locals>.<listcomp>�call)�get�replacer r )�selfZnode�resultsr r r r � transform s zFixXreadlines.transformN)�__name__� __module__�__qualname__Z BM_compatibleZPATTERNr r r r r r s r N)� r Z fixer_utilr ZBaseFixr r r r r �<module> s __pycache__/fix_reload.cpython-39.pyc 0000644 00000002165 15025176000 0013521 0 ustar 00 a �DOg9 � @ s6 d Z ddlmZ ddlmZmZ G dd� dej�ZdS )z5Fixer for reload(). reload(s) -> importlib.reload(s)� )� fixer_base)� ImportAndCall�touch_importc @ s e Zd ZdZdZdZdd� ZdS )� FixReloadT�prez� power< 'reload' trailer< lpar='(' ( not(arglist | argument<any '=' any>) obj=any | obj=arglist<(not argument<any '=' any>) any ','> ) rpar=')' > after=any* > c C sR |r2|d }|r2|j | jjkr2|jd jdv r2d S d}t|||�}td d|� |S )N�obj� > �*z**)� importlib�reloadr )�typeZsyms�argumentZchildren�valuer r )�selfZnode�resultsr �names�new� r �0/usr/lib64/python3.9/lib2to3/fixes/fix_reload.py� transform s �zFixReload.transformN)�__name__� __module__�__qualname__Z BM_compatible�orderZPATTERNr r r r r r s r N)�__doc__� r Z fixer_utilr r ZBaseFixr r r r r �<module> s __pycache__/fix_long.cpython-39.opt-1.pyc 0000644 00000001274 15025176000 0014151 0 ustar 00 a �DOg� � @ s2 d Z ddlmZ ddlmZ G dd� dej�ZdS )z/Fixer that turns 'long' into 'int' everywhere. � )� fixer_base)�is_probably_builtinc @ s e Zd ZdZdZdd� ZdS )�FixLongTz'long'c C s t |�rd|_|�� d S )N�int)r �value�changed)�selfZnode�results� r �./usr/lib64/python3.9/lib2to3/fixes/fix_long.py� transform s zFixLong.transformN)�__name__� __module__�__qualname__Z BM_compatibleZPATTERNr r r r r r s r N)�__doc__Zlib2to3r Zlib2to3.fixer_utilr ZBaseFixr r r r r �<module> s __pycache__/fix_filter.cpython-39.pyc 0000644 00000004605 15025176000 0013541 0 ustar 00 a �DOg� � @ sZ d Z ddlmZ ddlmZ ddlmZ ddlm Z m Z mZmZm Z G dd� dej�ZdS ) a� Fixer that changes filter(F, X) into list(filter(F, X)). We avoid the transformation if the filter() call is directly contained in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:. NOTE: This is still not correct if the original code was depending on filter(F, X) to return a string if X is a string and a tuple if X is a tuple. That would require type inference, which we don't do. Let Python 2.6 figure it out. � )� fixer_base)�Node)�python_symbols)�Name�ArgList�ListComp�in_special_context�parenthesizec @ s e Zd ZdZdZdZdd� ZdS )� FixFilterTaV filter_lambda=power< 'filter' trailer< '(' arglist< lambdef< 'lambda' (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any > ',' it=any > ')' > [extra_trailers=trailer*] > | power< 'filter' trailer< '(' arglist< none='None' ',' seq=any > ')' > [extra_trailers=trailer*] > | power< 'filter' args=trailer< '(' [any] ')' > [extra_trailers=trailer*] > zfuture_builtins.filterc C sL | � |�rd S g }d|v r6|d D ]}|�|�� � q"d|v r�|�d��� }|jtjkrfd|_t|�}t |�d��� |�d��� |�d��� |�}t tj|g| dd�}n�d|v r�t td �td �|d �� td ��}t tj|g| dd�}nTt |�r�d S |d �� }t tjtd�|gdd�}t tjtd �t|g�g| �}d|_|j|_|S )NZextra_trailersZ filter_lambda�xp� �fp�it)�prefixZnoneZ_f�seq�args�filter�list)Zshould_skip�appendZclone�get�type�syms�testr r r r Zpowerr r r )�selfZnode�resultsZtrailers�tr �newr � r �0/usr/lib64/python3.9/lib2to3/fixes/fix_filter.py� transform: s>