3
��g�` � @ s� d dl mZ d dl mZ d dl mZ d dlZd dlmZ d dlm Z m
Z
d dlmZ d dlZ
d dlZ
d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZejd�ZejjZejjZejjZ ejj!Z"eeB e B e"B Z#d d
� Z$dd� Z%d
d� Z&dd� Z'd*dd�Z(G dd� de)�Z*G dd� de)�Z+G dd� de)�Z,G dd� de,�Z-G dd� de,�Z.G dd� de,�Z/G d d!� d!e,�Z0G d"d#� d#e)�Z1G d$d%� d%e)�Z2G d&d'� d'e)�Z3G d(d)� d)e)�Z4dS )+� )�absolute_import)�print_function)�unicode_literalsN)�
CompsError)�_�ucd)�reduce�dnfc C s" | j | j| jf}ttjtt|��S )N)�
categories�groups�environmentsr �operator�__add__�map�len)�comps�collections� r �/usr/lib/python3.6/comps.py�_internal_comps_length6 s r c C s | d krd S t jj| �S )N)r �util�first)�seqr r r �_first_if_iterable; s r c s� t jj� �� � fdd�|D �}|r&|S |r>tjtj� ��j}ntjtj� �tjd�j}t � }x`|D ]X}||j
�r||j|� qb|jdk r�||j�r�|j|� qb|j
dk rb||j
�rb|j|� qbW |S )z;Return items from sqn matching either exactly or glob-wise.c s$ h | ]}|j � ks|j� kr|�qS r )�name�id)�.0�g)�patternr r �