AlkantarClanX12

Your IP : 13.59.95.170


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/difflib.cpython-312.opt-2.pyc

�

�Q�flE��l�	gd�ZddlmZddlmZddlmZedd�Z	d�Z
Gd�d	�Zd#d
�Zd�Z
Gd�d
�ZddlZej d�j"fd�Zd$d�Zd�Z		d%d�Zd�Z		d%d�Zd�Z		d&d�Zdefd�Zddefd�ZdZdZdZdZGd�de �Z![d �Z"d!�Z#e$d"k(re#�yy)')�get_close_matches�ndiff�restore�SequenceMatcher�Differ�IS_CHARACTER_JUNK�IS_LINE_JUNK�context_diff�unified_diff�
diff_bytes�HtmlDiff�Match�)�nlargest)�
namedtuple)�GenericAliasr
za b sizec��|rd|z|zSy)Ng@��?�)�matches�lengths  �./opt/alt/python312/lib64/python3.12/difflib.py�_calculate_ratior's��
��W�}�v�%�%��c�l�eZdZ	dd�Zd�Zd�Zd�Zd�Zdd�Zd�Z	d	�Z
dd
�Zd�Zd�Z
d
�Zee�Zy)rNc�b�	||_dx|_|_||_|j	||�y�N)�isjunk�a�b�autojunk�set_seqs)�selfrrrr s     r�__init__zSequenceMatcher.__init__xs4��	�t��������� ��
��
�
�a��rc�J�	|j|�|j|�yr)�set_seq1�set_seq2)r"rrs   rr!zSequenceMatcher.set_seqs�s!��	�	
�
�
�a���
�
�a�rc�N�	||jury||_dx|_|_yr)r�matching_blocks�opcodes)r"rs  rr%zSequenceMatcher.set_seq1�s-��	�(
����;�����.2�2���t�|rc�|�	||jury||_dx|_|_d|_|j	�yr)rr(r)�
fullbcount�_SequenceMatcher__chain_b)r"rs  rr&zSequenceMatcher.set_seq2�s>��	�(
����;�����.2�2���t�|�������rc�<�|j}ix|_}t|�D](\}}|j|g�}|j	|��*t�x|_}|j}|r9|j�D]}||�s�|j|��|D]}||=�t�x|_
}t|�}	|jrQ|	dk\rK|	dzdz}
|j�D]%\}}t|�|
kDs�|j|��'|D]}||=�yyy)N���d�)r�b2j�	enumerate�
setdefault�append�set�bjunkr�keys�add�bpopular�lenr �items)r"rr1�i�elt�indices�junkr�popular�n�ntest�idxss            r�	__chain_bzSequenceMatcher.__chain_b
s��
�F�F������3���l�F�A�s��n�n�S�"�-�G��N�N�1��#�
 �E�!��
�T�������x�x�z���#�;��H�H�S�M�"�����H��#&�%�'��
����F���=�=�Q�#�X���H�q�L�E� �Y�Y�[�	��T��t�9�u�$��K�K��$�)�����H��&�=rc���	|j|j|j|jjf\}}}}|�t|�}|�t|�}||d}}
}	i}g}
t
||�D]e}|j}i}|j|||
�D];}||kr�	||k\rn.||dz
d�dzx}||<||kDs�*||z
dz||z
dz|}}
}	�=|}�g|	|kDr]|
|kDrX|||
dz
�sJ||	dz
||
dz
k(r9|	dz
|
dz
|dz}}
}	|	|kDr%|
|kDr |||
dz
�s||	dz
||
dz
k(r�9|	|z|kr\|
|z|krT|||
|z�sF||	|z||
|zk(r5|dz
}|	|z|kr(|
|z|kr |||
|z�s||	|z||
|zk(r�5|	|kDr]|
|kDrX|||
dz
�rJ||	dz
||
dz
k(r9|	dz
|
dz
|dz}}
}	|	|kDr%|
|kDr |||
dz
�r||	dz
||
dz
k(r�9|	|z|kr\|
|z|krT|||
|z�rF||	|z||
|zk(r5|dz}|	|z|kr(|
|z|kr |||
|z�r||	|z||
|zk(r�5t|	|
|�S�Nrr0)	rrr1r6�__contains__r:�range�getr
)r"�alo�ahi�blo�bhirrr1�isbjunk�besti�bestj�bestsize�j2len�nothingr<�j2lenget�newj2len�j�ks                   r�find_longest_matchz"SequenceMatcher.find_longest_match1s?��+	�r"�V�V�T�V�V�T�X�X�t�z�z�7N�7N�N���1�c�7��;��a�&�C��;��a�&�C�!$�c�1�h�u�������s�C��A��y�y�H��H��W�W�Q�q�T�7�+���s�7����8��"*�1�Q�3��"2�Q�"6�6��H�Q�K��x�<�-.�q�S��U�A�a�C��E�1�(�5�E�,��E�!�(�c�k�e�c�k��!�E�!�G�*�%���a��j�A�e�A�g�J�&�%*�1�W�e�A�g�x��z�(�5�E��c�k�e�c�k��!�E�!�G�*�%���a��j�A�e�A�g�J�&��H�n�s�"�u�X�~��';��!�E�(�N�+�,���h���1�U�8�^�#4�4���M�H��H�n�s�"�u�X�~��';��!�E�(�N�+�,���h���1�U�8�^�#4�4��c�k�e�c�k��a��a��j�!���a��j�A�e�A�g�J�&�%*�1�W�e�A�g�x��z�(�5�E��c�k�e�c�k��a��a��j�!���a��j�A�e�A�g�J�&��H�n�s�"�u�X�~��';��a��h��'�(���h���1�U�8�^�#4�4��!�|�H��H�n�s�"�u�X�~��';��a��h��'�(���h���1�U�8�^�#4�4��U�E�8�,�,rc�"�	|j�|jSt|j�t|j�}}d|d|fg}g}|r�|j	�\}}}}|j||||�x\}	}
}}|r[|j
|�||	kr||
kr|j
||	||
f�|	|z|kr#|
|z|kr|j
|	|z||
|z|f�|r��|j�dx}
x}}g}|D]8\}}}|
|z|k(r||z|k(r||z
}�|r|j
|
||f�|||}}}
�:|r|j
|
||f�|j
||df�tttj|��|_|jS�Nr)r(r:rr�poprXr4�sort�list�mapr
�_make)r"�la�lb�queuer(rJrKrLrMr<rVrW�x�i1�j1�k1�non_adjacent�i2�j2�k2s                    r�get_matching_blocksz#SequenceMatcher.get_matching_blocks�s���	�$���+��'�'�'��T�V�V��c�$�&�&�k�B���R��B�� �����!&�����C��c�3��1�1�#�s�C��E�E�G�A�q�!�a���&�&�q�)���7�s�Q�w��L�L�#�q�#�q�!1�2��Q�3��9��1��s���L�L�!�A�#�s�A�a�C��!5�6��	����
����R�"���)�J�B��B��B�w�"�}��b��B���b���
� �'�'��R���5���R��B��*������R���-����b�"�a�[�*�#�C����\�$B�C����#�#�#rc�6�	|j�|jSdx}}gx|_}|j�D]_\}}}d}||kr||krd}n||krd}n||krd}|r|j|||||f�||z||z}}|s�J|jd||||f��a|S)Nr��replace�delete�insert�equal)r)rkr4)r"r<rV�answer�ai�bj�size�tags        r�get_opcodeszSequenceMatcher.get_opcodes�s���	�8�<�<�#��<�<���	��A� "�"���v� �4�4�6�L�B��D��C��2�v�!�b�&����R�����R������
�
��Q��A�r�2�4��d�7�B�t�G�q�A���
�
���Q��A�6�8�'7�(�
rc#�xK�	|j�}|sdg}|dddk(r/|d\}}}}}|t|||z
�|t|||z
�|f|d<|dddk(r/|d\}}}}}||t|||z�|t|||z�f|d<||z}g}	|D]\}}}}}|dk(r\||z
|kDrT|	j||t|||z�|t|||z�f�|	��g}	t|||z
�t|||z
�}}|	j|||||f���|	rt	|	�dk(r|	dddk(s|	��yyy�w)N)rqrr0rr0rrq���r0)rw�max�minr4r:)
r"rA�codesrvrdrhreri�nn�groups
          r�get_grouped_opcodesz#SequenceMatcher.get_grouped_opcodes#s�����	�0� � �"���*�+�E���8�A�;�'�!�"'��(��C��R��R��C��B�q�D�M�2�s�2�r�!�t�}�b�@�E�!�H���9�Q�<�7�"�"'��)��C��R��R��R��R��A����C��B�q�D�M�A�E�"�I�
��U����#(��C��R��R��g�~�"�R�%�"�*����c�2�s�2�r�!�t�}�b�#�b�"�Q�$�-�H�I������R��A����B��1��
�B���L�L�#�r�2�r�2�.�/�$)��#�e�*�a�-�E�!�H�Q�K�7�,B��K�-C�5�s�D8D:c��	td�|j�D��}t|t|j�t|j
�z�S)Nc3�&K�|]	}|d���y�w)ryNr)�.0�triples  r�	<genexpr>z(SequenceMatcher.ratio.<locals>.<genexpr>ks����J�/I�V�f�R�j�/I�s�)�sumrkrr:rr)r"rs  r�ratiozSequenceMatcher.ratioUsD��	�*�J�t�/G�/G�/I�J�J�����T�V�V��s�4�6�6�{�)B�C�Crc��	|j�2ix|_}|jD]}|j|d�dz||<�|j}i}|jd}}|jD]5}||�r||}n|j|d�}|dz
||<|dkDs�1|dz}�7t|t
|j�t
|j�z�SrF)r+rrIrGrrr:)r"r+r=�avail�availhasr�numbs       r�quick_ratiozSequenceMatcher.quick_rations���	��?�?�"�+-�-�D�O�j��v�v��",�.�.��a�"8�1�"<�
�3����_�_�
���!�.�.��'���6�6�C���}��S�z��!�~�~�c�1�-�����E�#�J��a�x�!�A�+��� ���T�V�V��s�4�6�6�{�)B�C�Crc��	t|j�t|j�}}tt	||�||z�Sr)r:rrrr{)r"r`ras   r�real_quick_ratioz SequenceMatcher.real_quick_ratio�s;��	��T�V�V��c�$�&�&�k�B�� ��B���R�"�W�5�5r)NrmrmT)rNrN)�)�__name__�
__module__�__qualname__r#r!r%r&r,rXrkrwrr�r�r��classmethodr�__class_getitem__rrrrr,s]��H�T>�@
�3�4�X%�Nr-�hE$�N5�n0�dD�2D�:
6�$�L�1�rrc���	|dkDstd|����d|cxkrdksntd|����g}t�}|j|�|D]p}|j|�|j	�|k\s�(|j�|k\s�<|j
�|k\s�P|j|j
�|f��rt||�}|D��cgc]\}}|��	c}}Scc}}w)Nrzn must be > 0: grzcutoff must be in [0.0, 1.0]: )	�
ValueErrorrr&r%r�r�r�r4�	_nlargest)�word�
possibilitiesrA�cutoff�result�src�scores        rrr�s����8
��6���3�4�4��&��C���v�G�H�H�
�F���A��J�J�t��
��	�
�
�1�
�����6�)��=�=�?�f�$��7�7�9����M�M�1�7�7�9�a�.�)���q�&�
!�F�$�%�f�(�%��A�f�%�%��%s�C#c�H�	djd�t||�D��S)Nrmc3�TK�|] \}}|dk(r|j�r|n|���"y�w)� N)�isspace)r��c�tag_cs   rr�z$_keep_original_ws.<locals>.<genexpr>�s/�����%�H�A�u��c�\�a�i�i�k��u�4�%�s�&()�join�zip)r��tag_ss  r�_keep_original_wsr��s)��K�
�7�7���A�u�
���rc�:�eZdZ	d	d�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)
rNc�"�	||_||_yr��linejunk�charjunk)r"r�r�s   rr#zDiffer.__init__*s��	�&!��
� ��
rc	#�zK�	t|j||�}|j�D]�\}}}}}|dk(r|j||||||�}	n\|dk(r|j	d|||�}	nB|dk(r|j	d|||�}	n(|dk(r|j	d|||�}	ntd|����|	Ed{�����y7��w)	Nrnro�-rp�+rqr��unknown tag )rr�rw�_fancy_replace�_dumpr�)
r"rr�cruncherrvrJrKrLrM�gs
          r�comparezDiffer.compareAs�����	�2#�4�=�=�!�Q�7��'/�';�';�'=�#�C��c�3���i���'�'��3��Q��S�A������J�J�s�A�s�C�0������J�J�s�A�s�C�0������J�J�s�A�s�C�0�� �S�!:�;�;��L�L�(>�
�s�B/B;�1B9�2B;c#�HK�	t||�D]}|�d||�����y�w)Nr�)rH)r"rvrc�lo�hir<s      rr�zDiffer._dumpjs(����B��r�2��A� �!�A�$�'�'��s� "c#��K�||z
||z
kr)|jd|||�}|jd|||�}n(|jd|||�}|jd|||�}||fD]}	|	Ed{����y7��w)Nr�r�)r�)
r"rrJrKrrLrM�first�secondr�s
          r�_plain_replacezDiffer._plain_replaceos�������9�s�S�y� ��Z�Z��Q��S�1�E��Z�Z��Q��S�1�F��Z�Z��Q��S�1�E��Z�Z��Q��S�1�F����A��L�L���s�A)A5�+A3�,A5c#�K�	d\}}t|j�}	d\}
}t||�D]�}||}
|	j|
�t||�D]t}||}||
k(r|
�||}}
�|	j	|�|	j�|kDs�9|	j
�|kDs�M|	j�|kDs�a|	j�||}}}�v��||kr(|
�|j||||||�Ed{���y|
|d}}}nd}
|j||||�Ed{���||||}}|
��dx}}|	j||�|	j�D]g\}}}}}||z
||z
}}|dk(r|d|zz
}|d|zz
}�)|dk(r	|d|zz
}�7|d	k(r	|d
|zz
}�E|dk(r|d|zz
}|d|zz
}�[td
|����|j||||�Ed{���nd|z��|j||dz|||dz|�Ed{���y7��7��7�67��w)N)g�G�z��?g�?�NNrrmrn�^ror�rpr�rqr�r��  r0)rr�rHr&r%r�r�r�r��
_fancy_helperr!rwr��_qformat)r"rrJrKrrLrM�
best_ratior�r��eqi�eqjrVrtr<rs�best_i�best_j�aelt�belt�atags�btagsrv�ai1�ai2�bj1�bj2r`ras                             rr�zDiffer._fancy_replace}s�����	�((��
�F�"�4�=�=�1�����S�
�s�C��A��1��B����b�!��3��_���q�T����8��{�#$�a�S����!�!�"�%��,�,�.��;��*�*�,�z�9��n�n�&��3�19���1A�1�a���J�!%�!�(����{��.�.�q�#�s�A�s�C�H�H�H��),�c�3�J�F�F��C��%�%�a��f�a��f�E�E�E��v�Y��&�	�d���;���E�E����d�D�)�+3�+?�+?�+A�'��S�#�s�C��s��C�#�I�B���)�#��S�2�X�%�E��S�2�X�%�E��H�_��S�2�X�%�E��H�_��S�2�X�%�E��G�^��S�2�X�%�E��S�2�X�%�E�$��%>�?�?�,B��}�}�T�4���>�>�>���+���%�%�a����3��6�!�8�S�I�I�I�QI��	F��,
?��	J�s[�B
H�
H�!H�58H�-G?�.'H�H�B7H�
H�+H�9H�:H�H�H�Hc#��K�g}||kr1||kr|j||||||�}n.|jd|||�}n||kr|jd|||�}|Ed{���y7��w)Nr�r�)r�r�)r"rrJrKrrLrMr�s        rr�zDiffer._fancy_helper�si��������9��S�y��'�'��3��Q��S�A���J�J�s�A�s�C�0��
�3�Y��
�
�3��3��,�A����s�AA!�A�A!c#�K�	t||�j�}t||�j�}d|z��|rd|�d���d|z��|r	d|�d���yy�w)N�- z? �
�+ )r��rstrip)r"�aline�bliner�r�s     rr�zDiffer._qformat�sr����	�"�%��/�6�6�8��!�%��/�6�6�8���U�l����u�g�R�.� ��U�l����u�g�R�.� ��s�AAr�)
r�r�r�r#r�r�r�r�r�r�rrrrr�s0��S�j!�.'�R(�
�\J�|
�!rrNz
\s*(?:#\s*)?$c��	||�duSrr)�line�pats  rrrs����t�9�D� � rc��	||vSrr)�ch�wss  rrr%s��
���8�Orc�v�	|dz}||z
}|dk(rdj|�S|s|dz}dj||�S�Nr0z{}z{},{}��format��start�stop�	beginningrs    r�_format_range_unifiedr�<sJ��&���	�I�
�E�\�F�
��{��{�{�9�%�%���Q��	��>�>�)�V�,�,rc	#�JK�	t|||||||�d}td||�j|�D]�}	|sVd}|rdj|�nd}
|rdj|�nd}dj||
|���dj|||���|	d|	d}
}t	|d	|
d
�}t	|d|
d�}d
j|||���|	D]J\}}}}}|dk(r|||D]	}d|z���� |dvr|||D]	}d|z���|dvs�:|||D]	}d|z����L��y�w)NFT�	{}rm�
--- {}{}{}z
+++ {}{}{}rryr0�r��z@@ -{} +{} @@{}rqr�>rornr�>rprnr�)�_check_typesrrr�r�)rr�fromfile�tofile�fromfiledate�
tofiledaterA�lineterm�startedr~�fromdate�todater��last�file1_range�file2_rangervrdrhrerir�s                      rr
r
Gsi����%�N��A�x���z�8�L��G� ��a��*�>�>�q�A����G�6B�v�}�}�\�2��H�2<�V�]�]�:�.�"�F��%�%�h��(�C�C��%�%�f�f�h�?�?��A�h��b�	�t��+�E�!�H�d�1�g�>��+�E�!�H�d�1�g�>���&�&�{�K��J�J�#(��C��R��R��g�~��b��H�D���*�$�%���+�+��b��H�D���*�$�%��+�+��b��H�D���*�$�%�$)�B�s�D
D#�
D#c��	|dz}||z
}|s|dz}|dkrdj|�Sdj|||zdz
�Sr�r�r�s    r�_format_range_contextr��sT��&���	�I�
�E�\�F���Q��	�
��{��{�{�9�%�%��>�>�)�Y��%7�!�%;�<�<rc	#��K�	t|||||||�tdddd��}d}	td||�j|�D�],}
|	sVd}	|rdj	|�nd	}|rdj	|�nd	}d
j	|||���dj	|||���|
d|
d
}}
d|z��t|
d|d�}dj	||���t
d�|
D��r'|
D]"\}}}}}|dk7s�|||D]}|||z����$t|
d|d�}dj	||���t
d�|
D��s��|
D]"\}}}}}|dk7s�|||D]}|||z����$��/y�w)Nr�r�z! r�)rprornrqFTr�rmz
*** {}{}{}r�rryz***************r0r�z
*** {} ****{}c3�0K�|]\}}}}}|dv���y�w)>rornNr�r�rv�_s   rr�zcontext_diff.<locals>.<genexpr>��!����I�5���Q��1�a�s�+�+�5���rpr�r�z
--- {} ----{}c3�0K�|]\}}}}}|dv���y�w)>rprnNrr�s   rr�zcontext_diff.<locals>.<genexpr>�r�r�ro)r��dictrrr�r��any)rrr�r�r�r�rAr��prefixr�r~r�r�r�r�r�rvrdrhr�r�r�reris                        rr	r	�s�����(�T��A�x���z�8�L�
��d�D��
E�F��G� ��a��*�>�>�q�A����G�6B�v�}�}�\�2��H�2<�V�]�]�:�.�"�F��%�%�h��(�C�C��%�%�f�f�h�?�?��A�h��b�	�t���(�*�*�+�E�!�H�d�1�g�>���$�$�[�(�;�;��I�5�I�I�%*�!��R��Q���(�?� !�"�R���$�S�k�D�0�0�!)�&+�
,�E�!�H�d�1�g�>���$�$�[�(�;�;��I�5�I�I�%*�!��Q��2�r��(�?� !�"�R���$�S�k�D�0�0�!)�&+�1B�s�C5E3�8AE3�E3�E3c�N�|r>t|dt�s+tdt|d�j�d|d�d���|r>t|dt�s+tdt|d�j�d|d�d���|D] }t|t�r�td|����y)Nrz"lines to compare must be str, not � (�)z all arguments must be str, not: )�
isinstance�str�	TypeError�typer�)rr�args�args    rr�r��s���	��A�a�D�#�&���a��d��,�,�a��d�4�5�	5���A�a�D�#�&���a��d��,�,�a��d�4�5�	5����#�s�#��C�I�J�J�rc	
#�K�	d�}	tt|	|��}tt|	|��}|	|�}|	|�}|	|�}|	|�}|	|�}|||||||||�}
|
D]}|jdd����y�w)Nc��	|jdd�S#t$r-}dt|�j�d|�d�}t	|�|�d}~wwxYw)N�ascii�surrogateescapez!all arguments must be bytes, not rr)�decode�AttributeErrorr	r�r)r��err�msgs   rrzdiff_bytes.<locals>.decodesK��	*��8�8�G�%6�7�7���	*���G�$�$�a�)�C��C�.�c�)��	*�s��	A
�(A�A
rr)r]r^�encode)�dfuncrrr�r�r�r�rAr�r�linesr�s            rrr�s������*�	
�S���^��A��S���^��A��h��H�
�F�^�F��,�'�L��
�#�J��h��H��!�Q��&�,�
�A�x�P�E����k�k�'�#4�5�5��s�BBc�<�	t||�j||�Sr)rr�)rrr�r�s    rrrs$��!�D�(�H�%�-�-�a��3�3rc#�����K�	ddl}|jd��t||||��ddgf�fd�	���fd���fd�}|�}|�|Ed{���y|dz
}d}	ddg|z}
}	d}|dur'	t|�\}}
}|	|z}||
|f|
|<|	dz
}	|dur�'|	|kDrd��|}n|	}d}	|r|	|z}|	dz
}	|
|��|dz}|r�|dz
}	|r&t|�\}}
}|r|dz
}n|dz}||
|f��|r�&��7��#t$rYywxYw#t$rYywxYw�w)	Nrz
(\++|\-+|\^+)c���	||xxdz
cc<|�|||jd�ddfS|dk(rq|jd�|jd�}}g}|fd�}�j||�t|�D]"\}\}	}
|d|	dz|z||	|
zdz||
dz}�$|dd}n#|jd�dd}|sd}d|z|zdz}|||fS)	Nr0rr��?c��|j|jd�d|j�g�|jd�S)Nr0r)r4r~�span)�match_object�sub_infos  r�record_sub_infoz3_mdiff.<locals>._make_line.<locals>.record_sub_info�s=������!3�!3�A�!6�q�!9�,�:K�:K�:M� N�O�#�)�)�!�,�,r��r�)r[�sub�reversed)r�
format_key�side�	num_lines�text�markersrr�key�begin�end�	change_res           �r�
_make_linez_mdiff.<locals>._make_linefs���	�,	�$��1������d�O�E�I�I�a�L���$4�5�5����!�I�I�a�L�%�)�)�A�,�'�D��H�6>�
-�
�M�M�/�'�2�$,�H�#5���K�U�3��A�e�}�T�)�#�-�d�5��o�=�d�B�4���:�M��$6����8�D��9�9�Q�<���#�D�����*�$�t�+�d�2�D��$���%�%rc3��K�	g}d\}}	t|�dkr*|jt�d��t|�dkr�*dj|D�cgc]}|d��	c}�}|j	d�r|}�n�|j	d�r�|dd��|dd	�df����|j	d
�r|d	z}�|dd�ddf����|j	d�r�|dd�d}}|d	z
d}}�n|j	d
�r�|dd��|dd	�df����|j	d�r�|dd��|dd	�df����9|j	d�r|d	z}�|dd�ddf����`|j	d�r|d	z
}d�|dd	�df�����|j	d�rd�|dd	�}}|d	zd}}nT|j	d�r|d	z
}d�|dd	�df�����|j	d�r�|dddd��|dd	�df����|dkr|d	z
}d��|dkr�|dkDr|d	z}d��|dkDr�|j	d�rydf����Bcc}w�w)N)rrTr��Xrmrz-?+?rr0z--++r�)z--?+z--+r�z-+?z-?+z+--r�)r�z+-r�F)N�rmr�T)r0NT)r:r4�nextr��
startswith)	r�num_blanks_pending�num_blanks_to_yieldr�r��	from_line�to_liner-�diff_lines_iterators	       ��r�_line_iteratorz_mdiff.<locals>._line_iterator�s������	���26�/��/���e�*�q�.����T�"5�s�;�<��e�*�q�.����U�3�U�T��a��U�3�4�A��|�|�C� �'9�#����f�%� ��s�1�-�z�%��A�/F��L�L�����f�%�#�a�'�"� ��s�1�-�t�T�9�9�����3�4�%/�u�S��$;�T�'�	�9K�A�9M�a�$6�#����e�$� ��t�A�.�
�5��Q�0G��M�M�����e�$� ��s�1�-�z�%��Q�/G��M�M�����c�"�"�a�'�"� ��s�1�-�t�T�9�9�����e�$�#�a�'�"��J�u�S��3�T�9�9�����l�+�%)�:�e�C��+B�7�	�9K�A�9M�a�$6�#����c�"�"�a�'�"��J�u�S��3�T�9�9�����c�"� ��q��$�q�1�*�U�4��2J�5�P�P��&��)�#�q�(�#�)�)�&��)�&��)�#�q�(�#�)�)�&��)��|�|�C� �����,�,�M��4�s%�AI�I�I� F?I� I�4 Ic3��K�	��}gg}}	t|�dk(st|�dk(rX	t|�\}}}|�|j||f�|�|j||f�t|�dk(r�It|�dk(r�X|j	d�\}}|j	d�\}}|||xs|f����#t$rYywxYw�wrZ)r:r1�
StopIterationr4r[)	�
line_iterator�	fromlines�tolinesr5r6�
found_diff�fromDiff�to_diffr8s	        �r�_line_pair_iteratorz#_mdiff.<locals>._line_pair_iterator�s������	�'�(�
��R�'�	���y�>�1�$��G��a���59�-�5H�2�I�w�
��(��$�$�i�
�%;�<��&��N�N�G�J�#7�8��y�>�1�$��G��a��#,�-�-��"2��I�x�&�{�{�1�~��G�W��W�X�%8��9�9���
%����s3�*C�B9�8C�6C�4C�9	C�C�C�Cr0F)NNN)�re�compilerr1r:)r<r=�contextr�r�rBrA�line_pair_iterator�lines_to_write�index�contextLinesr>r5r6r<r8r-r,r7s               @@@@r�_mdiffrI<s�������@���
�
�+�,�I� �	�'�(�8�D��78��e�6&�pV-�p:�B-�.����%�%�%�	�1������#$�d�V�W�%5�<�E��J���%��59�:L�5M�2�I�w�
��G�O��#,�g�z�"B��Q����
����%��w��&�&�!(��!&���� ��G�O����
��"�1�o�%��!�#��	!�%�Q�Y�N�
�$�59�:L�5M�2�I�w�
�!�)0����&�!�+��#�W�j�8�8�%�=�
	&��%�����:!�
��
�sf�AD�C+�D�+C-�:D�*D�<D�'C<�*D�-	C9�6D�8C9�9D�<	D�D�D�Dan
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=%(charset)s" />
    <title></title>
    <style type="text/css">%(styles)s
    </style>
</head>

<body>
    %(table)s%(legend)s
</body>

</html>aH
        table.diff {font-family:Courier; border:medium;}
        .diff_header {background-color:#e0e0e0}
        td.diff_header {text-align:right}
        .diff_next {background-color:#c0c0c0}
        .diff_add {background-color:#aaffaa}
        .diff_chg {background-color:#ffff77}
        .diff_sub {background-color:#ffaaaa}aZ
    <table class="diff" id="difflib_chg_%(prefix)s_top"
           cellspacing="0" cellpadding="0" rules="groups" >
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        %(header_row)s
        <tbody>
%(data_rows)s        </tbody>
    </table>a�
    <table class="diff" summary="Legends">
        <tr> <th colspan="2"> Legends </th> </tr>
        <tr> <td> <table border="" summary="Colors">
                      <tr><th> Colors </th> </tr>
                      <tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
                      <tr><td class="diff_chg">Changed</td> </tr>
                      <tr><td class="diff_sub">Deleted</td> </tr>
                  </table></td>
             <td> <table border="" summary="Links">
                      <tr><th colspan="2"> Links </th> </tr>
                      <tr><td>(f)irst change</td> </tr>
                      <tr><td>(n)ext change</td> </tr>
                      <tr><td>(t)op</td> </tr>
                  </table></td> </tr>
    </table>c�z�eZdZ	eZeZeZeZdZdddefd�Z			ddd�d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Z		dd�Zy)rr�Nc�>�	||_||_||_||_yr)�_tabsize�_wrapcolumn�	_linejunk�	_charjunk)r"�tabsize�
wrapcolumnr�r�s     rr#zHtmlDiff.__init__�s&��		� ��
�%���!���!��rzutf-8)�charsetc
���	|jt|j|j|j	||||||��|��zj|d�j
|�S)N)rD�numlines)�styles�legend�tablerS�xmlcharrefreplace)�_file_templater�_styles�_legend�
make_tablerr)r"r<r=�fromdesc�todescrDrUrSs        r�	make_filezHtmlDiff.make_file�sk��	�"�#�#�d��<�<��<�<��/�/�)�W�h��*1�H�"�F��'
�
��6�'�.�/���w��
	@rc���	�fd�}|D�cgc]
}||���}}|D�cgc]
}||���}}||fScc}wcc}w)Nc����|jdd�}|j�j�}|jdd�}|jdd�jd�S)Nr�r �	r�)rn�
expandtabsrMr�)r�r"s �r�expand_tabsz2HtmlDiff._tab_newline_replace.<locals>.expand_tabs�sS����<�<��D�)�D��?�?�4�=�=�1�D��<�<��D�)�D��<�<��S�)�0�0��6�6rr)r"r<r=rer�s`    r�_tab_newline_replacezHtmlDiff._tab_newline_replace�sT���	�	7�4=�=�9�4�[��&�9�	�=�18�9���;�t�$���9��� � ��>��9s�6�;c���	|s|j||f�yt|�}|j}||ks||jd�dzz
|kr|j||f�yd}d}d}||krB||kr=||dk(r|dz
}||}|dz
}n||dk(r|dz
}d}n
|dz
}|dz
}||kr||kr�=|d|}	||d}
|r
|	dz}	d|z|
z}
|j||	f�|j	|d|
�y)Nr r�rrmr0r!�>)r4r:rN�count�_split_line)r"�	data_list�line_numr'rurzr<rA�mark�line1�line2s           rrjzHtmlDiff._split_line�sH��	�����h�t�_�-���4�y�������C�K�d�T�Z�Z��%5�a�%7�8�S�@����h�t�_�-��
��
�����#�g�!�d�(��A�w�$���Q����A�w���Q����a��D���Q������Q����Q����#�g�!�d�(��R�a����Q�R���
��D�L�E��4�K�%�'�E�	���(�5�)�*�	
����3�u�-rc#�K�	|D]�\}}}|�|||f���||c\}}\}}gg}
}	|j|	||�|j|
||�|	s|
s�K|	r|	jd�}nd}|
r|
jd�}nd}|||f��|	r�6|
r�9��y�w)Nr)rmr�)rjr[)r"�diffs�fromdata�todata�flag�fromline�fromtext�toline�totext�fromlist�tolists           r�
_line_wrapperzHtmlDiff._line_wrappers�����C�%*� �H�V�D��|��v�d�*�*��2:�6�/��X�h����!��V�H����X�h�x�8����V�F�6�2��f��'�|�|�A��H�'�H��#�Z�Z��]�F�%�F��v�d�*�*��f�%*�s�AB
�5B
�B
�
B
c�B�	ggg}}}|D]^\}}}	|j|jd|g|����|j|jd|g|����|j|��`|||fS#t$r%|jd�|jd�Y�EwxYwrF)r4�_format_liner)r"rqryrz�flaglistrrrsrts        r�_collect_lineszHtmlDiff._collect_lines.s���	�$&�b�����$)� �H�V�D�
$���� 1�� 1� 1�!�D� C�(� C�D��
�
�/�d�/�/��$�?��?�@�

�O�O�D�!�%*���x�'�'���
$�����%��
�
�d�#�
$�s�AA0�0+B�Bc��		d|z}d|j|�|�d�}|jdd�jdd�jd	d
�}|jdd�j�}d
|�d|�d|�d�S#t$rd}Y�kwxYw)Nz%dz id="�"rm�&z&amp;rhz&gt;�<z&lt;r��&nbsp;z<td class="diff_header"z</td><td nowrap="nowrap">z</td>)�_prefixrrnr�)r"r%rt�linenumr'�ids      rr}zHtmlDiff._format_lineCs���	�	��W�n�G�!%���d�!3�G�<�B�
�\�\�#�g�
&�
.�
.�s�6�
:�
B�
B�3�v�
N���|�|�C��)�0�0�2���W�T�#�	#���	��B�	�s�A;�;B	�B	c��	dtjz}dtjz}txjdz
c_||g|_y)Nzfrom%d_zto%d_r0)r�_default_prefixr�)r"�
fromprefix�toprefixs   r�_make_prefixzHtmlDiff._make_prefixZsD��+���!9�!9�9�
��X�5�5�5��� � �A�%� �"�8�,��rc�h�	|jd}dgt|�z}dgt|�z}d\}	}
d}t|�D]:\}}
|
r1|
r�d}
|}td||z
g�}d||	fz||<|	dz
}	d||	fz||<�9d}
�<|sdg}dg}dg}d}|rd	g}|}nd
gx}}|dsd|z|d<d|z||<|||||fS)
Nr0rm)rFrTz id="difflib_chg_%s_%d"z"<a href="#difflib_chg_%s_%d">n</a>Fz2<td></td><td>&nbsp;No Differences Found&nbsp;</td>z(<td></td><td>&nbsp;Empty File&nbsp;</td>z!<a href="#difflib_chg_%s_0">f</a>z#<a href="#difflib_chg_%s_top">t</a>)r�r:r2rz)r"ryrzr~rDrUr��next_id�	next_href�num_chg�	in_changer�r<rts              r�_convert_flagszHtmlDiff._convert_flagses*��(��<�<��?���$�s�8�}�$���D��X��&�	�%��������)�F�A�d�� � $�I��D��Q�q��z�N�+�A�!:�h�w�=O�!O�G�A�J��q�L�G�&J�!�'�N+�'+�I�d�O�"�	�!*�$��w�H��d�G���I��D��P�Q��!��%O�$P�P��6���{�>��I�I�a�L�?�8�L�	�$����x�	�'�9�9rc
�F�	|j�|j||�\}}|r|}nd}t||||j|j��}|j
r|j
|�}|j|�\}	}
}|j|	|
|||�\}	}
}}}
g}d}tt|��D]G}||�|dkDs�|jd�� |j||
||||	||||
|fz��I|s|rdd�d|z�d�d|z�d�}nd	}|jtd	j|�||jd
��z}|j!dd
�j!dd�j!dd�j!dd�j!dd�S)Nr�zV            <tr><td class="diff_next"%s>%s</td>%s<td class="diff_next">%s</td>%s</tr>
rz)        </tbody>        
        <tbody>
z<thead><tr>z!<th class="diff_next"><br /></th>z+<th colspan="2" class="diff_header">%s</th>z
</tr></thead>rmr0)�	data_rows�
header_rowrz+z<span class="diff_add">z-z<span class="diff_sub">z^z<span class="diff_chg">r!z</span>rcr�)r�rfrIrOrPrNr{rr�rHr:r4�_table_templaterr�r�rn)r"r<r=r^r_rDrU�
context_linesrqryrzr~r�r�r��fmtr<r�rXs                   rr]zHtmlDiff.make_table�s���	�$	
����!�5�5�i��H��	�'��$�M� �M��y������#�~�~�/������&�&�u�-�E�$(�#6�#6�u�#=� ����6:�5H�5H��V�H�W�X�67�2�����7�
��7���s�8�}�%�A���{�"��q�5��H�H�J�K����#����I�a�L��!��+4�Q�<��q�	�!C�C�D�&��v��3�=��H�3�=��F�	H�J��J��$�$�t��g�g�a�j�!��<�<��?�($�$��
�}�}�U�#<�=��W�U�#<�=��W�U�#<�=��W�T�)�,��W�T�(�+�		,r)rmrmF�)r�r�r�rZr[r�r\r�rr#r`rfrjr{rr}r�r�r]rrrrr�s��
�$�N��G�%�O��G��O��4��+�"�"AC�*+�@�8?�@�6!�.5.�n+�8(�*#�.	-�-:�^IN��K,rrc#�K�		ddd�t|�}d|f}|D]}|dd|vs�|dd���y#t$rtd|z�d�wxYw�w)Nr�r�)r0r�z)unknown delta choice (must be 1 or 2): %rr�r�)�int�KeyErrorr�)�delta�whichrv�prefixesr�s     rrr�s|�����*.��4� ��U��,���c�{�H������8�x���q�r�(�N���	�.��D�"�#�$�)-�	.�.�s�A
�1�A
�
A
�A
�
A
c�4�ddl}ddl}|j|�SrZ)�doctest�difflib�testmod)r�r�s  r�_testr�s����?�?�7�#�#r�__main__)r�g333333�?)z 	)rmrmrmrmr�r�)rrrrr��
)%�__all__�heapqrr��collectionsr�_namedtuple�typesrr
rrrr�rrBrC�matchrrr�r
r�r	r�rrrIrZr[r�r\�objectrrr�r�rrr�<module>r�s���8>��(�1���G�Z�(���
k	2�k	2�\.&�b�l!�l!�~	
�%�2�:�:�&6�7�=�=�!� �.	-�=?�.2�B%�R	=�,.�?C�J1�XK�"25�?D�6�<�(9�#4�J(,�d�%�K�\��(0������"],�v�],�~
��@$��z��	�G�r