Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/prospector/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/prospector/__pycache__/blender.cpython-37.pyc

B

a�\-�@sFddlmZddlZddlZdZd
dd�Zddd�Zdd	�Ze�ZdS)�)�defaultdictN)�blend�BLEND_COMBOSc
s��pt�dd�tt���D�}g}xZ|D]R}|j|jf}d}x.t��D]"\�}||krFd}|��|�qFW|s(|�|�q(Wxnt|�D]b\�}t|�dkr�q�|j��fdd�d�|d|kr�|�|d�x|d	d
�D]
}	d|	_q�Wq�Wdd�|D�S)z�
    Given a list of messages on the same line, blend them together so that we
    end up with one message per actual problem. Note that we can still return
    more than one message here if there are two or more different errors for
    the line.
    cSsg|]}g�qS�r)�.0�_rr�C/opt/alt/python37/lib/python3.7/site-packages/prospector/blender.py�
<listcomp>szblend_line.<locals>.<listcomp>FTrcs���|j|jf�S)N)�index�source�code)�msg)�blend_combo_idx�blend_combosrr�<lambda>9szblend_line.<locals>.<lambda>)�key�NcSsg|]}t|dd�s|�qS)�usedF)�getattr)r�mrrrr	Ms)	r�range�lenrr�	enumerate�append�sortr)
�messagesrZblend_listsZblended�messager�foundZblend_comboZ
blend_listZnow_usedr)rrr�
blend_lines,
rcCsv|pt}tdd��}x&|D]}||jj|jj�|�qWg}x0|��D]$}x|��D]}|t||�7}qXWqJW|S)NcSstt�S)N)r�listrrrrrT�zblend.<locals>.<lambda>)rr�location�path�liner�valuesr)rrZmsgs_groupedr�outZby_lineZmessages_on_linerrrrPs

rcCsdt�t�td��}|�dg�}g}x8|D]0}g}x|D]}||��7}q6W|�t|��q(Wt|�S)Nzblender_combinations.yaml�combinations)	�yamlZ	safe_load�
pkg_resources�resource_string�__name__�get�itemsr�tuple)Zcombos�defaultsZcomboZtoblendr
rrr�get_default_blend_combinationsds

r/)N)N)	�collectionsrr(r'�__all__rrr/rrrrr�<module>s
=