3
�ft`T � @ sZ d dl mZ d dl mZ d dl mZ d dlmZ ddddd �Zd
d� ZG dd
� d
e�Z dS )� )�absolute_import)�print_function)�unicode_literals)�reduce� � � � )�nameZsummary�descriptionZurlc C s" t | �}dg|| t| � }|S )z, Ordered sset with empty strings prepended. � )�len�sorted)ZssetZlengthZcurrent�l� r �#/usr/lib/python3.6/match_counter.py�_canonize_string_set" s r c @ sf e Zd ZdZedd� �Zdd� Zdd� Zdd � Zd
d� Z dd
� Z
dd� Zdd� Zddd�Z
dd� ZdS )�MatchCounterz�Map packages to which of their attributes matched in a search against
what values.
The mapping is: ``package -> [(key, needle), ... ]``.
c s � fdd�}t t||��S )Nc s> | d }| d }t � |�}|dkr6||kr6dt| S t| S )Nr r r
r )�getattr�WEIGHTS)�match�key�needleZhaystack)�pkgr r �weight4 s
z*MatchCounter._eval_weights.