Your IP : 216.73.216.85
B
A!p\� � @ s d Z ddlZddlmZ ddlZddlZddlZddlZddlZddl Z ddl m
Z
ddl mZ ddl mZ ddl
mZ ddlmZ dd lmZmZmZmZ dd
lmZ ddlmZ ddlmZ e�d
�ZdZe�d�ZejdkZ ddiZ!e"ddh�Z#dZ$dd� Z%dd� Z&edd�dd� �Z'dd� Z(d d!� Z)d"d#� Z*d$d%� Z+d&d'� Z,d(d)� Z-d*d+� Z.d,d-� Z/d.d/� Z0d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEgifdFdGdHdDdIgifdJdKdLdM�Z1e�2dNdO�Z3G dPdQ� dQ�Z4G dRdS� dSe�Z5G dTdU� dUe5�Z6ejdk�r�e6Z5dVdW� Z7dS )Xz#variables checkers for Python code
� N)� lru_cache)�
decorators)�modutils)�objects)�InferenceContext)�is_postponed_evaluation_enabled)�IAstroidChecker� INFERENCE�INFERENCE_FAILURE�HIGH)�get_global_option)�BaseChecker)�utilsz^_{2}[a-z]+_{2}$�
__future__z_.*|^ignored_|^unused_)� r Z_py_abc�abcztyping.TYPE_CHECKINGZ
TYPE_CHECKINGzbuiltins.rangec C s^ y| � | j�}W n tjk
r& dS X x0|j�|g �D ]}t|tj�r8|jtkr8dS q8W dS )z9Check if the name is a future import from another module.NT) �do_import_module�modname�astroid�AstroidBuildingException�locals�get�
isinstance�
ImportFrom�FUTURE)�stmt�name�moduleZ
local_node� r �J/opt/alt/python37/lib/python3.7/site-packages/pylint/checkers/variables.py�_is_from_future_importG s r c s$ t | tj�o"t� fdd�| jD ��S )zEReturns True if stmt in inside the else branch for a parent For stmt.c 3 s | ]}|� � �p|� kV qd S )N)� parent_of)�.0Z else_stmt)r r r � <genexpr>W s z%in_for_else_branch.<locals>.<genexpr>)r r �For�anyZorelse)�parentr r )r r �in_for_else_branchT s r'