HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/lib/python3/dist-packages/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3/dist-packages/__pycache__/jsonpatch.cpython-311.pyc
�

M`�p���dZddlmZddlZddlZddlZddlZddlZ	ddlm	Z	n
#e
$reZ	YnwxYwddlm
Z
mZdZdZ	ddlmZmZn#e
$r
ddlmZmZeZYnwxYwdZd	Zd
ZdZejdkreefZGd
�de��ZGd�de��ZGd�de��Z Gd�dee!��Z"d�Z#ej$ej%e#���Z&de
fd�Z'e
fd�Z(Gd�de)��Z*Gd�de*��Z+Gd�de*��Z,Gd �d!e*��Z-Gd"�d#e*��Z.Gd$�d%e*��Z/Gd&�d'e*��Z0Gd(�d)e)��Z1Gd*�d+e)��Z2d,�Z3dS)-z Apply JSON-Patches (RFC 6902) �)�unicode_literalsN)�MappingProxyType)�JsonPointer�JsonPointerException�)�MutableMapping�MutableSequenceu Stefan Kögl <stefan@skoegl.net>z1.32z0https://github.com/stefankoegl/python-json-patchzModified BSD License)�rc��eZdZdZdS)�JsonPatchExceptionzBase Json Patch exceptionN��__name__�
__module__�__qualname__�__doc__���+/usr/lib/python3/dist-packages/jsonpatch.pyrrJ�������#�#�#�#rrc��eZdZdZdS)�InvalidJsonPatchz, Raised if an invalid JSON Patch is created Nr
rrrrrNs������6�6�6�6rrc��eZdZdZdS)�JsonPatchConflicta
Raised if patch could not be applied due to conflict situation such as:
    - attempt to add object key when it already exists;
    - attempt to operate with nonexistence object key;
    - attempt to insert value to array at position beyond its size;
    - etc.
    Nr
rrrrrRs���������rrc��eZdZdZdS)�JsonPatchTestFailedz A Test operation failed Nr
rrrrrrrc���tjt��}|D] \}}||�|���!t	d�|���D����S)z'Convert duplicate keys values to lists.c3�ZK�|]&\}}|t|��dkr|dn|fV��'dS)rrN)�len)�.0�key�valuess   r�	<genexpr>zmultidict.<locals>.<genexpr>fsY������
�C��

�3�v�;�;�!�+�+�f�Q�i�i��8������r)�collections�defaultdict�list�append�dict�items)�
ordered_pairs�mdictr �values    r�	multidictr,_sz��
�#�D�)�)�E�#�!�!�
��U�
�c�
���%� � � � ����!�;�;�=�=������r)�object_pairs_hookFc��t|t��rt�||���}nt||���}|�||��S)a�Apply list of patches to specified json document.

    :param doc: Document object.
    :type doc: dict

    :param patch: JSON patch as list of dicts or raw JSON-encoded string.
    :type patch: list or str

    :param in_place: While :const:`True` patch will modify target document.
                     By default patch will be applied to document copy.
    :type in_place: bool

    :param pointer_cls: JSON pointer class to use.
    :type pointer_cls: Type[JsonPointer]

    :return: Patched document object.
    :rtype: dict

    >>> doc = {'foo': 'bar'}
    >>> patch = [{'op': 'add', 'path': '/baz', 'value': 'qux'}]
    >>> other = apply_patch(doc, patch)
    >>> doc is not other
    True
    >>> other == {'foo': 'bar', 'baz': 'qux'}
    True
    >>> patch = [{'op': 'add', 'path': '/baz', 'value': 'qux'}]
    >>> apply_patch(doc, patch, in_place=True) == {'foo': 'bar', 'baz': 'qux'}
    True
    >>> doc == other
    True
    ��pointer_cls)�
isinstance�
basestring�	JsonPatch�from_string�apply)�doc�patch�in_placer0s    r�apply_patchr9rsW��B�%��$�$�:��%�%�e��%�E�E����%�[�9�9�9���;�;�s�H�%�%�%rc�<�t�|||���S)a!Generates patch by comparing two document objects. Actually is
    a proxy to :meth:`JsonPatch.from_diff` method.

    :param src: Data source document object.
    :type src: dict

    :param dst: Data source document object.
    :type dst: dict

    :param pointer_cls: JSON pointer class to use.
    :type pointer_cls: Type[JsonPointer]

    >>> src = {'foo': 'bar', 'numbers': [1, 3, 4, 8]}
    >>> dst = {'baz': 'qux', 'numbers': [1, 4, 7]}
    >>> patch = make_patch(src, dst)
    >>> new = patch.apply(src)
    >>> new == dst
    True
    r/)r3�	from_diff)�src�dstr0s   r�
make_patchr>�s��*���s�C�[��A�A�Arc��eZdZdZefd�Zd�Zd�Zd�Zd�Z	e
d���Ze
d���Zej
d	���Zd
S)�PatchOperationz'A single operation inside a JSON Patch.c�~�||_|�d��std���t|d|j��r |dj|_|d|_nO|d|_	|�|j��|_n!#t$r}td���d}~wwxYw||_dS)N�pathz#Operation must have a 'path' memberzInvalid 'path')	r0�__contains__rr1rB�location�pointer�	TypeError�	operation)�selfrGr0�exs    r�__init__zPatchOperation.__init__�s���&����%�%�f�-�-�	J�"�#H�I�I�I��i��'��)9�:�:�	9�%�f�-�2�D�M�$�V�,�D�L�L�%�f�-�D�M�
9�#�/�/��
�>�>������
9�
9�
9�&�'7�8�8�8�����
9����#����s�5B�
B3�B.�.B3c� �td���)zGAbstract method that applies a patch operation to the specified object.z%should implement the patch operation.)�NotImplementedError)rH�objs  rr5zPatchOperation.apply�s��!�"I�J�J�Jrc�h�tt|j�������S�N)�hash�	frozensetrGr(�rHs r�__hash__zPatchOperation.__hash__�s&���I�d�n�2�2�4�4�5�5�6�6�6rc�P�t|t��sdS|j|jkS�NF)r1r@rG�rH�others  r�__eq__zPatchOperation.__eq__�s(���%��0�0�	��5��~���0�0rc��||kSrOrrVs  r�__ne__zPatchOperation.__ne__�����5�=�!�!rc�P�d�|jjdd���S)N�/���)�joinrE�partsrRs rrBzPatchOperation.path�s"���x�x���*�3�B�3�/�0�0�0rc��	t|jjd��S#t$r|jjdcYSwxYw)Nr^)�intrEr`�
ValueErrorrRs rr zPatchOperation.key�sP��	*��t�|�)�"�-�.�.�.���	*�	*�	*��<�%�b�)�)�)�)�	*���s�!�A�Ac�~�t|��|jjd<|jj|_|j|jd<dS)Nr^rB)�strrEr`rBrDrG)rHr+s  rr zPatchOperation.key�s7��!$�U������2����)��
�!%����v���rN)rrrrrrJr5rSrXrZ�propertyrBr �setterrrrr@r@�s�������1�1�.9�#�#�#�#�$K�K�K�7�7�7�1�1�1�
"�"�"��1�1��X�1��*�*��X�*�	�Z�/�/��Z�/�/�/rr@c�$�eZdZdZd�Zd�Zd�ZdS)�RemoveOperationz/Removes an object property or an array element.c���|j�|��\}}	||=n=#ttf$r)}d�|��}t|���d}~wwxYw|S)Nz(can't remove a non-existent object '{0}')rE�to_last�KeyError�
IndexError�formatr)rHrM�subobj�partrI�msgs      rr5zRemoveOperation.apply�su���|�+�+�C�0�0����	)��t�����*�%�	)�	)�	)�<�C�C�D�I�I�C�#�C�(�(�(�����	)�����
s�#�A�$A�Ac�^�|j|kr!|j|kr|xjdz
c_n|dz}|S�Nr�rBr �rHrBr s   r�_on_undo_removezRemoveOperation._on_undo_remove�s9���9�����x�3������A�
�����q����
rc�^�|j|kr!|j|kr|xjdzc_n|dz}|Srsrtrus   r�_on_undo_addzRemoveOperation._on_undo_add��9���9�����x�#�~�~����A�
�����q����
rN�rrrrr5rvrxrrrriri�sG������9�9�����������rric�$�eZdZdZd�Zd�Zd�ZdS)�AddOperationz,Adds an object property or an array element.c�r�	|jd}n!#t$r}td���d}~wwxYw|j�|��\}}t|t��r[|dkr|�|��n�|t|��ks|dkrtd���|�
||��nyt|t��r|�|}n_|||<nY|�/td�
t|�������td�
|j|�����|S)Nr+�/The operation does not contain a 'value' member�-rzcan't insert outside of list�invalid document type {0}�2unable to fully resolve json pointer {0}, part {1})rGrlrrErkr1r	r&rr�insertrrFrn�typerD)rHrMr+rIrorps      rr5zAddOperation.apply	s[��	C��N�7�+�E�E���	C�	C�	C�"�A�C�C�
C�����	C�����|�+�+�C�0�0�����f�o�.�.�	z��s�{�{��
�
�e�$�$�$�$���F���#�#�t�a�x�x�'�(F�G�G�G��
�
�d�E�*�*�*�*�
���
/�
/�
	z��|����$��t����|�� ;� B� B�4��<�<� P� P�Q�Q�Q�'�(\�(c�(c�dh�dq�sw�(x�(x�y�y�y��
��
�
.�)�.c�^�|j|kr!|j|kr|xjdz
c_n|dz
}|Srsrtrus   rrvzAddOperation._on_undo_remove)ryrc�^�|j|kr!|j|kr|xjdzc_n|dz
}|Srsrtrus   rrxzAddOperation._on_undo_add1ryrNrzrrrr|r|sH������6�6����@�������rr|c�$�eZdZdZd�Zd�Zd�ZdS)�ReplaceOperationz?Replaces an object property or an array element by a new value.c��	|jd}n!#t$r}td���d}~wwxYw|j�|��\}}|�|S|dkrtd���t|t��r)|t|��ks|dkrtd���n�t|t��r)||vr$d�
|��}t|���nY|�/td�
t|�������td	�
|j
|�����|||<|S)
Nr+r~rz7'path' with '-' can't be applied to 'replace' operationrzcan't replace outside of listz)can't replace a non-existent object '{0}'r�r�)rGrlrrErkr1r	rrrrnrFr�rD)rHrMr+rIrorprqs       rr5zReplaceOperation.apply=sp��	C��N�7�+�E�E���	C�	C�	C�"�A�C�C�
C�����	C�����|�+�+�C�0�0�����<��L��3�;�;�"�#\�]�]�]��f�o�.�.�	z��s�6�{�{�"�"�d�Q�h�h�'�(G�H�H�H�'/����
/�
/�	z��6�!�!�A�H�H��N�N��'��,�,�,�"��|�� ;� B� B�4��<�<� P� P�Q�Q�Q�'�(\�(c�(c�dh�dq�sw�(x�(x�y�y�y���t���
r�c��|SrOrrus   rrvz ReplaceOperation._on_undo_remove]����
rc��|SrOrrus   rrxzReplaceOperation._on_undo_add`r�rNrzrrrr�r�:sH������I�I����@�������rr�c�p�eZdZdZd�Zed���Zed���Zejd���Zd�Z	d�Z
dS)	�
MoveOperationz?Moves an object property or an array element to a new location.c��	t|jd|j��r|jd}n |�|jd��}n!#t$r}t	d���d}~wwxYw|�|��\}}	||}n5#ttf$r!}tt|�����d}~wwxYw|j	|kr|St|t��r)|j	�|��rtd���td|jdd�|j����
|��}td|j|d�|j����
|��}|S)	N�from�.The operation does not contain a 'from' memberz*Cannot move values into their own children�remove��oprBr/�add�r�rBr+)r1rGr0rlrrkrmrrerEr�containsrir5r|rD�rHrM�from_ptrrIrorpr+s       rr5zMoveOperation.applygs���	B��$�.��0�$�2B�C�C�
D��>�&�1����+�+�D�N�6�,B�C�C�����	B�	B�	B�"�@�B�B�
B�����	B���� �'�'��,�,����	-��4�L�E�E���*�%�	-�	-�	-�#�C��G�G�,�,�,�����	-�����<�8�#�#��J��f�n�-�-�	R���%�%�h�/�/�	R�#�$P�Q�Q�Q����N�6�*�
�
��'�)�)�)�*/��s���	�
���M��
�
��'�	)�)�)�*/��s���		��
s0�AA�
A/�A*�*A/�B�C�%C�Cc��|�|jd��}d�|jdd���S)Nr�r]r^)r0rGr_r`�rHr�s  r�	from_pathzMoveOperation.from_path�s9���#�#�D�N�6�$:�;�;���x�x���s��s�+�,�,�,rc��|�|jd��}	t|jd��S#t$r|jdcYSwxYw�Nr�r^)r0rGrbr`rFr�s  r�from_keyzMoveOperation.from_key�sd���#�#�D�N�6�$:�;�;��	&��x�~�b�)�*�*�*���	&�	&�	&��>�"�%�%�%�%�	&���s�<�A�Ac��|�|jd��}t|��|jd<|j|jd<dSr�)r0rGrer`rB)rHr+r�s   rr�zMoveOperation.from_key�sB���#�#�D�N�6�$:�;�;�� ��Z�Z���r��!)����v���rc��|j|kr!|j|kr|xjdz
c_n|dz}|j|kr!|j|kr|xjdz
c_n|dz
}|Srs�r�r�rBr rus   rrvzMoveOperation._on_undo_remove�sn���>�T�!�!��}��#�#��
�
��"�
�
�
��q����9�����x�#�~�~����A�
�����q����
rc��|j|kr!|j|kr|xjdzc_n|dz}|j|kr!|j|kr|xjdzc_n|dz
}|Srsr�rus   rrxzMoveOperation._on_undo_add�sn���>�T�!�!��}�s�"�"��
�
��"�
�
�
��q����9�����x�#�~�~����A�
�����q����
rN)rrrrr5rfr�r�rgrvrxrrrr�r�ds�������I�I�#�#�#�J�-�-��X�-��&�&��X�&��_�/�/��_�/�
�������rr�c��eZdZdZd�ZdS)�
TestOperationz!Test value by specified location.c
���	|j�|��\}}|�|}n|j�||��}n.#t$r!}t	t|�����d}~wwxYw	|jd}n!#t$r}td���d}~wwxYw||krAd}t	|�	|t|��|t|�������|S)Nr+r~z0{0} ({1}) is not equal to tested value {2} ({3}))rErk�walkrrrerGrlrrnr�)rHrMrorp�valrIr+rqs        rr5zTestOperation.apply�s��	/��<�/�/��4�4�L�F�D��|�����l�'�'���5�5����#�	/�	/�	/�%�c�"�g�g�.�.�.�����	/����	C��N�7�+�E�E���	C�	C�	C�"�A�C�C�
C�����	C�����%�<�<�D�C�%�c�j�j��d�3�i�i�16��U���'E�'E�F�F�
F��
s/�=A�
A+�
A&�&A+�/
A=�=
B�B�BN�rrrrr5rrrr�r��s)������+�+�����rr�c��eZdZdZd�ZdS)�
CopyOperationzA Copies an object property or an array element to a new location c���	|�|jd��}n!#t$r}td���d}~wwxYw|�|��\}}	tj||��}n5#ttf$r!}tt|�����d}~wwxYwtd|j|d�|j����|��}|S)Nr�r�r�r�r/)
r0rGrlrrk�copy�deepcopyrmrrer|rDr5r�s       rr5zCopyOperation.apply�s��	B��'�'���v�(>�?�?�H�H���	B�	B�	B�"�@�B�B�
B�����	B���� �'�'��,�,����	-��M�&��,�/�/�E�E���*�%�	-�	-�	-�#�C��G�G�,�,�,�����	-�������M��
�
��'�	)�)�)�*/��s���		��
s*� #�
A�<�A�A8�8B*�	B%�%B*Nr�rrrr�r��s)������K�K�����rr�c	��eZdZeej��Zee��Ze	e
eee
eed���Z	efd�Zd�Zd�ZeZd�Zd�Zd�Zd�Zed	efd
���Zedd	efd���Zdd
�Zed���Zdd�Z d�Z!d	S)r3)r�r��replace�move�testr�c�`�||_||_|jD]}|�|���dSrO)r7r0�_get_operation)rHr7r0r�s    rrJzJsonPatch.__init__(sE����
�&����*�	$�	$�B�����#�#�#�#�	$�	$rc�*�|���S)zstr(self) -> self.to_string())�	to_stringrRs r�__str__zJsonPatch.__str__3s���~�~���rc�*�t|j��SrO)�boolr7rRs r�__bool__zJsonPatch.__bool__7����D�J���rc�*�t|j��SrO)�iterr7rRs r�__iter__zJsonPatch.__iter__<r�rc�D�tt|j����SrO)rP�tuple�_opsrRs rrSzJsonPatch.__hash__?s���E�$�)�$�$�%�%�%rc�P�t|t��sdS|j|jkSrU)r1r3r�rVs  rrXzJsonPatch.__eq__Bs(���%��+�+�	��5��y�E�J�&�&rc��||kSrOrrVs  rrZzJsonPatch.__ne__Gr[rNc�D�|p|j}||��}|||���S)a�Creates JsonPatch instance from string source.

        :param patch_str: JSON patch as raw string.
        :type patch_str: str

        :param loads: A function of one argument that loads a serialized
                      JSON string.
        :type loads: function

        :param pointer_cls: JSON pointer class to use.
        :type pointer_cls: Type[JsonPointer]

        :return: :class:`JsonPatch` instance.
        r/)�json_loader)�cls�	patch_str�loadsr0r�r7s      rr4zJsonPatch.from_stringJs4�� �.�s�����I�&�&���s�5�k�2�2�2�2rTc���|p|j}t||||���}|�dd||��t|�����}|||���S)aCCreates JsonPatch instance based on comparison of two document
        objects. Json patch would be created for `src` argument against `dst`
        one.

        :param src: Data source document object.
        :type src: dict

        :param dst: Data source document object.
        :type dst: dict

        :param dumps: A function of one argument that produces a serialized
                      JSON string.
        :type dumps: function

        :param pointer_cls: JSON pointer class to use.
        :type pointer_cls: Type[JsonPointer]

        :return: :class:`JsonPatch` instance.

        >>> src = {'foo': 'bar', 'numbers': [1, 3, 4, 8]}
        >>> dst = {'baz': 'qux', 'numbers': [1, 4, 7]}
        >>> patch = JsonPatch.from_diff(src, dst)
        >>> new = patch.apply(src)
        >>> new == dst
        True
        r/�N)�json_dumper�DiffBuilder�_compare_valuesr%�execute)	r�r<r=�optimization�dumpsr0r��builder�opss	         rr;zJsonPatch.from_diff^sl��>�.�s����c�3���M�M�M������D�#�s�3�3�3��7�?�?�$�$�%�%���s�3�K�0�0�0�0rc�4�|p|j}||j��S)z!Returns patch set as JSON string.)r�r7)rHr�r�s   rr�zJsonPatch.to_string�s!���/�t�/���{�4�:�&�&�&rc�P�tt|j|j����SrO)r��mapr�r7rRs rr�zJsonPatch._ops�s���S��,�d�j�9�9�:�:�:rFc�p�|stj|��}|jD]}|�|��}�|S)a5Applies the patch to a given object.

        :param obj: Document object.
        :type obj: dict

        :param in_place: Tweaks the way how patch would be applied - directly to
                         specified `obj` or to its copy.
        :type in_place: bool

        :return: Modified `obj`.
        )r�r�r�r5)rHrMr8rGs    rr5zJsonPatch.apply�sD���	%��-��$�$�C���	'�	'�I��/�/�#�&�&�C�C��
rc��d|vrtd���|d}t|t��std���||jvr"td�|�����|j|}|||j���S)Nr�z&Operation does not contain 'op' memberzOperation must be a stringzUnknown operation {0!r}r/)rr1r2�
operationsrnr0)rHrGr�r�s    rr�zJsonPatch._get_operation�s����y� � �"�#K�L�L�L�
�t�_���"�j�)�)�	A�"�#?�@�@�@�
�T�_�$�$�"�#<�#C�#C�B�#G�#G�H�H�H��o�b�!���s�9�$�*:�;�;�;�;rrO)F)"rrr�staticmethod�jsonr�r��
_jsonloadsr�rrir|r�r�r�r�r�rrJr�r��__nonzero__r�rSrXrZ�classmethodr4r;r�rfr�r5r�rrrr3r3�s��������,�t�z�*�*�K��,�z�*�*�K�!�!�!��#����
#�#���J�,�Z+6�	$�	$�	$�	$� � � � � � ��K� � � �&�&�&�'�'�'�
"�"�"��*.�K�3�3�3��[�3�&�(,�D�#�"1�"1�"1��[�"1�H'�'�'�'�
�;�;��X�;�����*
<�
<�
<�
<�
<rr3c�r�eZdZejefd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�ZdS)r�c��||_||_iig|_ggg|_gx|_}||_||_||dg|dd�<dSrO)r�r0�
index_storage�index_storage2�_DiffBuilder__root�src_doc�dst_doc)rHr�r�r�r0�roots      rrJzDiffBuilder.__init__�s[����
�&��� �"�X���!�2�h�������d���������t�$��Q�Q�Q���rc��|t|��f}	|j|}|�|��}|�|g||<dS||�|��dS#t$r&|j|�||f��YdSwxYwrO)r�r��getr&rFr�)rHr+�index�st�	typed_key�storage�storeds       r�store_indexzDiffBuilder.store_index�s����D��K�K�(�	�		?��(��,�G��[�[��+�+�F��~�&+�W��	�"�"�"��	�"�)�)�%�0�0�0�0�0���	?�	?�	?����#�*�*�I�u�+=�>�>�>�>�>�>�	?���s�*A�A�,B�Bc�|�|t|��f}	|j|�|��}|r|���SdS#t$rf|j|}t
t|��dz
dd��D]3}||d|kr|�|��dccYS�4YdSwxYw)Nrr^r)r�r�r��poprFr��ranger)rHr+r�r�r�r��is       r�
take_indexzDiffBuilder.take_index�s����D��K�K�(�	�		-��'��+�/�/�	�:�:�F��
$��z�z�|�|�#�
$�
$���	-�	-�	-��)�"�-�G��3�w�<�<��>�2�r�2�2�
-�
-���1�:�a�=�I�-�-�"�;�;�q�>�>�!�,�,�,�,�,�,�.�
-�
-�
-�	-���s�5A�A)B;�6B;�:B;c�J�|j}|d}|||gx|d<|d<|dS)Nrr�r�)rHr�r��lasts    rr�zDiffBuilder.insert�s4���{���A�w��!�4��,�,��Q��$�q�'��A�w�rc�4�|\}}}||d<||d<g|dd�<dS)Nrrr)rHr��	link_prev�	link_next�_s     rr�zDiffBuilder.remove�s1��"'��	�9�a� �	�!�� �	�!����a�a�a���rc#�`K�|j}|d}||ur|dV�|d}||u�dSdS�Nr�r�)rH�startr��currs    r�	iter_fromzDiffBuilder.iter_from�sP�����{���Q�x���$����q�'�M�M�M���7�D��$������rc#�`K�|j}|d}||ur|dV�|d}||u�dSdSr�r�)rHr�r�s   rr�zDiffBuilder.__iter__�sP�����{���A�w���$����q�'�M�M�M���7�D��$������rc#�K�|j}|d}||ur�|d|ur�|d|dd}}|j|jkrpt|��tkrXt|��tkr@td|j|jdd�|j���jV�|dd}��|djV�|d}||u��dSdS)Nrr�r�r+r�r/)r�rDr�rir|r�rGr0)rHr�r��op_first�	op_seconds     rr�zDiffBuilder.execute�s�����{���A�w���$����A�w�d�"�"�&*�1�g�t�A�w�q�z�)���$�	�(:�:�:��X���/�9�9��Y���<�7�7�*�'� )� 2�!*�!4�W�!=�,�,�$(�#3�	5�5�5�6?�	?�?�?�
 ��7�1�:�D���q�'�#�#�#�#���7�D��$������rc���|�|t��}|��|d}t|j��tkrUt|��tkr=|�|��D]'}|�|j|j��|_�(|�|��|j	t||��krDtd|j	t||��d�|j���}|�
|��dSdStdt||��|d�|j���}|�
|��}|�||t ��dS)Nr�r��r�r�rBr/r�r�)r��
_ST_REMOVEr�r rbr�rvrBr�rD�
_path_joinr�r0r�r|r��_ST_ADD)	rHrBr �itemr�r��v�new_op�	new_indexs	         r�_item_addedzDiffBuilder._item_addedss������j�1�1�����q��B��B�F�|�|�s�"�"�t�C�y�y�C�'7�'7�����.�.�@�@�A��.�.�r�w���?�?�B�F�F��K�K������{�j��s�3�3�3�3�&� ��K�&�t�S�1�1�(�(� $�/�	1�1�1��
���F�#�#�#�#�#�
4�3�"��"�4��-�-��#�#� �+�	-�-�-�F�
���F�+�+�I����T�9�g�6�6�6�6�6rc���tdt||��d�|j���}|�|t��}|�|��}|��|d}|j�|j��d}t|��tkr=|�|��D]'}	|	�|j
|j��|_�(|�|��|j|jkr+t#d|j|jd�|j���}||d<dS|�|��dS|�||t&��dS)Nr�r�r/r�rr�r)rirr0r�rr�rErkr�r�r%r�rxrBr r�rDr�r�r)
rHrBr r	rr�rr��
added_itemr
s
          r�
_item_removedzDiffBuilder._item_removedsq�� ���t�S�)�)�"
�"
��'�)�)�)������g�.�.���K�K��'�'�	����q��B�
��+�+�D�L�9�9�!�<�J��J���4�'�'�����.�.�=�=�A��^�^�B�G�R�V�<�<�B�F�F��K�K�������"�+�-�-�&� �"�O��K�(�(� $�/�	1�1�1��
 &�	�!�������I�&�&�&�&�&�
���T�9�j�9�9�9�9�9rc	�|�|�tdt||��|d�|j�����dS)Nr�r�r/)r�r�rr0)rHrBr r	s    r�_item_replacedzDiffBuilder._item_replaced?sY�����$���t�S�)�)��&
�&
��'�	)�)�)�	*�	*�	*�	*�	*rc��t|�����}t|�����}||z
}||z
}|D],}|�|t|��||���-|D],}|�|t|��||���-||zD]&}|�||||||���'dSrO)�set�keysrrer
r�)	rHrBr<r=�src_keys�dst_keys�
added_keys�removed_keysr s	         r�_compare_dictszDiffBuilder._compare_dictsFs����s�x�x�z�z�?�?���s�x�x�z�z�?�?����(�
��(�*���	9�	9�C����t�S��X�X�s�3�x�8�8�8�8��	7�	7�C����T�3�s�8�8�S��X�6�6�6�6��h�&�	@�	@�C�� � ��s�C��H�c�#�h�?�?�?�?�	@�	@rc��t|��t|��}}t||��}t||��}t|��D�]1}||kr�||||}
}	|	|
kr� t	|	t
��r;t	|
t
��r&|�t||��|	|
���pt	|	t��r;t	|
t��r&|�	t||��|	|
����|�
|||	��|�|||
����||kr|�
||||����|�||||����3dSrO)r�max�minr�r1rrrr	�_compare_listsrr
)rHrBr<r=�len_src�len_dst�max_len�min_lenr �old�news           rrzDiffBuilder._compare_listsUs����s�8�8�S��X�X����g�w�'�'���g�w�'�'����>�>�	6�	6�C��W�}�}��s�8�S��X�S���#�:�:����^�4�4�
5��s�N�3�3�
5��'�'�
�4��(=�(=�s�C�H�H�H�H���_�5�5�5�"�3��8�8�5��'�'�
�4��(=�(=�s�C�H�H�H�H��&�&�t�S�#�6�6�6��$�$�T�3��4�4�4�4��7�"�"��"�"�4��#�c�(�;�;�;�;�� � ��s�C��H�5�5�5�5�-	6�	6rc���t|t��r<t|t��r'|�t||��||��dSt|t��r<t|t��r'|�t||��||��dS|�|��|�|��krdS|�|||��dSrO)r1rrrr	rr�r)rHrBr r<r=s     rr�zDiffBuilder._compare_valuesqs����c�>�*�*�	0��3��/�/�	0����
�4�� 5� 5�s�C�@�@�@�@�@�
��_�
-�
-�	0��3��0�0�	0����
�4�� 5� 5�s�C�@�@�@�@�@��Z�Z��_�_��
�
�3���
/�
/��F�
����c�3�/�/�/�/�/rN)rrrr�r�rrJr�r�r�r�r�r�r�r
rrrrr�rrrr�r��s�������/3�z�{�%�%�%�%�?�?�?�-�-�-����������������(7�7�7�2:�:�:�B*�*�*�
@�
@�
@�6�6�6�80�0�0�0�0rr�c��|�|S|dzt|���dd���dd��zS)Nr]�~z~0z~1)rer�rts  rrr�sA��
�{����#�:��C���(�(��d�3�3�;�;�C��F�F�F�Fr)4r�
__future__rr#r��	functoolsr��sys�typesr�ImportErrorr'�jsonpointerrrrr�collections.abcrr	�unicodere�
__author__�__version__�__website__�__license__�version_info�bytesr2�	Exceptionrrr�AssertionErrorrr,�partialr�r�r9r>�objectr@rir|r�r�r�r�r3r�rrrr�<module>r:s��B&�%�'�'�'�'�'�'�����������������
�
�
�
��&�&�&�&�&�&�&��������������:�9�9�9�9�9�9�9���
�
��?�?�?�?�?�?�?�?�?������;�;�;�;�;�;�;�;�
�C�C�C�����
0�
���@��$����v������J�$�$�$�$�$��$�$�$�7�7�7�7�7�)�7�7�7������*����$�$�$�$�$�,�n�$�$�$���� �Y�
�t�z�Y�
G�
G�
G�
�&+��%&�%&�%&�%&�P&1�B�B�B�B�03/�3/�3/�3/�3/�V�3/�3/�3/�l�����n����<1�1�1�1�1�>�1�1�1�h'�'�'�'�'�~�'�'�'�TS�S�S�S�S�N�S�S�S�l�����N����6�����N����2@<�@<�@<�@<�@<��@<�@<�@<�FT0�T0�T0�T0�T0�&�T0�T0�T0�nG�G�G�G�Gs�%�/�/�A�A�A