AlkantarClanX12

Your IP : 3.141.21.199


Current Path : /proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python311/lib64/python3.11/__pycache__/difflib.cpython-311.opt-2.pyc

�

c��flE���	gd�ZddlmZddlmZddlmZedd��Z	d�Z
Gd�d	��Zd*d�Zd
�Z
Gd�d��ZddlZejd��jfd�Zd+d�Zd�Z		d,d�Zd�Z		d,d�Zd�Z		d-d�Zdefd�Zddefd �Zd!Zd"Zd#Zd$ZGd%�d&e ��Z![d'�Z"d(�Z#e$d)kre#��dSdS).)�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|zSdS)Ng@��?�)�matches�lengths  �./opt/alt/python311/lib64/python3.11/difflib.py�_calculate_ratior's��
�&��W�}�v�%�%��3�c�t�eZdZ	dd�Zd�Zd�Zd�Zd�Zdd
�Zd�Z	d�Z
dd�Zd�Zd�Z
d�Zee��ZdS)rN�Tc�l�	||_dx|_|_||_|�||��dS�N)�isjunk�a�b�autojunk�set_seqs)�selfrrr r!s     r�__init__zSequenceMatcher.__init__xs@��	�t��������� ��
��
�
�a������rc�\�	|�|��|�|��dSr)�set_seq1�set_seq2)r#rr s   rr"zSequenceMatcher.set_seqs�s3��	�	
�
�
�a�����
�
�a�����rc�H�	||jurdS||_dx|_|_dSr)r�matching_blocks�opcodes)r#rs  rr&zSequenceMatcher.set_seq1�s3��	�(
���;�;��F����.2�2���t�|�|�|rc�~�	||jurdS||_dx|_|_d|_|���dSr)r r)r*�
fullbcount�_SequenceMatcher__chain_b)r#r s  rr'zSequenceMatcher.set_seq2�sL��	�(
���;�;��F����.2�2���t�|�����������rc�n�|j}ix|_}t|��D]0\}}|�|g��}|�|���1t��x|_}|j}|r?|���D]"}||��r|�	|���#|D]}||=�t��x|_
}t|��}	|jrX|	dkrT|	dzdz}
|�
��D]-\}}t|��|
kr|�	|���.|D]	}||=�dSdSdS)N���d�)r �b2j�	enumerate�
setdefault�append�set�bjunkr�keys�add�bpopular�lenr!�items)r#r r2�i�elt�indices�junkr�popular�n�ntest�idxss            r�	__chain_bzSequenceMatcher.__chain_b
ss��
�F������3���l�l�	�	�F�A�s��n�n�S�"�-�-�G��N�N�1����� �E�E�!��
�T�����	��x�x�z�z�
"�
"���6�#�;�;�"��H�H�S�M�M�M���
�
����H�H�#&�%�%�'��
����F�F���=�	�Q�#�X�X���H�q�L�E� �Y�Y�[�[�
%�
%�	��T��t�9�9�u�$�$��K�K��$�$�$���
�
����H�H�
	�	�X�X�

�
rrc��	|j|j|j|jjf\}}}}|�t|��}|�t|��}||d}}
}	i}g}
t
||��D]j}|j}i}|�|||
��D]@}||kr�	||krn0||dz
d��dzx}||<||kr||z
dz||z
dz|}}
}	�A|}�k|	|kry|
|krs|||
dz
��s_||	dz
||
dz
krG|	dz
|
dz
|dz}}
}	|	|kr2|
|kr,|||
dz
��s||	dz
||
dz
k�G|	|z|krx|
|z|kro|||
|z��s[||	|z||
|zkrC|dz
}|	|z|kr5|
|z|kr,|||
|z��s||	|z||
|zk�C|	|kry|
|krs|||
dz
��r_||	dz
||
dz
krG|	dz
|
dz
|dz}}
}	|	|kr2|
|kr,|||
dz
��r||	dz
||
dz
k�G|	|z|krx|
|z|kro|||
|z��r[||	|z||
|zkrC|dz}|	|z|kr5|
|z|kr,|||
|z��r||	|z||
|zk�Ct|	|
|��S�Nrr1)	rr r2r7�__contains__r;�range�getr
)r#�alo�ahi�blo�bhirr r2�isbjunk�besti�bestj�bestsize�j2len�nothingr=�j2lenget�newj2len�j�ks                   r�find_longest_matchz"SequenceMatcher.find_longest_match1s���+	�r"�V�T�V�T�X�t�z�7N�N���1�c�7��;��a�&�&�C��;��a�&�&�C�!$�c�1�h�u�������s�C���	�	�A��y�H��H��W�W�Q�q�T�7�+�+�
=�
=���s�7�7����8�8��E�"*�(�1�Q�3��"2�"2�Q�"6�6��H�Q�K��x�<�<�-.�q�S��U�A�a�C��E�1�(�5�E���E�E��c�k�k�e�c�k�k��'�!�E�!�G�*�%�%�*���a��j�A�e�A�g�J�&�&�%*�1�W�e�A�g�x��z�(�5�E��c�k�k�e�c�k�k��'�!�E�!�G�*�%�%�*���a��j�A�e�A�g�J�&�&��H�n�s�"�"�u�X�~��';�';��'�!�E�(�N�+�,�,�(<���h���1�U�8�^�#4�4�4���M�H��H�n�s�"�"�u�X�~��';�';��'�!�E�(�N�+�,�,�(<���h���1�U�8�^�#4�4�4��c�k�k�e�c�k�k��g�a��a��j�!�!�*���a��j�A�e�A�g�J�&�&�%*�1�W�e�A�g�x��z�(�5�E��c�k�k�e�c�k�k��g�a��a��j�!�!�*���a��j�A�e�A�g�J�&�&��H�n�s�"�"�u�X�~��';�';��g�a��h��'�(�(�(<���h���1�U�8�^�#4�4�4��!�|�H��H�n�s�"�"�u�X�~��';�';��g�a��h��'�(�(�(<���h���1�U�8�^�#4�4�4��U�E�8�,�,�,rc�V�	|j�|jSt|j��t|j��}}d|d|fg}g}|r�|���\}}}}|�||||��x\}	}
}}|rk|�|��||	kr||
kr|�||	||
f��|	|z|kr(|
|z|kr|�|	|z||
|z|f��|��|���dx}
x}}g}|D]>\}}}|
|z|kr||z|kr||z
}�|r|�|
||f��|||}}}
�?|r|�|
||f��|�||df��tttj|����|_|jS�Nr)r)r;rr �poprYr5�sort�list�mapr
�_make)r#�la�lb�queuer)rKrLrMrNr=rWrX�x�i1�j1�k1�non_adjacent�i2�j2�k2s                    r�get_matching_blocksz#SequenceMatcher.get_matching_blocks�s��	�$��+��'�'��T�V���c�$�&�k�k�B���R��B�� �����	7�!&������C��c�3��1�1�#�s�C��E�E�E�G�A�q�!�a��
7��&�&�q�)�)�)���7�7�s�Q�w�w��L�L�#�q�#�q�!1�2�2�2��Q�3��9�9��1��s����L�L�!�A�#�s�A�a�C��!5�6�6�6��	7�	������
����R�"���)�
	(�
	(�J�B��B��B�w�"�}�}��b��B����b����
�6� �'�'��R���5�5�5���R��B���
�	.�����R���-�-�-����b�"�a�[�*�*�*�#�C���\�$B�$B�C�C����#�#rc�<�	|j�|jSdx}}gx|_}|���D]j\}}}d}||kr	||krd}n||krd}n||krd}|r|�|||||f��||z||z}}|r|�d||||f���k|S)Nrr�replace�delete�insert�equal)r*rlr5)r#r=rW�answer�ai�bj�size�tags        r�get_opcodeszSequenceMatcher.get_opcodes�s���	�8�<�#��<���	��A� "�"���v� �4�4�6�6�	9�	9�L�B��D��C��2�v�v�!�b�&�&�����R�������R������
5��
�
��Q��A�r�2�4�4�4��d�7�B�t�G�q�A��
9��
�
���Q��A�6�8�8�8���
r�c#�K�	|���}|sdg}|dddkr:|d\}}}}}|t|||z
��|t|||z
��|f|d<|dddkr:|d\}}}}}||t|||z��|t|||z��f|d<||z}g}	|D]�\}}}}}|dkrq||z
|krh|	�||t|||z��|t|||z��f��|	V�g}	t|||z
��t|||z
��}}|	�|||||f����|	r+t	|	��dkr|	dddks|	V�dSdSdS)N)rqrr1rr1rrq���r1)rw�max�minr5r;)
r#rB�codesrvrerirfrj�nn�groups
          r�get_grouped_opcodesz#SequenceMatcher.get_grouped_opcodes#s�����	�0� � �"�"���	,�*�+�E���8�A�;�'�!�!�"'��(��C��R��R��C��B�q�D�M�M�2�s�2�r�!�t�}�}�b�@�E�!�H���9�Q�<�7�"�"�"'��)��C��R��R��R��R��A�����C��B�q�D�M�M�A�E�"�I�
��U����#(�	0�	0��C��R��R��g�~�~�"�R�%�"�*�*����c�2�s�2�r�!�t�}�}�b�#�b�"�Q�$�-�-�H�I�I�I��������R��A�����B��1��
�
�B���L�L�#�r�2�r�2�.�/�/�/�/��	�#�e�*�*�a�-�-�E�!�H�Q�K�7�,B�,B��K�K�K�K�K�	�	�,B�,Brc���	td�|���D����}t|t|j��t|j��z��S)Nc3�&K�|]}|dV��
dS)rzNr)�.0�triples  r�	<genexpr>z(SequenceMatcher.ratio.<locals>.<genexpr>ks&����J�J�V�f�R�j�J�J�J�J�J�Jr)�sumrlrr;rr )r#rs  r�ratiozSequenceMatcher.ratioUsV��	�*�J�J�t�/G�/G�/I�/I�J�J�J�J�J�����T�V���s�4�6�{�{�)B�C�C�Crc��	|j�/ix|_}|jD]}|�|d��dz||<�|j}i}|jd}}|jD]?}||��r	||}n|�|d��}|dz
||<|dkr|dz}�@t|t
|j��t
|j��z��SrG)r,r rJrHrrr;)r#r,r>�avail�availhasr�numbs       r�quick_ratiozSequenceMatcher.quick_rations���	��?�"�+-�-�D�O�j��v�
=�
=��",�.�.��a�"8�"8�1�"<�
�3����_�
���!�.��'���6�	&�	&�C��x��}�}�
.��S�z���!�~�~�c�1�-�-�����E�#�J��a�x�x�!�A�+������T�V���s�4�6�{�{�)B�C�C�Crc��	t|j��t|j��}}tt	||��||z��Sr)r;rr rr|)r#rarbs   r�real_quick_ratioz SequenceMatcher.real_quick_ratio�s@��	��T�V���c�$�&�k�k�B�� ��B����R�"�W�5�5�5r)NrrT)rNrN)rx)�__name__�
__module__�__qualname__r$r"r&r'r-rYrlrwr�r�r�r��classmethodr�__class_getitem__rrrrr,s������H�T>�>�>�>�@
�
�
�3�3�3�4���X%�%�%�Nr-�r-�r-�r-�hE$�E$�E$�N5�5�5�n0�0�0�0�dD�D�D�2D�D�D�:
6�
6�
6�$��L�1�1���rrrx�333333�?c��	|dkstd|�����d|cxkrdksntd|�����g}t��}|�|��|D]�}|�|��|���|krY|���|krA|���|kr)|�|���|f����t||��}d�|D��S)Nrzn must be > 0: grzcutoff must be in [0.0, 1.0]: c��g|]\}}|��Srr)r��scorerds   r�
<listcomp>z%get_close_matches.<locals>.<listcomp>�s��%�%�%�(�%��A�%�%�%r)	�
ValueErrorrr'r&r�r�r�r5�	_nlargest)�word�
possibilitiesrB�cutoff�result�srds       rrr�s���8
��6�6��j���3�4�4�4��&�����C������j�v�v�G�H�H�H�
�F����A��J�J�t����
�*�*��	�
�
�1�
�
�
������6�)�)��=�=�?�?�f�$�$��7�7�9�9�����M�M�1�7�7�9�9�a�.�)�)�)���q�&�
!�
!�F�%�%�f�%�%�%�%rc�^�	d�d�t||��D����S)Nrc3�XK�|]%\}}|dkr|���r|n|V��&dS)� N)�isspace)r��c�tag_cs   rr�z$_keep_original_ws.<locals>.<genexpr>�sR�������A�u��c�\�\�a�i�i�k�k�\���u������r)�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	dS)
rNc�$�	||_||_dSr��linejunk�charjunk)r#r�r�s   rr$zDiffer.__init__*s��	�&!��
� ��
�
�
rc	#�K�	t|j||��}|���D]�\}}}}}|dkr|�||||||��}	no|dkr|�d|||��}	nP|dkr|�d|||��}	n1|dkr|�d|||��}	ntd|�����|	Ed{V����dS)	Nrnro�-rp�+rqr��unknown tag )rr�rw�_fancy_replace�_dumpr�)
r#rr �cruncherrvrKrLrMrN�gs
          r�comparezDiffer.compareAs����	�2#�4�=�!�Q�7�7��'/�';�';�'=�'=�	�	�#�C��c�3���i����'�'��3��Q��S�A�A��������J�J�s�A�s�C�0�0��������J�J�s�A�s�C�0�0��������J�J�s�A�s�C�0�0��� �j�S�S�!:�;�;�;��L�L�L�L�L�L�L�L�	�	rc#�PK�	t||��D]}|�d||��V��dS)Nr�)rI)r#rvrd�lo�hir=s      rr�zDiffer._dumpjsH����B��r�2���	(�	(�A� �S�S�!�A�$�$�'�'�'�'�'�	(�	(rc#�K�||z
||z
kr1|�d|||��}|�d|||��}n0|�d|||��}|�d|||��}||fD]
}	|	Ed{V���dS)Nr�r�)r�)
r#rrKrLr rMrN�first�secondr�s
          r�_plain_replacezDiffer._plain_replaceos�������9�s�S�y� � ��Z�Z��Q��S�1�1�E��Z�Z��Q��S�1�1�F�F��Z�Z��Q��S�1�1�E��Z�Z��Q��S�1�1�F����	�	�A��L�L�L�L�L�L�L�L�	�	rc#�K�	d\}}t|j��}	d\}
}t||��D]�}||}
|	�|
��t||��D]�}||}||
kr|
�||}}
�|	�|��|	���|krH|	���|kr0|	���|kr|	���||}}}����||kr+|
�"|�||||||��Ed{V��dS|
|d}}}nd}
|�	||||||��Ed{V��||||}}|
��dx}}|	�
||��|	���D]o\}}}}}||z
||z
}}|dkr|d|zz
}|d|zz
}�)|dkr	|d|zz
}�8|d	kr	|d
|zz
}�G|dkr|d|zz
}|d|zz
}�^td
|�����|�
||||��Ed{V��nd|zV�|�	||dz|||dz|��Ed{V��dS)N)g�G�z��?g�?�NNrrrn�^ror�rpr�rqr�r��  r1)rr�rIr'r&r�r�r�r��
_fancy_helperr"rwr��_qformat)r#rrKrLr rMrN�
best_ratior�r��eqi�eqjrWrtr=rs�best_i�best_j�aelt�belt�atags�btagsrv�ai1�ai2�bj1�bj2rarbs                             rr�zDiffer._fancy_replace}s0����	�((��
�F�"�4�=�1�1�����S�
�s�C���	H�	H�A��1��B����b�!�!�!��3��_�_�
H�
H���q�T����8�8��{�#$�a�S����!�!�"�%�%�%��,�,�.�.��;�;��*�*�,�,�z�9�9��n�n�&�&��3�3�19���1A�1A�1�a���J��!
H�"�����{��.�.�q�#�s�A�s�C�H�H�H�H�H�H�H�H�H���),�c�3�J�F�F�F��C��%�%�a��f�a��f�E�E�E�E�E�E�E�E�E��v�Y��&�	�d���;���E�E����d�D�)�)�)�+3�+?�+?�+A�+A�

@�

@�'��S�#�s�C��s��C�#�I�B���)�#�#��S�2�X�%�E��S�2�X�%�E�E��H�_�_��S�2�X�%�E�E��H�_�_��S�2�X�%�E�E��G�^�^��S�2�X�%�E��S�2�X�%�E�E�$�*���%>�?�?�?��}�}�T�4���>�>�>�>�>�>�>�>�>�>���+�����%�%�a����3��6�!�8�S�I�I�I�I�I�I�I�I�I�I�Irc#��K�g}||kr:||kr|�||||||��}n7|�d|||��}n||kr|�d|||��}|Ed{V��dS)Nr�r�)r�r�)r#rrKrLr rMrNr�s        rr�zDiffer._fancy_helper�s���������9�9��S�y�y��'�'��3��Q��S�A�A����J�J�s�A�s�C�0�0���
�3�Y�Y��
�
�3��3��,�,�A����������rc#��K�	t||�����}t||�����}d|zV�|rd|�d�V�d|zV�|r
d|�d�V�dSdS)N�- z? �
�+ )r��rstrip)r#�aline�bliner�r�s     rr�zDiffer._qformat�s�����	�"�%��/�/�6�6�8�8��!�%��/�/�6�6�8�8���U�l�����	!� �u�.�.�.� � � ��U�l�����	!� �u�.�.�.� � � � � �	!�	!rr�)
r�r�r�r$r�r�r�r�r�r�rrrrr�s�������S�j!�!�!�!�.'�'�'�R(�(�(�
���\J�\J�\J�|
�
�
�!�!�!�!�!rrNz
\s*(?:#\s*)?$c��	||��duSrr)�line�pats  rrrs����3�t�9�9�D� � r� 	c��	||vSrr)�ch�wss  rrr%s��
���8�Orc��	|dz}||z
}|dkrd�|��S|s|dz}d�||��S�Nr1z{}z{},{}��format��start�stop�	beginningrs    r�_format_range_unifiedr�<sW��&���	�I�
�E�\�F�
��{�{��{�{�9�%�%�%����Q��	��>�>�)�V�,�,�,rrr�c	#��K�	t|||||||��d}td||���|��D�]"}	|sfd}|rd�|��nd}
|rd�|��nd}d�||
|��V�d�|||��V�|	d|	d}
}t	|d	|
d
��}t	|d|
d��}d
�|||��V�|	D]S\}}}}}|dkr|||�D]	}d|zV��
�#|dvr|||�D]	}d|zV��
|dvr|||�D]	}d|zV��
�T��$dS)NFT�	{}r�
--- {}{}{}z
+++ {}{}{}rrzr1�rx�z@@ -{} +{} @@{}rqr�>rornr�>rprnr�)�_check_typesrr�r�r�)rr �fromfile�tofile�fromfiledate�
tofiledaterB�lineterm�startedr�fromdate�todater��last�file1_range�file2_rangervrerirfrjr�s                      rr
r
Gs�����%�N��A�x���z�8�L�L�L��G� ��a��*�*�>�>�q�A�A�%�%���	@��G�6B�J�v�}�}�\�2�2�2��H�2<�D�V�]�]�:�.�.�.�"�F��%�%�h��(�C�C�C�C�C��%�%�f�f�h�?�?�?�?�?��A�h��b�	�t��+�E�!�H�d�1�g�>�>��+�E�!�H�d�1�g�>�>���&�&�{�K��J�J�J�J�J�#(�
	%�
	%��C��R��R��g�~�~��b��e�H�%�%�D���*�$�$�$�$���+�+�+��b��e�H�%�%�D���*�$�$�$�$��+�+�+��b��e�H�%�%�D���*�$�$�$�$��
	%�%�%rc��	|dz}||z
}|s|dz}|dkrd�|��Sd�|||zdz
��Sr�r�r�s    r�_format_range_contextr��sa��&���	�I�
�E�\�F����Q��	�
��{�{��{�{�9�%�%�%��>�>�)�Y��%7�!�%;�<�<�<rc	#�K�	t|||||||��tdddd���}d}	td||���|��D�]r}
|	sfd}	|rd�|��nd	}|rd�|��nd	}d
�|||��V�d�|||��V�|
d|
d
}}
d|zV�t|
d|d��}d�||��V�t
d�|
D����r+|
D](\}}}}}|dkr|||�D]}|||zV���)t|
d|d��}d�||��V�t
d�|
D����r+|
D](\}}}}}|dkr|||�D]}|||zV���)��tdS)Nr�r�z! r�)rprornrqFTr�rz
*** {}{}{}r�rrzz***************r1r�z
*** {} ****{}c3�*K�|]\}}}}}|dvV��dS)>rornNr�r�rv�_s   rr�zcontext_diff.<locals>.<genexpr>��2����I�I���Q��1�a�s�+�+�I�I�I�I�I�Irrprxr�z
--- {} ----{}c3�*K�|]\}}}}}|dvV��dS)>rprnNrr�s   rr�zcontext_diff.<locals>.<genexpr>�rrro)r��dictrr�r�r��any)rr r�r�r�r�rBr��prefixr�rr�r�r�r�r�rvrerirr�r�rfrjs                        rr	r	�sc����(�T��A�x���z�8�L�L�L�
��d�D��
E�
E�
E�F��G� ��a��*�*�>�>�q�A�A�1�1���	@��G�6B�J�v�}�}�\�2�2�2��H�2<�D�V�]�]�:�.�.�.�"�F��%�%�h��(�C�C�C�C�C��%�%�f�f�h�?�?�?�?�?��A�h��b�	�t���(�*�*�*�*�+�E�!�H�d�1�g�>�>���$�$�[�(�;�;�;�;�;��I�I�5�I�I�I�I�I�	1�%*�
1�
1�!��R��Q���(�?�?� !�"�R�%��1�1��$�S�k�D�0�0�0�0�0��+�E�!�H�d�1�g�>�>���$�$�[�(�;�;�;�;�;��I�I�5�I�I�I�I�I�	1�%*�
1�
1�!��Q��2�r��(�?�?� !�"�R�%��1�1��$�S�k�D�0�0�0�0�0���71�1rc��|rOt|dt��s4tdt|d��j�d|d�d����|rOt|dt��s4tdt|d��j�d|d�d����|D])}t|t��std|������*dS)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���	�5��A�a�D�#�&�&�5��i��a��d���,�,�,�a��d�d�d�4�5�5�	5��5��A�a�D�#�&�&�5��i��a��d���,�,�,�a��d�d�d�4�5�5�	5��K�K���#�s�#�#�	K��)�C�C�I�J�J�J�	K�K�Krr�
c	
#�RK�	d�}	tt|	|����}tt|	|����}|	|��}|	|��}|	|��}|	|��}|	|��}|||||||||��}
|
D]}|�dd��V��dS)Nc��	|�dd��S#t$r0}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>.decodesm��	*��8�8�G�%6�7�7�7���	*�	*�	*�	*���G�G�$�$�$�a�a�a�)�C��C�.�.�c�)�����	*���s��
A�+A
�
Arr)r^r_�encode)�dfuncrr r�r�r�r�rBr�r�linesr�s            rrr�s������*�*�*�	
�S���^�^���A��S���^�^���A��v�h���H�
�V�F�^�^�F��6�,�'�'�L���
�#�#�J��v�h���H��E�!�Q��&�,�
�A�x�P�P�E��6�6���k�k�'�#4�5�5�5�5�5�5�6�6rc�L�	t||���||��Sr)rr�)rr r�r�s    rrrs*��!�D�(�H�%�%�-�-�a��3�3�3rc#�8����K�	ddl}|jd���t||||���ddgf�fd�	���fd���fd�}|��}|�
|Ed{V��dS|dz
}d}	ddg|z}
}	d}|dur<	t|��\}}
}n#t$rYdSwxYw|	|z}||
|f|
|<|	dz
}	|du�<|	|krd	V�|}n|	}d}	|r|	|z}|	dz
}	|
|V�|dz}|�|dz
}	|r)t|��\}}
}|r|dz
}n|dz}||
|fV�|�)n#t$rYdSwxYw��)
Nrz
(\++|\-+|\^+)c���	||xxdz
cc<|�%|||�d��dd�fS|dkr�|�d��|�d��}}g}|fd�}��||��t|��D]1\}\}	}
|d|	�dz|z||	|
�zdz||
d�z}�2|dd�}n,|�d��dd�}|sd}d|z|zdz}|||fS)	Nr1rr��?c��|�|�d��d|���g��|�d��S)Nr1r)r5r�span)�match_object�sub_infos  r�record_sub_infoz3_mdiff.<locals>._make_line.<locals>.record_sub_info�sL������!3�!3�A�!6�!6�q�!9�,�:K�:K�:M�:M� N�O�O�O�#�)�)�!�,�,�,r��r�)r\�sub�reversed)r�
format_key�side�	num_lines�text�markersr"r#�key�begin�end�	change_res           �r�
_make_linez_mdiff.<locals>._make_linefs\���	�,	�$����1��������d�O�E�I�I�a�L�L����$4�5�5�����!�I�I�a�L�L�%�)�)�A�,�,�'�D��H�6>�
-�
-�
-�
-�
�M�M�/�'�2�2�2�$,�H�#5�#5�
N�
N���K�U�3��A�e�G�}�T�)�#�-�d�5��9�o�=�d�B�4����:�M�������8�D�D��9�9�Q�<�<����#�D��
����*�$�t�+�d�2�D��$���%�%rc3�~�K�	g}d\}}	t|��dkr6|�t�d����t|��dk�6d�d�|D����}|�d��r|}�n�|�d��r�|dd	���|dd
��dfV���|�d��r|d
z}�|dd	��ddfV���|�d
��r�|dd	��d}}|d
z
d	}}�nZ|�d��r�|dd	���|dd
��dfV���C|�d��r�|dd	���|dd
��dfV���w|�d��r|d
z}�|dd	��ddfV����|�d��r|d
z
}d�|dd
��dfV����|�d��rd�|dd
��}}|d
zd	}}nj|�d��r|d
z
}d�|dd
��dfV���-|�d��r'�|dd�dd	���|dd
��dfV���i|d	kr|d
z
}dV�|d	k�|d	kr|d
z}dV�|d	k�|�d��rdS||dfV����)N)rrTr��Xrc��g|]
}|d��S)rr)r�r�s  rr�z2_mdiff.<locals>._line_iterator.<locals>.<listcomp>�s��3�3�3�T��a��3�3�3rz-?+?rrr1z--++r�)z--?+z--+r�z-+?z-?+z+--r�)r�z+-r�F)N�rr�T)r5NT)r;r5�nextr��
startswith)r�num_blanks_pending�num_blanks_to_yieldr��	from_line�to_liner1�diff_lines_iterators      ��r�_line_iteratorz_mdiff.<locals>._line_iterator�s������	���26�/��/�F	-��e�*�*�q�.�.����T�"5�s�;�;�<�<�<��e�*�*�q�.�.����3�3�U�3�3�3�4�4�A��|�|�C� � �3
�'9�#�#����f�%�%�.
� �j��s�1�-�-�z�z�%��A�/F�/F��L�L�L�L�����f�%�%�*
�#�a�'�"� �j��s�1�-�-�t�T�9�9�9�9�����3�4�4�$
�%/�J�u�S��$;�$;�T�'�	�9K�A�9M�a�$6�#�#����e�$�$�
� �j��t�A�.�.�
�
�5��Q�0G�0G��M�M�M�M�����e�$�$�
� �j��s�1�-�-�z�z�%��Q�/G�/G��M�M�M�M�����c�"�"�
�"�a�'�"� �j��s�1�-�-�t�T�9�9�9�9�����e�$�$�
�#�a�'�"��J�J�u�S��3�3�T�9�9�9�9�����l�+�+�
�%)�:�:�e�C��+B�+B�7�	�9K�A�9M�a�$6�#�#����c�"�"�
�"�a�'�"��J�J�u�S��3�3�T�9�9�9�9�����c�"�"�
� �j��q�q�q��$�q�1�1�*�*�U�4��2J�2J�5�P�P�P�P��&��)�)�#�q�(�#�)�)�)�)�&��)�)�&��)�)�#�q�(�#�)�)�)�)�&��)�)��|�|�C� � �
-������,�,�,�,�MF	-rc3���K�	���}gg}}	t|��dkst|��dkr~	t|��\}}}n#t$rYdSwxYw|�|�||f��|�|�||f��t|��dk�kt|��dk�~|�d��\}}|�d��\}}|||p|fV���)NTr)r;r6�
StopIterationr5r\)	�
line_iterator�	fromlines�tolinesr:r;�
found_diff�fromDiff�to_diffr=s	        �r�_line_pair_iteratorz#_mdiff.<locals>._line_pair_iterator�s+�����	�'��(�(�
��R�'�	�	:��y�>�>�1�$�$��G���a����59�-�5H�5H�2�I�w�
�
��$�����F�F������(��$�$�i�
�%;�<�<�<��&��N�N�G�J�#7�8�8�8��y�>�>�1�$�$��G���a���#,�-�-��"2�"2��I�x�&�{�{�1�~�~��G�W��W�X�%8��9�9�9�9�	:s�A�
A�Ar1TF)NNN)�re�compilerr6r?)rArB�contextr�r�rGrF�line_pair_iterator�lines_to_write�index�contextLinesrCr:r;r=r=r1r0r<s               @@@@r�_mdiffrN<sz���������@�I�I�I���
�+�,�,�I� �	�'�(�8�D�D��78��e�6&�6&�6&�6&�6&�6&�pV-�V-�V-�V-�V-�V-�p:�:�:�:�:�B-�,�.�.����%�%�%�%�%�%�%�%�%�%�	�1�����(	�#$�d�V�W�%5�<�E��J���%�%��59�:L�5M�5M�2�I�w�
�
��$�����F�F������G�O��#,�g�z�"B��Q����
����%�%��w���&�&�&�&�!(���!&���� �
$��G�O����
��"�1�o�%�%�%��!�#��	!�
$�%�Q�Y�N�
�$�9�59�:L�5M�5M�2�I�w�
�!�,�)0�����&�!�+��#�W�j�8�8�8�8�%�9���!�
�
�
����
����M(	s$�/B�
B�B�+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�|�eZdZ	eZeZeZeZdZdddefd�Z			ddd	�d
�Z
d�Zd�Zd
�Z
d�Zd�Zd�Zd�Z		dd�ZdS)rr�Nc�@�	||_||_||_||_dSr)�_tabsize�_wrapcolumn�	_linejunk�	_charjunk)r#�tabsize�
wrapcolumnr�r�s     rr$zHtmlDiff.__init__�s*��		� ��
�%���!���!����rrF�zutf-8)�charsetc
���	|jt|j|j|�||||||���|���z�|d���|��S)N)rI�numlines)�styles�legend�tablerY�xmlcharrefreplace)�_file_templater�_styles�_legend�
make_tablerr)r#rArB�fromdesc�todescrIr[rYs        r�	make_filezHtmlDiff.make_file�sy��	�"�#�d��<��<��/�/�)�W�h��*1�H�"�F�F��'
�'
�'
�
��6�'�.�/�/���w���
	@rc�R���	�fd���fd�|D��}�fd�|D��}||fS)Nc����|�dd��}|��j��}|�dd��}|�dd���d��S)Nr�r$�	r�)rn�
expandtabsrRr�)r�r#s �r�expand_tabsz2HtmlDiff._tab_newline_replace.<locals>.expand_tabs�s`����<�<��D�)�)�D��?�?�4�=�1�1�D��<�<��D�)�)�D��<�<��S�)�)�0�0��6�6�6rc�&��g|]
}�|����Srr�r�r�rks  �rr�z1HtmlDiff._tab_newline_replace.<locals>.<listcomp>�s#���=�=�=�4�[�[��&�&�=�=�=rc�&��g|]
}�|����Srrrms  �rr�z1HtmlDiff._tab_newline_replace.<locals>.<listcomp>�s#���9�9�9��;�;�t�$�$�9�9�9rr)r#rArBrks`  @r�_tab_newline_replacezHtmlDiff._tab_newline_replace�sa����	�	7�	7�	7�	7�	7�>�=�=�=�9�=�=�=�	�9�9�9�9��9�9�9���� � rc�>�	|s|�||f��dSt|��}|j}||ks||�d��dzz
|kr|�||f��dSd}d}d}||krO||krI||dkr|dz
}||}|dz
}n||dkr|dz
}d}n
|dz
}|dz
}||kr||k�I|d|�}	||d�}
|r
|	dz}	d|z|
z}
|�||	f��|�|d|
��dS)Nr$rxrrr1r%�>)r5r;rS�count�_split_line)r#�	data_list�line_numr+rur{r=rB�mark�line1�line2s           rrszHtmlDiff._split_line�s���	��	����h�t�_�-�-�-��F��4�y�y������C�K�K�d�T�Z�Z��%5�%5�a�%7�8�S�@�@����h�t�_�-�-�-��F�
��
�����#�g�g�!�d�(�(��A�w�$����Q����A�w���Q�����a��D����Q�������Q����Q����#�g�g�!�d�(�(��R�a�R����Q�R�R���
�	(��D�L�E��4�K�%�'�E�	���(�5�)�*�*�*�	
����3�u�-�-�-�-�-rc#�2K�	|D]�\}}}|�|||fV��||c\}}\}}gg}
}	|�|	||��|�|
||��|	s|
r?|	r|	�d��}nd}|
r|
�d��}nd}|||fV�|	�=|
�?��dS)Nr)rr�)rsr\)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�8�8����V�F�6�2�2�2��	
+�f�	
+��(�'�|�|�A���H�H�'�H��&�#�Z�Z��]�]�F�F�%�F��v�d�*�*�*�*��	
+�f�	
+��	+�	+rc�V�	ggg}}}|D]�\}}}	|�|jd|g|�R���|�|jd|g|�R���n:#t$r-|�d��|�d��YnwxYw|�|����|||fSrG)r5�_format_liner)r#rzr�r��flaglistr{r|r}s        r�_collect_lineszHtmlDiff._collect_lines.s���	�$&�b�����$)�		"�		"� �H�V�D�
$���� 1�� 1�!�D� C�(� C� C� C�D�D�D��
�
�/�d�/��$�?��?�?�?�@�@�@�@���
$�
$�
$�����%�%�%��
�
�d�#�#�#�#�#�
$����
�O�O�D�!�!�!�!���x�'�'s�AA�4B
�B
c�@�		d|z}d|j|�|�d�}n#t$rd}YnwxYw|�dd���dd���d	d
��}|�dd�����}d
|�d|�d|�d�S)Nz%dz id="�"r�&z&amp;rqz&gt;�<z&lt;r��&nbsp;z<td class="diff_header"z</td><td nowrap="nowrap">z</td>)�_prefixrrnr�)r#r)r}�linenumr+�ids      rr�zHtmlDiff._format_lineCs���	�	��W�n�G�G�!%��d�!3�!3�G�G�G�<�B�B���	�	�	��B�B�B�	�����\�\�#�g�
&�
&�
.�
.�s�6�
:�
:�
B�
B�3�v�
N�
N���|�|�C��)�)�0�0�2�2����"�"�W�W�W�T�T�T�#�	#s��+�+c��	dtjz}dtjz}txjdz
c_||g|_dS)Nzfrom%d_zto%d_r1)r�_default_prefixr�)r#�
fromprefix�toprefixs   r�_make_prefixzHtmlDiff._make_prefixZsE��+���!9�9�
��X�5�5��� � �A�%� � �"�8�,����rc��	|jd}dgt|��z}dgt|��z}d\}	}
d}t|��D]=\}}
|
r4|
s1d}
|}td||z
g��}d||	fz||<|	dz
}	d||	fz||<�;d}
�>|sdg}dg}dg}d}|rd	g}|}nd
gx}}|dsd|z|d<d|z||<|||||fS)
Nr1r)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;r3r{)r#r�r�r�rIr[r��next_id�	next_href�num_chg�	in_changer�r=r}s              r�_convert_flagszHtmlDiff._convert_flagsesV��(��<��?���$�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��"�	�	��		Q��w�H��d�G���I��D��
Q�P�Q��!���%O�$P�P��6���{�	J�>��I�I�a�L�?�8�L�	�$����x�	�'�9�9rc
���	|���|�||��\}}|r|}nd}t||||j|j���}|jr|�|��}|�|��\}	}
}|�|	|
|||��\}	}
}}}
g}d}tt|����D]a}||�|dkr|�d���&|�||
||||	||||
|fz���b|s|rdd�d|z�d�d|z�d�}nd	}|jtd	�|��||jd
���z}|�dd
���dd���dd���dd���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>rr1)�	data_rows�
header_rowrz+z<span class="diff_add">z-z<span class="diff_sub">z^z<span class="diff_chg">r%z</span>rir�)r�rorNrTrUrSr�r�r�rIr;r5�_table_templaterr�r�rn)r#rArBrdrerIr[�
context_linesrzr�r�r�r�r�r��fmtr=r�r^s                   rrczHtmlDiff.make_table�sO��	�$	
������!�5�5�i��H�H��	�'��	!�$�M�M� �M��y�����#�~�/�/�/����	.��&�&�u�-�-�E�$(�#6�#6�u�#=�#=� ����6:�5H�5H��V�H�W�X�67�67�2�����7�
��7���s�8�}�}�%�%�	D�	D�A���{�"��q�5�5��H�H�J�K�K�K�����#����I�a�L��!��+4�Q�<��q�	�!C�C�D�D�D�D��	�v�	��3�3�=��H�H�3�3�=��F�F�F�	H�J�J��J��$�t��g�g�a�j�j�!��<��?�($�($�($�$��
�}�}�U�#<�=�=��W�U�#<�=�=��W�U�#<�=�=��W�T�)�,�,��W�T�(�+�+�		,r)rrFrX)r�r�r�r`rar�rbr�rr$rfrorsr�r�r�r�r�rcrrrrr�s������
�$�N��G�%�O��G��O��4��+�"�"�"�"�"AC�*+�@�8?�@�@�@�@�@�6!�!�!�.5.�5.�5.�n+�+�+�8(�(�(�*#�#�#�.	-�	-�	-�-:�-:�-:�^IN��K,�K,�K,�K,�K,�K,rrc#��K�		ddd�t|��}n!#t$rtd|z��d�wxYwd|f}|D]}|dd�|vr|dd�V��dS)Nr�r�)r1r�z)unknown delta choice (must be 1 or 2): %rr�r�)�int�KeyErrorr�)�delta�whichrv�prefixesr�s     rrr�s������*.��4� � ��U���,�����.�.�.��D�"�#�$�$�)-�	.�.�����c�{�H���������8�x����q�r�r�(�N�N�N���s��<c�<�ddl}ddl}|�|��Sr[)�doctest�difflib�testmod)r�r�s  r�_testr�s,�����������?�?�7�#�#�#r�__main__)rxr�)r�)rrrrrxr�)rrrrrxr)%�__all__�heapqrr��collectionsr�_namedtuple�typesrr
rrrr�rrGrH�matchrrr�r
r�r	r�rrrNr`rar�rb�objectrrr�r�rrr�<module>r�s����8>�>�>��(�'�'�'�'�'�1�1�1�1�1�1���������G�Z�(�(�����
k	2�k	2�k	2�k	2�k	2�k	2�k	2�k	2�\.&�.&�.&�.&�b���l!�l!�l!�l!�l!�l!�l!�l!�~	
�	�	�	�%�2�:�&6�7�7�=�!�!�!�!� ����.	-�	-�	-�=?�.2�B%�B%�B%�B%�R	=�	=�	=�,.�?C�J1�J1�J1�J1�XK�K�K�"25�?D�6�6�6�6�<�(9�#4�#4�#4�#4�J(,�d�%�K�K�K�K�\��(0������"],�],�],�],�],�v�],�],�],�~
����@$�$�$��z���	�E�G�G�G�G�G��r