§
    Â&=d·  ã                   ó0   — d dl Z ddlmZ dd„Zdd„Zd„ ZdS )	é    Né   )Ú
exceptionsc                 ób  — | €dS 	 t          j        |t           j        t           j        z  ¦  «        }n# t          $ r t
          j        ‚w xY wg }|€)t          t          t          | ¦  «        ¦  «        ¦  «        }|D ]2}| 
                    | |         ¦  «        r|                     |¦  «         Œ3|S )am  
    Use the pattern_str to find any match in a list of strings

    This is a helper function for :func:`egrep_hierarchy`.

    Note that this function is never called with the `subindex`
    parameter set.

    Parameters
    ----------
    strlist : [str, ...]
        list of strings in which to look for the pattern
    pattern_str : str
        regular expression pattern
    subindex : [int, ...]
        list of indexes of strings in strlist, specifying the elements
        in which to look for the pattern

    Returns
    -------
    [int, ...]
        a list of indexes for the matches in the origin list
    N)ÚreÚcompileÚIÚMÚ	Exceptionr   ÚInvalidRegexÚlistÚrangeÚlenÚsearchÚappend)ÚstrlistÚpattern_strÚsubindexÚpatÚ
resultlistÚis         ú5/usr/lib/python3/dist-packages/reportbug/hiermatch.pyÚ
egrep_listr   
   s¼   € ð0 €Øˆtð&ÝŒj˜¥b¤d­R¬T¡kÑ2Ô2ˆˆøÝð &ð &ð &ÝÔ%Ð%ð&øøøð €JØÐÝ��c '™lœlÑ+Ô+Ñ,Ô,ˆØð !ð !ˆØ�:Š:�g˜a”jÑ!Ô!ð 	!Ø×Ò˜aÑ Ô Ð øØÐs	   †,3 ³A
c                 ó  — g }t          t          | ¦  «        ¦  «        D ]d}|r/||         r$t          | |         |         |||         ¦  «        }ng }nt          | |         |         |¦  «        }|                     |¦  «         Œe|S )aØ  
    Grep the nth item of a hierarchy [(x, [a, b]),...]

    This is a helper function for :func:`matched_hierarchy`.

    Note that this function is never called with the `subhier` and `nth`
    parameters set.

    Parameters
    ----------
    hier : [(str, [str, ...]), (str, [str, ...]), ...]
        list of tuples with severity and bug list
    pattern_str : str
        regular expression pattern
    subhier : [[int, ...], ...], optional
        subhierarchy indices
    nth : int, optional
        should always be 1 (one)

    Returns
    -------
    [[int, ...], [int, ...], ...]
        a subhierarchy (for each severity in the input hierarchy, the
        list of indexes of the bugs matching the pattern_str)
    )r   r   r   r   )Úhierr   ÚsubhierÚnthÚ
resulthierr   r   s          r   Úegrep_hierarchyr   3   s”   € ð4 €Jå•3�t‘9”9ÑÔð 	&ð 	&ˆØð 	?Ø�qŒzð  Ý'¨¨Q¬°¬°kÀ7È1Ä:ÑNÔN�
�
à�
�
å# D¨¤G¨C¤L°+Ñ>Ô>ˆJà×Ò˜*Ñ%Ô%Ð%Ð%ØÐó    c                 óì   ‡ ‡— g }t          ‰ |¦  «        }t          t          |¦  «        ¦  «        D ]BŠ|‰         r8ˆ ˆfd„|‰         D ¦   «         }|                     ‰ ‰         d         |f¦  «         ŒC|S )aª  
    Create a new hierarchy from a pattern matching

    Parameters
    ----------
    hier : [(str, [str, ...]), (str, [str, ...]), ...]
        list of tuples with severity and bug list
    pattern_str : str
        regular expression pattern

    Returns
    -------
    [(str, [str, ...]), (str, [str, ...]), ...]
        list of tuples with severity and bug list, only including bugs
        matching the pattern_str
    c                 ó8   •— g | ]}‰‰         d          |         ‘ŒS )r   © )Ú.0Úyr   r   s     €€r   ú
<listcomp>z%matched_hierarchy.<locals>.<listcomp>q   s%   ø€ Ð5Ð5Ð5 a�D˜”G˜A”J˜q”MÐ5Ð5Ð5r   r   )r   r   r   r   )r   r   ÚmhierÚresultÚitemr   s   `    @r   Úmatched_hierarchyr)   \   sˆ   øø€ ð" €EÝ˜T ;Ñ/Ô/€FÝ•3�v‘;”;ÑÔð -ð -ˆØ�!Œ9ð 	-Ø5Ð5Ð5Ð5Ð5¨6°!¬9Ð5Ñ5Ô5ˆDØ�LŠL˜$˜qœ' !œ* dÐ+Ñ,Ô,Ð,øØ€Lr   )N)Nr   )r   Ú r   r   r   r)   r"   r   r   ú<module>r+      se   ðð 
€	€	€	Ø Ð Ð Ð Ð Ð ð&ð &ð &ð &ðR&ð &ð &ð &ðRð ð ð ð r   