�&ǐk�@'bJ�h�ۊL'}T� :��'2�Z#$��n�a��� �>a��`��_3d�Qpt�/�P -��#5�,�M��� �pA:©�q�����NW��ډ�A���� �9nʺج���� �TSM��{J6?7��r�@�\����D��� �׶���s�f�TJj?"��D��`?��̒� b�#�%�C*v�$�{�$����5Ծ�F�s��y�e/8��h-�f�̰&(����Gj�L:U� 2�� ����v�_k����Y��gp,�k�WF�R������_C�R��N@���R�@�ߔ?A�w9���F("iNa-S���Q�o�3tDMLh*�#4k�T/iQ��Y*�G��m����)��8�hBm/�I�,g�ﯖ���Z��}�Cz�q@´��d.����L�ŕ�,��1�Z�܌�: ̪���F+J-'��c�tvJ8��]Q-��b��y �6;*J`r_�d ��'�G ~p��)'�C,�%F��E(��2�k�����lР�z�!�=t ��_�0��f7��� ;�p�|�U �%eZddddZdZdZdZdZRS(RtraiseRcOsY||_||_|jdkr4td|n||_t|||||_dS(NRFtignores-extrasaction (%s) must be 'raise' or 'ignore'(RFRG(R5R1tlowert ValueErrort extrasactionR(RR4R5R1RJR2R6R7((s/usr/lib64/python2.7/csv.pyRs    cCs,tt|j|j}|j|dS(N(R<R=R5twriterow(Rtheader((s/usr/lib64/python2.7/csv.pyt writeheaderscCs|jdkrug|D]}||jkr|^q}|rutddjg|D]}t|^qPqung|jD]}|j||j^qS(NRFs(dict contains fields not in fieldnames: s, (RJR5RItjointreprtgetR1(Rtrowdicttkt wrong_fieldstxRC((s/usr/lib64/python2.7/csv.pyt _dict_to_lists (2cCs|jj|j|S(N(RRKRU(RRQ((s/usr/lib64/python2.7/csv.pyRKscCs=g}x$|D]}|j|j|q W|jj|S(N(tappendRURt writerows(RtrowdictstrowsRQ((s/usr/lib64/python2.7/csv.pyRWs (R!R"RRMRURKRW(((s/usr/lib64/python2.7/csv.pyRs    cBs>eZdZdZddZdZdZdZRS(se "Sniffs" the format of a CSV file (i.e. delimiter, quotechar) Returns a Dialect object. cCsdddddg|_dS(NR-s t;t t:(t preferred(R((s/usr/lib64/python2.7/csv.pyRscCs|j||\}}}}|s?|j||\}}n|sQtdndtfdY}||_||_|pd|_||_|S(sI Returns a dialect (or None) corresponding to the sample sCould not determine delimiterR2cBseZdZdZeZRS(tsniffeds (R!R"R#R+R R,(((s/usr/lib64/python2.7/csv.pyR2sR.(t_guess_quote_and_delimitert_guess_delimiterRRR)R&R'R*(Rtsamplet delimitersR'R)R&R*R2((s/usr/lib64/python2.7/csv.pytsniffs     cCsEg}xCdD];}tj|tjtjB}|j|}|r Pq q W|sbdtddfSi}i}d}x|D]} |jdd} | | } | r|j| dd|| [^\w "'])(?P ?)(?P["']).*?(?P=quote)(?P=delim)sC(?:^| )(?P["']).*?(?P=quote)(?P[^\w "'])(?P ?)sC(?P[^\w "'])(?P ?)(?P["']).*?(?P=quote)(?:$| )s*(?:^| )(?P["']).*?(?P=quote)(?:$| )RitquoteitdelimtspacecSs||||kr|p|S(N((tatbtquotes((s/usr/lib64/python2.7/csv.pytscSs||||kr|p|S(N((RgRhtdelims((s/usr/lib64/python2.7/csv.pyRjss s]((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$)(sF(?P[^\w "'])(?P ?)(?P["']).*?(?P=quote)(?P=delim)sC(?:^| )(?P["']).*?(?P=quote)(?P[^\w "'])(?P ?)sC(?P[^\w "'])(?P ?)(?P["']).*?(?P=quote)(?:$| )s*(?:^| )(?P["']).*?(?P=quote)(?:$| )N(tretcompiletDOTALLt MULTILINEtfindallR$R%t groupindexRPtKeyErrorRtkeystescapetsearchR(RtdataRbtmatchestrestrtregexpRiRktspacestmtnRCR'ReR*t dq_regexpR)((s/usr/lib64/python2.7/csv.pyR_sb           ' cCstd|jd}gtdD]}t|^q%}tdt|}d}i}i}i} dt|t|} } x| t|kr|d7}xk|| | !D]\} xS|D]K} |j| i}| j| }|j|dd||<||| |dj||djd |k}||fSq>Wng| j D]\}}||f^q}|j|d d}|dj||djd |k}||fS(s The delimiter /should/ occur the same number of times on each row. However, due to malformed data, it may not. We don't want an all or nothing approach, so we allow for small variations in this number. 1) build a table of the frequency of each character on every line. 2) build a table of frequencies of this frequency (meta-frequency?), e.g. 'x occurred 5 times in 10 rows, 6 times in 1000 rows, 7 times in 2 rows' 3) use the mode of the meta-frequency to determine the /expected/ frequency for that character 4) find out how often the character actually meets that goal 5) the character that best meets its goal is the delimiter For performance reasons, the data is evaluated in chunks, so it can try and evaluate the smallest portion of the data possible, evaluating additional chunks as necessary. s ii iicSs|d|dkr|p|S(Ni((RgRh((s/usr/lib64/python2.7/csv.pyRjIRcSsd|d|dfS(Nii((RgRh((s/usr/lib64/python2.7/csv.pyRjORg?g?g{Gz?s%c RiN(Ri(tfilterR%tsplittrangetchrtminR>RPtcountRstitemsRtremovetfloatR]tsort(RRvRbtctasciit chunkLengtht iterationt charFrequencytmodesRktstarttendtlinetchart metaFrequencytfreqRtmodeListttotalt consistencyt thresholdRRtvReR*R@((s/usr/lib64/python2.7/csv.pyR`sx%  &    !  + c Cstt||j|}|j}t|}i}xt|D]}d||RR%RstinttlongRtcomplexRIt OverflowErrorRttypeR( RRatrdrRLtcolumnst columnTypestitcheckedR?tcoltthisTypet hasHeadertcolType((s/usr/lib64/python2.7/csv.pyt has_headersN           N( R!R"RRR%RcR_R`R(((s/usr/lib64/python2.7/csv.pyRs    M i((((( RRlt functoolsRt_csvRRRRRRRRR R R R R RRt cStringIORt ImportErrort__all__RRRRRt NameErrorRR(((s/usr/lib64/python2.7/csv.pyts2 ^      6"