§
    4P„jF`  ã                   ó`  — d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
mZ d dlmZmZmZmZ d dlmZ d dlmZ d dlZej                             d¦  «        Zej                             dej                             ed¦  «        ¦  «        Z ej        d	¦  «        Z G d
„ d¦  «        Z	 	 d9dede de!dee"ee"         f         fd„Z#dededefd„Z$dee"         defd„Z%	 d:dee"         deee"                  dee"         fd„Z&d;d„Z'de(de(fd „Z)d!„ Z*d<d#e"d$e!fd%„Z+d=d&„Z,de"d'e"de"fd(„Z-de"d'e"dee"         fd)„Z.dee"         fd*„Z/d+„ Z0d,„ Z1d=d-„Z2d:d.„Z3d/e"dee"         fd0„Z4dee"         fd1„Z5d'e"dee"         fd2„Z6dee"         fd3„Z7dee"         fd4„Z8d:d5„Z9d6„ Z:d7d8l;m<Z<m=Z= dS )>é    N)Údefaultdict)ÚListÚOptionalÚSequenceÚDict)Ú	Namespace)Útabulateú~Ú	SACREBLEUz
.sacrebleuÚ	sacrebleuc                   ó6   — e Zd ZdZedededefd„¦   «         ZdS )ÚColorTÚmsgÚcolorÚreturnc                 ó®   — t           j        s| S t          t          j        |                     ¦   «         d¦  «        }|r|› | › t          j        j        › �S | S )a
  Returns a colored version of the given message string.

        :param msg: The string to Color.format.
        :param color: The color specifier i.e. 'red', 'blue', 'green', etc.
        :return: A colored version of the string if the output is a terminal.
        N)r   ÚENABLE_COLORSÚgetattrÚcoloramaÚForeÚupperÚStyleÚ	RESET_ALL)r   r   Ú	_ansi_strs      úT/root/disk_3tb/conda_envs/Huy-visual/lib/python3.11/site-packages/sacrebleu/utils.pyÚformatzColor.format"   sX   € õ Ô"ð 	ØˆJÝ�HœM¨5¯;ª;©=¬=¸$Ñ?Ô?ˆ	Øð 	AØÐ@ Ð@¥h¤nÔ&>Ð@Ð@Ð@àˆ
ó    N)Ú__name__Ú
__module__Ú__qualname__r   ÚstaticmethodÚstrr   © r   r   r   r      sL   € € € € € Ø€Màð�Cð  ð ¨ð ð ð ñ „\ðð ð r   r   é   TÚscoresÚwidthÚ	multiliner   c           
      ó´  — d|                       d¦  «        i}|rdnd}d}dt          fd„}|                      ¦   «         D ]˜\  }}g }	|D ]‚}
t          |
t          ¦  «        sT|
j        d|› d�›}|
j        �"d
}|d|
j        d|› d�›d|
j        d|› d�›d�z  }|
j        �|| ||
j        ¦  «        z   z  }n|
}|	 	                    |¦  «         Œƒ|r|dz  }|	||<   Œ™|S )z,Formats the scores prior to tabulating them.ÚSystemú
ú FÚpc                 ó\   — d| d›d�}| dk    rt                                |d¦  «        S |dz   S )Nz(p = z.4fú)gš™™™™™©?ÚredÚ*)r   r   )r,   r   s     r   Ú_color_p_valuez+_format_score_lines.<locals>._color_p_value;   s<   € Ø�aÐÐÐÐˆØˆtŠ8ˆ8Ý—<’<  UÑ+Ô+Ð+Ø�S‰yÐr   ú.ÚfNTz (u    Â± r.   u    (Î¼ Â± 95% CI))
ÚpopÚfloatÚitemsÚ
isinstancer"   ÚscoreÚmeanÚciÚp_valueÚappend)r%   r&   r'   Ú
new_scoresÚp_val_break_charÚis_bootstrapr1   ÚmetricÚvalsÚnew_valsÚresultÚ_strs               r   Ú_format_score_linesrE   3   sV  € ð ˜FŸJšJ xÑ0Ô0Ð1€JØ(Ð1�t�t¨cÐØ€Lð�%ð ð ð ð ð Ÿš™œð &ð &‰ˆ�Øˆàð 	"ð 	"ˆFÝ˜f¥cÑ*Ô*ð 
à œ,Ð2¨Ð2Ð2Ð2Ð2�Ø”;Ð*Ø#'�LØÐR ¤ÐR¨uÐRÐRÐRÐRÐR¸F¼IÐRÈÐRÐRÐRÐRÐRÐRÑR�DØ”>Ð-ØÐ,¨~¨~¸f¼nÑ/MÔ/MÑMÑM�Døð �à�OŠO˜DÑ!Ô!Ð!Ð!àð 	(àÐ'Ñ'ˆFà%ˆ
�6ÑÐàÐr   ÚresultsÚ
signaturesÚargsc                 ó¸	  — |j         dk    �rg }t          |                      ¦   «         ¦  «        }t          t	          | d         ¦  «        ¦  «        D ]±}i }| d         |         |d<   t          dt	          |¦  «        ¦  «        D ]i}t          | ||                  |         t          ¦  «        r| ||                  |         |||         <   ŒG| ||                  |         j        |||         <   Œj|                     |¦  «         Œ²t          t          j        |d¬¦  «        ¦  «         dS |j         }|dv rd	}n|d
k    rd}t          | |j        |d	k    ¬¦  «        } i }	d}
d}|                      ¦   «         D ]”}| |         }|d                              d¦  «        s|
rI|d                              d¦  «        r|d         }d}
t                                |d         d¦  «        |d<   | |         |	t                                |d¦  «        <   Œ•t!          |	d|dddd|j        › d�¬¦  «        }t          |¦  «         t          ¦   «          |j        p|j        }|�r'|j        rdnd}|j        r|j        n|j        }|j        rdnd}d|› d|› d |› �}t                                d!d¦  «        }t                                |d¦  «        }t                                d"d#¦  «        }t                                d$d%¦  «        }t          d&t	          |¦  «        z  d'z   |z   d'z   d&t	          |¦  «        z  z   ¦  «         t          d(|› d�¦  «         |j        rt          d)¦  «         nt          d*¦  «         t          ¦   «          t          d+|› d,|› d-�¦  «         t          d.|› d/�¦  «         t          d0¦  «         t          d1|                     ¦   «         › d2�¦  «         t          ¦   «          t          d3|                     ¦   «         › d4�¦  «         t          d5¦  «         t          d6|› d�¦  «         t          d7|› d�¦  «         t          ¦   «          t          d8|› d9�¦  «         t          d:¦  «         t          ¦   «          t          d;¦  «         t          d<¦  «         t          d;¦  «         |                     ¦   «         D ]\  }}t          d+|d=›d |› �¦  «         ŒdS )>zEPrints out a nicely formatted table for multi-system evaluation mode.Újsonr)   Úsystemé   é   )ÚindentNÚtextÚ
fancy_gridÚlatexÚlatex_booktabs)r'   FÚ r   z	Baseline:TÚyellowÚcyanÚkeys)ÚrightÚcenterr2   r3   )ÚheadersÚtablefmtÚcolalignÚstralignÚnumalignÚfloatfmtzbootstrap resamplingzapproximate randomizationzresampling trialsÚtrialszPaired z test with r+   ÚbaselinezNull hypothesisÚgreenzhighlighted in redr/   ú-r*   z' - Each system is pairwise compared to z]   Actual system score / bootstrap estimated true mean / 95% CI are provided for each metric.z3   Actual system score is provided for each metric.z - z: the system and the z translations are essentiallyzH   generated by the same underlying process. For a given system and the ú,zR   the p-value is roughly the probability of the absolute score difference (delta)zD   or higher occurring due to chance, under the assumption that the z is correct.z2 - Assuming a significance threshold of 0.05, the z can be rejectedz`   for p-values < 0.05 (marked with "*"). This means that the delta is unlikely to be attributedzE   to chance, hence the system is significantly "different" than the z   Otherwise, the p-values are zJ - NOTE: Significance does not tell whether a system is "better" than the z but ratherzY   emphasizes the "difference" of the systems in terms of the replicability of the delta.z-----------------zMetric signaturesz<10)r   ÚlistrV   ÚrangeÚlenr7   r"   Ú__dict__r<   ÚprintrJ   ÚdumpsrE   r&   Ú
startswithr   r	   Ú	paired_bsÚ	paired_arÚpaired_bs_nÚpaired_ar_nÚlowerr6   )rF   rG   rH   Úproper_jsonÚ	dict_keysÚiÚvalueÚjrZ   Únew_dictÚhas_baselineÚbaseline_nameÚnameÚvalÚtableÚ	is_pairedÚ	test_typeÚn_samples_or_trialsÚtest_sample_typer   ÚblineÚ
bline_nameÚnull_hypÚ
pval_colorÚsigs                            r   Úprint_results_tabler„   \   sZ  € ð „{�fÒÑØˆÝ˜Ÿš™œÑ(Ô(ˆ	Ý•s˜7 8Ô,Ñ-Ô-Ñ.Ô.ð 
	&ð 
	&ˆAØˆEØ% hÔ/°Ô2ˆE�(‰Oå˜1�c )™nœnÑ-Ô-ð Lð L�Ý˜g i°¤lÔ3°AÔ6½Ñ<Ô<ð LØ*1°)¸A´,Ô*?ÀÔ*B�E˜) Aœ,Ñ'Ð'ð +2°)¸A´,Ô*?ÀÔ*BÔ*K�E˜) Aœ,Ñ'Ð'Ø×Ò˜uÑ%Ô%Ð%Ð%å�dŒj˜¨QÐ/Ñ/Ô/Ñ0Ô0Ð0ØˆàŒ{€HØ�FÐÐØˆˆØ	�WÒ	Ð	à#ˆõ "Ø�” x°<Ò'?ðAñ Aô A€Gð €Hð €LØ€MØ—’‘”ð =ð =ˆØ�dŒmˆØˆqŒ6×Ò˜[Ñ)Ô)ð 	4¨\ð 	4Ø�1Œv× Ò  Ñ-Ô-ð 'Ø # A¤�ØˆLÝ—\’\ # a¤&¨(Ñ3Ô3ˆC�‰FØ/6°t¬}ˆ•—’˜d FÑ+Ô+Ñ,Ð,õ Ø˜&¨8ØØØØ"�T”ZÐ"Ð"Ð"ð$ñ $ô $€Eõ 
ˆ%�L„L€LÝ	�G„G€Gà”Ð0 $¤.€Iàñ Ø.2¬nÐ]Ð*Ð*ÐB]ˆ	Ø26´.ÐV˜dÔ.Ð.ÀdÔFVÐØ26´.ÐNÐ.Ð.ÀhÐØV˜	ÐVÐVÐ.AÐVÐVÐDTÐVÐVˆå—’˜Z¨Ñ2Ô2ˆÝ—\’\ -°Ñ:Ô:ˆ
Ý—<’<Ð 1°7Ñ;Ô;ˆÝ—\’\Ð"6¸Ñ>Ô>ˆ
õ 	ˆc•C˜‘H”H‰n˜tÑ# cÑ)¨DÑ0°3½¸S¹¼±>ÑAÑBÔBÐBÝÐE¸
ÐEÐEÐEÑFÔFÐFØŒ>ð 	IÝÐqÑrÔrÐrÐråÐGÑHÔHÐHÝ‰ŒˆÝÐW�HÐWÐW°5ÐWÐWÐWÑXÔXÐXÝÐaÐY^ÐaÐaÐaÑbÔbÐbÝÐbÑcÔcÐcÝÐsÐU]×UcÒUcÑUeÔUeÐsÐsÐsÑtÔtÐtÝ‰ŒˆÝÐeÀ8Ç>Â>ÑCSÔCSÐeÐeÐeÑfÔfÐfÝÐpÑqÔqÐqÝÐ^ÐV[Ð^Ð^Ð^Ñ_Ô_Ð_ÝÐ=°
Ð=Ð=Ð=Ñ>Ô>Ð>Ý‰ŒˆÝÐmÐ[`ÐmÐmÐmÑnÔnÐnÝÐiÑjÔjÐjÝ‰Œˆå	Ð
ÑÔÐÝ	Ð
ÑÔÐÝ	Ð
ÑÔÐØ×%Ò%Ñ'Ô'ð &ð &‰	ˆˆcÝÐ$�DÐ$Ð$Ð$˜sÐ$Ð$Ñ%Ô%Ð%Ð%ð&ð &r   c                 óB  — |j         dk    rUt          | ¦  «        dk    r+dd                     | ¦  «        z   dz   }t          |¦  «         nt          | d         ¦  «         dS d| d         v rSt	          j        d	¦  «        }t          t          | ¦  «        ¦  «        D ]"}|                     d
„ | |         ¦  «        | |<   Œ#t          | ¦  «        dk    rt          | d         ¦  «         dS g }| D ]M}	 |                     | 	                    d¦  «        dz
  ¦  «         Œ/# t          $ r t          |¦  «         Y ŒJw xY wt          |¦  «        dk    rPt          |¦  «        }t          || ¦  «        D ]2\  }}|d|…         ||d…         }
}	t          |	d|› �›|
› �¦  «         Œ1dS dS )z/Re-process metric strings to align them nicely.rJ   rL   z[
z,
z
]r   Nu   Î¼u   (\(Î¼ = [0-9\.]+ Â± [0-9\.]+\))c                 ó\   — t                                |                      ¦   «         d¦  «        S )NrU   )r   r   Úgroup)Úms    r   ú<lambda>z&print_single_results.<locals>.<lambda>Î   s   € �%Ÿ,š, q§w¢w¡y¤y°&Ñ9Ô9€ r   ú=ú>)r   rf   Újoinrh   ÚreÚcompilere   Úsubr<   ÚindexÚ
ValueErrorÚmaxÚzip)rF   rH   rp   Úcolor_reÚidxÚlensÚlineÚwÚ_lenÚleftrW   s              r   Úprint_single_resultsr›   ¿   sç  € à„{�fÒÐÝˆw‰<Œ<˜!ÒÐØ %§*¢*¨WÑ"5Ô"5Ñ5¸Ñ=ˆKÝ�+ÑÔÐÐå�'˜!”*ÑÔÐØˆð ˆw�qŒzÐÐÝ”:Ð@ÑAÔAˆÝ�˜W™œÑ&Ô&ð 	Ið 	IˆCØ#Ÿ<š<Ø9Ð9¸7À3¼<ñIô IˆG�C‰LˆLõ ˆ7�|„|�qÒÐåˆg�aŒjÑÔÐØˆð €DØð ð ˆð	Ø�KŠK˜Ÿ
š
 3™œ¨!Ñ+Ñ,Ô,Ð,Ð,øÝð 	ð 	ð 	Ý�$‰KŒKˆKˆKˆKð	øøøõ ˆ4�y„y�1‚}€}Ý�‰IŒIˆÝ  gÑ.Ô.ð 	)ð 	)‰LˆT�4Ø˜u ˜uœ+ t¨D¨E¨E¤{�%ˆDÝ�TÐ'˜AÐ'Ð'Ð' Ð'Ð'Ñ(Ô(Ð(Ð(ð	 €}ð	)ð 	)s   Ã/+DÄD7Ä6D7rK   ÚrefsÚtest_setc                 ó¨  ‡— t          | ¦  «        Št          ˆfd„|D ¦   «         ¦  «        r¦t                               d¦  «         |rtt                               d¦  «         t                               d¦  «         t                               dt          › d|› d�¦  «         t                               d¦  «         t          j        d	¦  «         d S d S )
Nc              3   ó>   •K  — | ]}t          |¦  «        ‰k    V — Œd S ©N©rf   )Ú.0Ú
ref_streamÚn_hypss     €r   ú	<genexpr>z'sanity_check_lengths.<locals>.<genexpr>é   s.   øè è € Ð
<Ð
<¨�3ˆz‰?Œ?˜fÒ$Ð
<Ð
<Ð
<Ð
<Ð
<Ð
<r   z4System and reference streams have different lengths.zeThis could be an issue with your system output or with sacreBLEU's reference database if -t is given.z6For the latter, try cleaning out the cache by typing:
z  rm -r ú/r*   zDThe test sets will be re-downloaded the next time you run sacreBLEU.rL   )rf   ÚanyÚsacreloggerÚerrorÚSACREBLEU_DIRÚsysÚexit)rK   rœ   r�   r¤   s      @r   Úsanity_check_lengthsr­   å   sá   ø€ õ �‰[Œ[€FÝ
Ð
<Ð
<Ð
<Ð
<°tÐ
<Ñ
<Ô
<Ñ<Ô<ð Ý×ÒÐPÑQÔQÐQØð 	fÝ×Òð Wñ Xô Xð Xå×ÒÐWÑXÔXÐXÝ×ÒÐE­ÐEÐE¸ÐEÐEÐEÑFÔFÐFÝ×ÒÐdÑeÔeÐeÝŒ�‰Œˆˆˆðð r   Úrtúutf-8c                 ó‚   — |                       d¦  «        rt          j        | ||d¬¦  «        S t          | ||d¬¦  «        S )z¾Convenience function for reading compressed or plain text files.
    :param file: The file to read.
    :param mode: The file mode (read, write).
    :param encoding: The file encoding.
    z.gzr*   )ÚmodeÚencodingÚnewline)ÚendswithÚgzipÚopen)Úfiler±   r²   s      r   Ú
smart_openr¸   ô   sI   € ð ‡}‚}�UÑÔð KÝŒy˜ D°8ÀTÐJÑJÔJÐJÝ�˜4¨(¸DÐAÑAÔAÐAr   Únumc                 ó:   — | dk    rdS t          j        | ¦  «        S )zp
    Floors the log function

    :param num: the number
    :return: log(num) floored to a very low number
    ç        lýÿÿÿÿc(	 )ÚmathÚlog)r¹   s    r   Úmy_logr¾   ÿ   s    € ð ˆc‚z€zØˆ{ÝŒ8�C‰=Œ=Ðr   c                 ó  — t          | ¦  «        dk    r| d         S t          | d         ¦  «        } t          | d         d         ¦  «        d¦  «        }|g|z  }| D ]*}t          |¦  «        D ]}||xx         ||         z  cc<   ŒŒ+|S )z,Aggregates list of numeric lists by summing.rL   r   r»   )rf   Útypere   )ÚlistsÚsizeÚinit_valÚtotalÚllrr   s         r   Úsum_of_listsrÆ     s    € å
ˆ5�z„z�Q‚€Ø�QŒxˆõ ˆu�QŒx‰=Œ=€DØ �t�E˜!”H˜Q”KÑ Ô  Ñ%Ô%€HØˆJ˜Ñ€EØð ð ˆÝ�t‘”ð 	ð 	ˆAØ�!ˆHˆHŒH˜˜1œÑˆHˆH‰HˆHð	à€Lr   FÚprefixÚstrip_prefixc                 óº   — |dz  }i }| j                              ¦   «         D ]9\  }}|                     |¦  «        r|r|                     |d¦  «        n|}|||<   Œ:|S )zbFilters argparse's `Namespace` into dictionary with arguments
    beginning with the given prefix.Ú_rS   )rg   r6   rj   Úreplace)rH   rÇ   rÈ   ÚdÚkÚvs         r   Úargs_to_dictrÏ     ss   € ð ˆc�M€FØ
€AØ”×#Ò#Ñ%Ô%ð ð ‰ˆˆ1Ø�<Š<˜ÑÔð 	Ø)5Ð<�—	’	˜& "Ñ%Ô%Ð%¸1ˆAØˆAˆa‰DøØ€Hr   c                 ó4  ‡— | t           vrt          d| › �¦  «        ‚t           |                               |¦  «        }t           |                               |¦  «        }d|v rBt	          |¦  «        dk    r/t
                               d¦  «         t          j        d¦  «         nd|v r|}d|v r+d|vr't          d„ |D ¦   «         ¦  «        Šˆfd„|D ¦   «         }g }|D ]ß}||vr©t
                               d|› d	| › d
|› d�¦  «         t
                               d| › d|› dd 
                    |¦  «        › �¦  «         d|vr7t          d„ |D ¦   «         ¦  «        }	t
                               d|	› d�¦  «         t          j        d¦  «         |                     |¦  «        }
|                     ||
         ¦  «         Œàd„ |D ¦   «         }t          || |||¦  «        }t          |Ž D ]3}t          d 
                    t!          d„ |¦  «        ¦  «        ¦  «         Œ4dS )a�  Prints to STDOUT the specified side of the specified test set.

    :param test_set: the test set to print
    :param langpair: the language pair
    :param requested_fields: the fields to print
    :param origlang: print only sentences with a given original language (2-char ISO639-1 code), "non-" prefix means negation
    :param subset: print only sentences whose document annotation matches a given regex
    úNo such test set ÚallrL   z'Cannot use --echo all with other fieldsÚrefc                 ó<   — g | ]}|                      d ¦  «        ¯|‘ŒS ©rÓ   ©rj   ©r¢   r3   s     r   ú
<listcomp>z"print_test_set.<locals>.<listcomp>>  s)   € ÐLÐLÐL Q¸¿ºÀUÑ8KÔ8KÐL˜qÐLÐLÐLr   c                 ó$   •— g | ]}|d k    r|n‰‘ŒS rÕ   r#   )r¢   r3   Úreplacement_refs     €r   rØ   z"print_test_set.<locals>.<listcomp>?  s%   ø€ Ð[Ð[Ð[ÀQ  e¢ ˜A˜A°Ð[Ð[Ð[r   zNo such field z in test set z for language pair r2   zavailable fields for r¦   z: z, c                 ó<   — g | ]}|                      d ¦  «        ¯|‘ŒS rÕ   rÖ   r×   s     r   rØ   z"print_test_set.<locals>.<listcomp>G  s)   € ÐKÐKÐK A°q·|²|ÀEÑ7JÔ7JÐK˜aÐKÐKÐKr   z<'ref' also allowed for backwards compatibility (will return r.   c                 ó,   — g | ]}t          |¦  «        ‘ŒS r#   )r¸   )r¢   r·   s     r   rØ   z"print_test_set.<locals>.<listcomp>M  s    € Ð2Ð2Ð2 D�z˜$ÑÔÐ2Ð2Ð2r   ú	c                 ó*   — |                       ¦   «         S r    )Úrstrip)Úxs    r   r‰   z print_test_set.<locals>.<lambda>P  s   €  a§h¢h¡j¤j€ r   N)ÚDATASETSÚ	ExceptionÚ
fieldnamesÚ	get_filesrf   r¨   r©   r«   r¬   ÚminrŒ   r�   r<   Úfilter_subsetr“   rh   Úmap)r�   ÚlangpairÚrequested_fieldsÚoriglangÚsubsetrã   Ú	all_filesÚfilesÚfieldÚsubrefr�   ÚstreamsÚlinesrÚ   s                @r   Úprint_test_setrò   '  sw  ø€ ð •xÐÐÝÐ6¨HÐ6Ð6Ñ7Ô7Ð7å˜(Ô#×.Ò.¨xÑ8Ô8€JÝ˜Ô"×,Ò,¨XÑ6Ô6€IàÐ Ð Ð ¥SÐ)9Ñ%:Ô%:¸aÒ%?Ð%?Ý×ÒÐCÑDÔDÐDÝŒ�‰ŒˆˆØ	Ð"Ð	"Ð	"Ø%Ðð Ð Ð Ð  U°*Ð%<Ð%<ÝÐLÐL¨*ÐLÑLÔLÑMÔMˆØ[Ð[Ð[Ð[ÐJZÐ[Ñ[Ô[Ðà€EØ!ð 	'ð 	'ˆØ˜
Ð"Ð"Ý×ÒÐk¨uÐkÐkÀ8ÐkÐkÐ`hÐkÐkÐkÑlÔlÐlÝ×ÒÐd°hÐdÐdÀÐdÐdÈTÏYÊYÐWaÑMbÔMbÐdÐdÑeÔeÐeØ˜JÐ&Ð&ÝÐKÐK¨ÐKÑKÔKÑLÔL�Ý×!Ò!Ð"jÐagÐ"jÐ"jÐ"jÑkÔkÐkÝŒH�Q‰KŒKˆKØ× Ò  Ñ'Ô'ˆØ�Š�Y˜uÔ%Ñ&Ô&Ð&Ð&à2Ð2¨EÐ2Ñ2Ô2€GÝ˜G X¨x¸À6ÑJÔJ€GÝ�g�ð ;ð ;ˆÝˆd�iŠi�Ð0Ð0°%Ñ8Ô8Ñ9Ô9Ñ:Ô:Ð:Ð:ð;ð ;r   rè   c                 óx   — | t           vrt          d| › �¦  «        ‚t           |                               |¦  «        S )a  
    Returns the source file for a given testset/langpair.
    Downloads it first if it is not already local.

    :param test_set: The test set (e.g., "wmt19")
    :param langpair: The language pair (e.g., "de-en")
    :return: the path to the requested source file
    rÑ   )rá   râ   Úget_source_file©r�   rè   s     r   rô   rô   S  s?   € ð •xÐÐÝÐ6¨HÐ6Ð6Ñ7Ô7Ð7å�HÔ×-Ò-¨hÑ7Ô7Ð7r   c                 óx   — | t           vrt          d| › �¦  «        ‚t           |                               |¦  «        S )a@  
    Returns a list of one or more reference file paths for the given testset/langpair.
    Downloads the references first if they are not already local.

    :param test_set: The test set (e.g., "wmt19")
    :param langpair: The language pair (e.g., "de-en")
    :return: a list of one or more reference file paths
    rÑ   )rá   râ   Úget_reference_filesrõ   s     r   r÷   r÷   b  s?   € ð •xÐÐÝÐ6¨HÐ6Ð6Ñ7Ô7Ð7Ý�HÔ×1Ò1°(Ñ;Ô;Ð;r   c                 óx   — | t           vrt          d| › �¦  «        ‚t           |                               |¦  «        S )a_  
    Returns the path of the source file and all reference files for
    the provided test set / language pair.
    Downloads the references first if they are not already local.

    :param test_set: The test set (e.g., "wmt19")
    :param langpair: The language pair (e.g., "de-en")
    :return: a list of the source file and all reference files
    rÑ   ©rá   râ   rä   rõ   s     r   rä   rä   p  s?   € ð •xÐÐÝÐ6¨HÐ6Ð6Ñ7Ô7Ð7Ý�HÔ×'Ò'¨Ñ1Ô1Ð1r   c                 óî  — t                                d| › d|› �¦  «         |                      d¦  «        s|                      d¦  «        rJdd l}|                     | ¦  «        5 }|                     |¬¦  «         d d d ¦  «         d S # 1 swxY w Y   d S |                      d¦  «        rKdd l}|                     | d¦  «        5 }|                     |¬¦  «         d d d ¦  «         d S # 1 swxY w Y   d S d S )	NzExtracting ú to z.tar.gzz.tgzr   )Úpathz.zipÚr)r¨   Úinfor´   Útarfiler¶   Ú
extractallÚzipfileÚZipFile)ÚfilepathÚdestdirrÿ   Útarr  s        r   Úextract_tarballr  €  s—  € Ý×ÒÐ: 8Ð:Ð:°Ð:Ð:Ñ;Ô;Ð;Ø×Ò˜Ñ#Ô#ð - x×'8Ò'8¸Ñ'@Ô'@ð -ØˆˆˆØ�\Š\˜(Ñ#Ô#ð 	) sØ�NŠN ˆNÑ(Ô(Ð(ð	)ð 	)ð 	)ñ 	)ô 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)øøøð 	)ð 	)ð 	)ð 	)ð 	)ð 	)à	×	Ò	˜6Ñ	"Ô	"ð -ØˆˆˆØ�_Š_˜X sÑ+Ô+ð 	-¨wØ×Ò GÐÑ,Ô,Ð,ð	-ð 	-ð 	-ñ 	-ô 	-ð 	-ð 	-ð 	-ð 	-ð 	-ð 	-ð 	-øøøð 	-ð 	-ð 	-ð 	-ð 	-ð 	-ð-ð -s$   Á$BÂBÂBÃC(Ã(C,Ã/C,c                 óÖ   — t          j        ¦   «         }t          | d¦  «        5 }|D ]}|                     |¦  «         Œ	 d d d ¦  «         n# 1 swxY w Y   |                     ¦   «         S )NÚrb)ÚhashlibÚmd5r¶   ÚupdateÚ	hexdigest)Ú	dest_pathr
  Úinfiler—   s       r   Ú
get_md5sumr  Œ  s¨   € å
Œ+‰-Œ-€CÝ	ˆi˜Ñ	Ô	ð  &Øð 	ð 	ˆDØ�JŠJ�tÑÔÐÐð	ðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð ð �=Š=‰?Œ?Ðs   ¤AÁAÁAc                 ó\  — ddl }ddl}t          j                             |¦  «        }t          j        |d¬¦  «         |› d�}t          j        |d¬¦  «        5  t          j                             |¦  «        r$t          j         	                    |¦  «        dk    �rwt                               d| › d	|› �¦  «         	 |j                             | ¦  «        5 }t          |d
¦  «        5 }	|	                     |                     ¦   «         ¦  «         ddd¦  «         n# 1 swxY w Y   ddd¦  «         n# 1 swxY w Y   n># |j        $ r1 t                               d¦  «         t'          j        d¦  «         Y nw xY w|�‚t+          |¦  «        }
|
|k    rmt                               d|
› d|› d�¦  «         t                               d|›d�¦  «         t                               d¦  «         t'          j        d¦  «         |�t-          ||¦  «         ddd¦  «         dS # 1 swxY w Y   dS )ao  Downloading utility.

    Downloads the specified test to the system location specified by the SACREBLEU environment variable.

    :param source_path: the remote uri to download
    :param dest_path: where to save the file
    :param extract_to: for tarballs, where to extract to
    :param expected_md5: the MD5 sum
    :return: the set of processed file names
    r   NT)Úexist_okz.locké<   )ÚtimeoutzDownloading rû   ÚwbzÈAn SSL error was encountered in downloading the files. If you're on a Mac, you may need to run the "Install Certificates.command" file located in the "Python 3" folder, often found under /ApplicationsrL   z5Fatal: MD5 sum of downloaded file was incorrect (got z, expected z).zPlease manually delete z and rerun the command.znIf the problem persists, the tarball may have changed, in which case, please contact the SacreBLEU maintainer.)Úurllib.requestÚsslÚosrü   ÚdirnameÚmakedirsÚportalockerÚLockÚexistsÚgetsizer¨   rþ   ÚrequestÚurlopenr¶   ÚwriteÚreadÚSSLErrorr©   r«   r¬   r  r  )Úsource_pathr  Ú
extract_toÚexpected_md5Úurllibr  ÚoutdirÚlockfiler3   ÚoutÚcur_md5s              r   Údownload_filer+  •  s$  € ð ÐÐÐØ€J€J€JåŒW�_Š_˜YÑ'Ô'€FÝ„K� Ð&Ñ&Ô&Ð&ð Ð"Ð"Ð"€HÝ	Ô	˜(¨BÐ	/Ñ	/Ô	/ð 7ð 7åŒw�~Š~˜iÑ(Ô(ð 	7­B¬G¯OªO¸IÑ,FÔ,FÈ!Ò,KÑ,KÝ×ÒÐH¨KÐHÐH¸YÐHÐHÑIÔIÐIðØ”^×+Ò+¨KÑ8Ô8ð (¸A½tÀIÈtÑ?TÔ?Tð (ÐX[Ø—I’I˜aŸfšf™hœhÑ'Ô'Ð'ð(ð (ð (ñ (ô (ð (ð (ð (ð (ð (ð (øøøð (ð (ð (ð (ð (ð (ð (ñ (ô (ð (ð (ð (ð (ð (ð (øøøð (ð (ð (ð (øøà”<ð ð ð Ý×!Ò!ð #Yñ Zô Zð Zõ ”˜‘”���ð	øøøð Ð'Ý$ YÑ/Ô/�Ø˜lÒ*Ð*Ý×%Ò%ð  'CÐ^eð  'Cð  'CÐr~ð  'Cð  'Cð  'Cñ  Dô  Dð  DÝ×%Ò%Ð&dÀ	Ð&dÐ&dÐ&dÑeÔeÐeÝ×%Ò%ð  'Wñ  Xô  Xð  XÝ”H˜Q‘K”K�Kð Ð%Ý 	¨:Ñ6Ô6Ð6ð17ð 7ð 7ñ 7ô 7ð 7ð 7ð 7ð 7ð 7ð 7ð 7øøøð 7ð 7ð 7ð 7ð 7ð 7s€   ÁA$H!Â>E ÃD4Ã)(DÄD4ÄD!Ä!D4Ä$D!Ä%D4Ä(E Ä4D8	Ä8E Ä;D8	Ä<E Ä?H!Å 8E;Å8H!Å:E;Å;BH!È!H%È(H%c                 ó€   — | t           vrt          d| › �¦  «        ‚t           |          }|                     |¦  «        }|S )a  Downloads the specified test to the system location specified by the SACREBLEU environment variable.

    :param test_set: the test set to download
    :param langpair: the language pair (needed for some datasets)
    :return: the set of processed file names
    rÑ   rù   )r�   rè   ÚdatasetÚ
file_pathss       r   Údownload_test_setr/  Ã  sI   € ð •xÐÐÝÐ6¨HÐ6Ð6Ñ7Ô7Ð7Ý�xÔ €GØ×"Ò" 8Ñ,Ô,€JØÐr   Útestsetc                 óz   — | t           vrg S t          t           |          j                             ¦   «         ¦  «        S )z5Return a list of language pairs for a given test set.)rá   rd   Ú	langpairsrV   )r0  s    r   Úget_langpairs_for_testsetr3  Ñ  s4   € à•hÐÐØˆ	Ý•˜Ô!Ô+×0Ò0Ñ2Ô2Ñ3Ô3Ð3r   c                  óF   — t          t          j        ¦   «         d¬¦  «        S )z%Return a list of available test sets.T)Úreverse)Úsortedrá   rV   r#   r   r   Úget_available_testsetsr7  Ø  s   € å•(”-‘/”/¨4Ð0Ñ0Ô0Ð0r   c                 óì   — |                       d¦  «        }|d         }|d         }g }t          j        ¦   «         D ]8}|› d|› �|j        v s|› d|› �|j        v r|                     |j        ¦  «         Œ9|S )z>Return a list of available test sets for a given language pairrb   r   rL   )Úsplitrá   Úvaluesr2  r<   rx   )rè   ÚpartsÚsrclangÚtrglangÚtestsetsr-  s         r   Ú#get_available_testsets_for_langpairr?  Ü  s“   € à�NŠN˜3ÑÔ€EØ�AŒh€GØ�AŒh€Gà€HÝ”?Ñ$Ô$ð *ð *ˆØÐ!Ð!˜Ð!Ð! WÔ%6Ð6Ð6ØÐ)Ð) Ð)Ð)¨WÔ->Ð>Ð>Ø�OŠO˜GœLÑ)Ô)Ð)øà€Or   c                 ó²  — | €g S t          ¦   «         }|                      d¦  «        D �]}t          |         }t          j                             t          |d|j        |         d         ¦  «        }ddlm	} t          ||¦  «        r3|                     |¦  «        d         D ]}|                     |¦  «         Œ|                     d¦  «        rmt          |¦  «        5 }|D ]B}	|	                     d	¦  «        r+t!          j        d
d|	¦  «        }
|                     |
¦  «         ŒC	 ddd¦  «         n# 1 swxY w Y   �Œt%          t'          |¦  «        ¦  «        S )zDReturn a list of origlang values according to the raw XML/SGM files.Nrc   Úrawr   rL   ©ÚWMTXMLDatasetrê   ú.sgmú<doc ú.* origlang="([^"]+)".*\nú\1)Úsetr9  rá   r  rü   rŒ   rª   r2  Údataset.wmt_xmlrC  r7   Ú_unwrap_wmt21_or_laterÚaddr´   r¸   rj   r�   r�   r6  rd   )Ú	test_setsrè   Ú	origlangsr�   r-  ÚrawfilerC  rê   Úfinr—   Údoc_origlangs              r   Úget_available_origlangsrQ  ë  s›  € àÐØˆ	å‘”€IØ—O’O CÑ(Ô(ð 4ñ 4ˆÝ˜8Ô$ˆÝ”'—,’,�}¨h¸¸wÔ?PÐQYÔ?ZÐ[\Ô?]Ñ^Ô^ˆØ2Ð2Ð2Ð2Ð2Ð2Ý�g˜}Ñ-Ô-ð 	(Ø#×:Ò:¸7ÑCÔCÀJÔOð (ð (�Ø—’˜hÑ'Ô'Ð'Ð'Ø×Ò˜FÑ#Ô#ð 	4Ý˜GÑ$Ô$ð 4¨Øð 4ð 4�DØ—’ wÑ/Ô/ð 4Ý')¤vÐ.JÈEÐSWÑ'XÔ'X˜Ø!Ÿš lÑ3Ô3Ð3øð4ð4ð 4ð 4ñ 4ô 4ð 4ð 4ð 4ð 4ð 4ð 4øøøð 4ð 4ð 4ð 4ùõ
 •$�y‘/”/Ñ"Ô"Ð"s   ÃAD0Ä0D4	Ä7D4	c                 ó¢  — | €g S t          ¦   «         }|                      d¦  «        D �]}t          |         }ddlm} t          ||¦  «        rjt          j                             t          |d|j
        |         d         ¦  «        }|                     |¦  «        }d|v r|t          |d         ¦  «        z  }Œ�|t          v rr|t          d„ t          |                              ¦   «         D ¦   «         ¦  «        z  }|t          d	„ t          |                              ¦   «         D ¦   «         ¦  «        z  }�Œt          t          |¦  «        ¦  «        S )
zkReturn a list of domain values according to the raw XML files and domain/country values from the SGM files.Nrc   rL   rB  rA  r   Údomainc              3   óR   K  — | ]"}d |                      d¦  «        d         z   V — Œ#dS )úcountry:rb   r   N©r9  ©r¢   rÎ   s     r   r¥   z(get_available_subsets.<locals>.<genexpr>  s5   è è € Ð\Ð\¸A˜:¨¯ª°©¬°Q¬Ñ7Ð\Ð\Ð\Ð\Ð\Ð\r   c              3   óL   K  — | ]}|                      d ¦  «        d         V — Œ dS )rb   rL   NrV  rW  s     r   r¥   z(get_available_subsets.<locals>.<genexpr>  s0   è è € ÐOÐO¨q˜1Ÿ7š7 3™<œ<¨œ?ÐOÐOÐOÐOÐOÐOr   )rH  r9  rá   rI  rC  r7   r  rü   rŒ   rª   r2  rJ  ÚSUBSETSr:  r6  rd   )rL  rè   Úsubsetsr�   r-  rC  rN  Úfieldss           r   Úget_available_subsetsr\    sD  € àÐØˆ	å‰eŒe€GØ—O’O CÑ(Ô(ð 
Pñ 
PˆÝ˜8Ô$ˆØ2Ð2Ð2Ð2Ð2Ð2Ý�g˜}Ñ-Ô-ð 	PÝ”g—l’l¥=°(¸EÀ7ÔCTÐU]ÔC^Ð_`ÔCaÑbÔbˆGØ×3Ò3°GÑ<Ô<ˆFØ˜6Ð!Ð!Ø�3˜v hÔ/Ñ0Ô0Ñ0�øØ�Ð Ð Ø•sÐ\Ð\ÅÈÔAR×AYÒAYÑA[ÔA[Ð\Ñ\Ô\Ñ\Ô\Ñ\ˆGØ•sÐOÐOµG¸HÔ4E×4LÒ4LÑ4NÔ4NÐOÑOÔOÑOÔOÑOˆGùÝ•$�w‘-”-Ñ Ô Ð r   c           
      óÊ  ‡— |€|€| S |�|€t          d¦  «        ‚|�|                     d¦  «        r
|dd…         }t          j        d¦  «        }t          j        d¦  «        }g Š|                     d¦  «        D �]Z}t
          |         }t          j                             t          |d|j
        |         d	         ¦  «        }	d
dlm}
 t          ||
¦  «        r²|                     |	¦  «        }d|v r|d         nt          j        d¦  «        }t#          |d         |¦  «        D ]d\  }}|€d}n*|                     d¦  «        r||dd…         k    }n||k    }|�|�t          j        ||¦  «        sd}‰                     |¦  «         Œe�Œ|	                     d¦  «        �r$i }|�(|t*          vrt-          d|z   ¦  «        ‚t*          |         }t/          |	¦  «        5 }d}|D ]É}|                     d¦  «        rˆ|€d}n@|                     d|¦  «        }|                     d¦  «        r||dd…         k    }n||k    }|�A|                     d|¦  «        }t          j        ||                     |d¦  «        ¦  «        sd}|                     d¦  «        r‰                     |¦  «         ŒÊ	 ddd¦  «         n# 1 swxY w Y   �ŒJt-          d|	›�¦  «        ‚ˆfd„| D ¦   «         S )zRFilter sentences with a given origlang (or subset) according to the raw SGM files.NzPFiltering for --origlang or --subset needs a test (-t) and a language pair (-l).rU  é   rF  z.* docid="([^"]+)".*\nrc   rA  r   rL   rB  rS  rê   Tznon-rM   FrD  z,No subset annotation available for test set rE  rG  rS   z<seg zE--origlang and --subset supports only WMT *.xml and *.sgm files, not c                 óD   •— g | ]}d „ t          |‰¦  «        D ¦   «         ‘ŒS )c                 ó   — g | ]	\  }}|¯|‘Œ
S r#   r#   )r¢   ÚsentenceÚkeeps      r   rØ   z,filter_subset.<locals>.<listcomp>.<listcomp>O  s!   € ÐNÐNÐN™.˜( DÈÐNˆXÐNÐNÐNr   )r“   )r¢   r«   Úindices_to_keeps     €r   rØ   z!filter_subset.<locals>.<listcomp>O  s3   ø€ ÐbÐbÐbÐSVÐNÐN­C°°_Ñ,EÔ,EÐNÑNÔNÐbÐbÐbr   )r‘   rj   r�   rŽ   r9  rá   r  rü   rŒ   rª   r2  rI  rC  r7   rJ  Ú	itertoolsÚrepeatr“   Úsearchr<   r´   rY  râ   r¸   r�   Úget)ÚsystemsrL  rè   rê   rë   Úre_origlangÚre_idr�   r-  rN  rC  r[  ÚdomainsrP  Ú
doc_domainÚinclude_docÚdoc_to_tagsrO  r—   Údoc_idrc  s                       @r   ræ   ræ     s”  ø€ àÐ˜F˜NØˆØÐ˜HÐ,ÝÐkÑlÔlÐlàÐ˜f×/Ò/°
Ñ;Ô;ÐØ˜˜˜”ˆå”*Ð9Ñ:Ô:€KÝŒJÐ0Ñ1Ô1€Eà€OØ—O’O CÑ(Ô(ð ,qñ ,qˆÝ˜8Ô$ˆÝ”'—,’,�}¨h¸¸wÔ?PÐQYÔ?ZÐ[\Ô?]Ñ^Ô^ˆØ2Ð2Ð2Ð2Ð2Ð2Ý�g˜}Ñ-Ô-ð (	qØ×3Ò3°GÑ<Ô<ˆFØ*2°fÐ*<Ð*<�f˜XÔ&Ð&Å)ÔBRÐSWÑBXÔBXˆGÝ,/°°zÔ0BÀGÑ,LÔ,Lð 
4ð 
4Ñ(�˜jØÐ#Ø"&�K�Kà×*Ò*¨6Ñ2Ô2ð ?Ø&2°h¸q¸r¸r´lÒ&B˜˜à&2°hÒ&>˜ØÐ%¨:Ð+=ÅRÄYÈvÐWaÑEbÔEbÐ+=Ø"'�KØ×&Ò& {Ñ3Ô3Ð3Ð3ñ
4ð ×Ò˜fÑ%Ô%ñ 	qØˆKØÐ!Ø¥7Ð*Ð*Ý#Ð$RÐU]Ñ$]Ñ^Ô^Ð^Ý% hÔ/�Ý˜GÑ$Ô$ð <¨Ø#�Øð <ð <�DØ—’ wÑ/Ô/ð 4Ø#Ð+Ø*.˜K˜Kà+6¯?ª?¸5À$Ñ+GÔ+G˜LØ'×2Ò2°6Ñ:Ô:ð GØ.:¸hÀqÀrÀr¼lÒ.J  à.:¸hÒ.F à!Ð-Ø%*§Y¢Y¨u°dÑ%;Ô%;˜FÝ#%¤9¨V°[·_²_ÀVÈRÑ5PÔ5PÑ#QÔ#Qð 4Ø.3 Ø—’ wÑ/Ô/ð <Ø'×.Ò.¨{Ñ;Ô;Ð;øð!<ð<ð <ð <ñ <ô <ð <ð <ð <ð <ð <ð <øøøð <ð <ð <ð <ùõ( ÐoÐdkÐoÐoÑpÔpÐpØbÐbÐbÐbÐZaÐbÑbÔbÐbs   ÇCJ8Ê8J<	Ê?J<	c                 óš  — |j         }|j        r|j        nt          |j        |j        ¦  «        }t          |¦  «        dk    rt          d¦  «         d S t          t          ¦  «        }|D �]}d g}|j	        �||j	        gz  }n|t          |j        |j        ¦  «        z  }|D ]Ê}	t          |g|¢|j        |j        ||	¦  «        ^}
}t          |
¦  «        dk    rŒ8d|› �}|	€|dz  }n.|	                     d¦  «        r|d|	dd …         › �z  }n|d|	› �z  }|                      ¦   «         D ]B}|                     |
|¦  «        }||                              t          |
¦  «        |f¦  «         ŒCŒË�Œt!          d	„ |                     ¦   «         D ¦   «         ¦  «        d
z   }t!          d„ t          |                     ¦   «         ¦  «        d         D ¦   «         ¦  «        }|                     ¦   «         D ][\  }}t&                               |d|› �›d¦  «        }|D ]3\  }}t          |› d|d›d|j        d|› �›d|j        d|› d�›�¦  «         Œ4Œ\d S )Nr   z@No subset information found. Consider using --origlang argument.z	origlang=z domain=ALLrU  z	 country=r^  z domain=c                 ó,   — g | ]}t          |¦  «        ‘ŒS r#   r¡   )r¢   rÍ   s     r   rØ   z(print_subset_results.<locals>.<listcomp>w  s   € Ð9Ð9Ð9 Q�#˜a™&œ&Ð9Ð9Ð9r   rL   c                 óB   — g | ]}t          |d          j        ¦  «        ‘ŒS )rL   )rf   rx   )r¢   ry   s     r   rØ   z(print_subset_results.<locals>.<listcomp>x  s&   € ÐRÐRÐR°�C  A¤¤Ñ,Ô,ÐRÐRÐRr   ú<rT   z: sentences=z<6r+   z = r2   r3   )r&   rê   rQ  r�   rè   rf   rh   r   rd   rë   r\  ræ   rj   r:  Úcorpus_scorer<   r’   rV   r6   r   r   rx   r8   )ÚmetricsÚfull_systemÚ	full_refsrH   r˜   rM  rF   rê   rZ  rë   rK   rœ   Úkeyr@   r8   Úmax_left_widthÚmax_metric_widthr%   Ún_systems                      r   Úprint_subset_resultsr|  R  sÕ  € ØŒ
€AØ!%¤ð >�”�Ý ¤¨t¬}Ñ=Ô=ð õ ˆ9�~„~˜ÒÐÝÐPÑQÔQÐQØˆå�$ÑÔ€Gàð :ñ :ˆØ�&ˆØŒ;Ð"Ø˜œ�}Ñ$ˆGˆGàÕ,¨T¬]¸D¼MÑJÔJÑJˆGàð 	:ð 	:ˆFÝ)ØÐ)˜yÐ)¨4¬=¸$¼-ÈÐSYñ[ô [ˆMˆF�Tõ �6‰{Œ{˜aÒÐØà(˜hÐ(Ð(ˆCØˆ~Ø�}Ñ$��Ø×"Ò" :Ñ.Ô.ð +ØÐ/ 6¨!¨"¨"¤:Ð/Ð/Ñ/��àÐ* &Ð*Ð*Ñ*�à!Ÿ.š.Ñ*Ô*ð :ð :�Ø×+Ò+¨F°DÑ9Ô9�Ø˜”×#Ò#¥S¨¡[¤[°%Ð$8Ñ9Ô9Ð9Ð9ð:ñ	:õ& Ð9Ð9¨'¯,ª,©.¬.Ð9Ñ9Ô9Ñ:Ô:¸QÑ>€NÝÐRÐR½¸W¿^º^Ñ=MÔ=MÑ8NÔ8NÈqÔ8QÐRÑRÔRÑSÔSÐØ—}’}‘”ð lð l‰ˆˆVÝ�lŠl˜cÐ5 NÐ5Ð5Ð5°xÑ@Ô@ˆØ%ð 	lð 	l‰OˆH�eÝ�SÐjÐj hÐjÐjÐj°E´JÐjÐAQÐjÐjÐjÐjÐW\ÔWbÐjÐefÐjÐjÐjÐjÐjÑkÔkÐkÐkð	lðlð lr   rL   )rá   rY  )r$   Tr    )r®   r¯   )F)NN)>rd  rJ   r  r�   r«   rµ   r¼   r	  Úloggingr  Úcollectionsr   Útypingr   r   r   r   Úargparser   r	   r   rü   Ú
expanduserÚUSERHOMEÚenvironrg  rŒ   rª   Ú	getLoggerr¨   r   ÚdictÚintÚboolr"   rE   r„   r›   r­   r¸   r5   r¾   rÆ   rÏ   rò   rô   r÷   rä   r  r  r+  r/  r3  r7  r?  rQ  r\  ræ   r|  r-  rá   rY  r#   r   r   ú<module>rˆ     s`  ðØ Ð Ð Ð Ø €€€Ø 	€	€	€	Ø 	€	€	€	Ø 
€
€
€
Ø €€€Ø €€€Ø €€€Ø €€€Ø Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø €€€ð Œ7×Ò˜cÑ"Ô"€Ø”
—’˜{¨B¬G¯LªL¸À<Ñ,PÔ,PÑQÔQ€àˆgÔ Ñ,Ô,€ðð ð ð ð ñ ô ð ð* &'Ø*.ð&ð & ð &Ø"ð&à#'ð&à37¸¸TÀ#¼Y¸Ô3Gð&ð &ð &ð &ðR`& ð `&°4ð `&¸yð `&ð `&ð `&ð `&ðF#) $ s¤)ð #)°9ð #)ð #)ð #)ð #)ðP 48ðð  ¨#¤ð Ø'¨°¬Ô6ðà#+¨C¤=ðð ð ð ðBð Bð Bð Bð
�ð 
˜%ð 
ð 
ð 
ð 
ðð ð ð	ð 	˜sð 	°$ð 	ð 	ð 	ð 	ð);ð );ð );ð );ðX8˜cð 8¨Sð 8°Sð 8ð 8ð 8ð 8ð< #ð <°ð <¸¸c¼ð <ð <ð <ð <ð2 T¨#¤Yð 2ð 2ð 2ð 2ð 	-ð 	-ð 	-ðð ð ð+7ð +7ð +7ð +7ð\ð ð ð ð4 sð 4¨t°C¬yð 4ð 4ð 4ð 4ð1  S¤	ð 1ð 1ð 1ð 1ð°#ð ¸$¸s¼)ð ð ð ð ð#°D¸´Ið #ð #ð #ð #ð,!°$°s´)ð !ð !ð !ð !ð&;cð ;cð ;cð ;cð|*lð *lð *lðZ 'Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &r   