
    
3j`v                     (   S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
r
S SKrS SKrS SKrS SKrS SKrS SKJrJr  S SKJr  S SKJrJr  S SKJrJrJrJrJrJr  S SKJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-  S SK.J/r/   S SK0r0\Rd                  " \35      r4 " S S	\55      r6\7" S5      r8S
r9Sr:Sr;Sr<Sr=\>" 1 Sk5      r?0 S\@_S\A_S\B_S\>_S\C_S\D_S\E_S\F_S\G_S\H_S\I_S\J_S\K_S\L_SS_SS_S \	R                  _\	R                  \	R                  \
R                  \)\R                  \R                  \R                  \D\R                  \R                  \FS!.ErU " S" S#\15      rV " S$ S%\15      rW " S& S'5      rXS(rY\>" \E\Z15      r[ " S) S*5      r\ " S+ S,\ R                  5      r^ " S- S.\ R                  5      r`SRS/ jraSSS0 jrbS1 rcS2 rdSTS3 jreSUS5 jrfSVS6 jrgS7 rhS8 riS9 rjS: rk0 \
R                  \h_\R                  \i_\)\F_\R                  \F_\B\F_\7S; _\E\k_\	R                  S< _\R                  S= _\#\I_\$\I_\%\H_\&\H_\'S> _\G\j_\\J_\,\D_\-\D\oS? \\F0Erp\+\*La  S@ \p\+'   STSA jrq " SB SC\R                  5      rr\SD\SE\D4SF j5       rs\SD\SG\\J   SH\KSI\S4   SE\E4
SJ j5       rs\SD\SG\\J   SH\KSI\SK   SE\D4
SL j5       rsSMrtSNruSO rv   SWSD\SG\\J   SH\KSI\KSE\\D\E4   4
SP jjrs\" \R                  \rSQ9rxg! \1 a    Sr0 GN|f = f)X    N)deepcopycopy)partial)MappingKeysView)CallableOptionalUnionoverloadLiteralAny)stringsget_type	TEXT_VIEW	TREE_VIEW
np_float32
np_float64np_int32np_int64
np_ndarrayOpcode
SetOrderedpydantic_base_model_typePydanticBaseModel
NotPresentipranges)DeltaResultc                       \ rS rSrSrg)UnsupportedFormatErr2    N)__name__
__module____qualname____firstlineno____static_attributes__r!       P/home/wildlama/miniconda3/lib/python3.13/site-packages/deepdiff/serialization.pyr   r   2   s    r'   r   i   zXDeepDiff Delta did not find {} in your modules. Please make sure it is already imported.z^Module '{}' is forbidden. You need to explicitly pass it by passing a safe_to_import parameterz[report_repetition must be set to True when ignore_order is True to create the delta object.zkDelta can not be made when group_by is used since the structure of data is modified from the original form.>$   	uuid.UUID
re.Patternbuiltins.binbuiltins.intbuiltins.setbuiltins.strbuiltins.Nonebuiltins.boolbuiltins.dictbuiltins.listdatetime.timebuiltins.bytesbuiltins.floatbuiltins.rangebuiltins.slicebuiltins.tupledecimal.Decimalbuiltins.complexdatetime.datetimebuiltins.frozensetdatetime.timedeltafractions.Fractionipaddress.IPv4Addressipaddress.IPv4Networkipaddress.IPv6Addressipaddress.IPv6Networkcollections.namedtupledeepdiff.helper.Opcodecollections.OrderedDictipaddress.IPv4Interfaceipaddress.IPv6Interfacecollections.abc.KeysViewdeepdiff.helper.SetOrderedorderly_set.sets.OrderedSetorderly_set.sets.OrderlySetorderly_set.sets.StableSetEqrangecomplexset	frozensetslicestrbyteslisttupleintfloatdictboolbinNoneNoneTypedatetime)time	timedeltaDecimalr   
namedtupleOrderedDictPatterniprangeIPv4AddressIPv6Addressr   c                       \ rS rSrSrSrg)ModuleNotFoundError   z4
Raised when the module is not found in sys.modules
r!   Nr"   r#   r$   r%   __doc__r&   r!   r'   r(   rh   rh           	r'   rh   c                       \ rS rSrSrSrg)ForbiddenModule   z?
Raised when a module is not explicitly allowed to be imported
r!   Nrj   r!   r'   r(   rn   rn      rl   r'   rn   c            	           \ rS rSrS r\S 5       rSS\\   S\\	   4S jjr
SS\\	   S\4S	 jjr   SS
\S\S\S\4S jjrSS\\\\4      4S jjrSrg)SerializationMixin   c                      SSK nU R                  5       nUR                  U5      $ ! [         a    [        R                  S5         gf = f)z
:ref:`to_json_pickle_label`
Get the json pickle of the diff object. Unless you need all the attributes and functionality of DeepDiff, running to_json() is the safer option that json pickle.
r   NzGjsonpickle library needs to be installed in order to run to_json_pickle)
jsonpickler   encodeImportErrorloggererror)selfrt   copieds      r(   to_json_pickle!SerializationMixin.to_json_pickle   sE    
	dYY[F$$V,, 	dLLbc	ds   $' A	A	c                 x     SSK nUR                  U5      $ ! [         a    [        R	                  S5         gf = f)z
:ref:`from_json_pickle_label`
Load DeepDiff object with all the bells and whistles from the json pickle dump.
Note that json pickle dump comes from to_json_pickle
r   NzIjsonpickle library needs to be installed in order to run from_json_pickle)rt   decoderv   rw   rx   )clsvaluert   s      r(   from_json_pickle#SerializationMixin.from_json_pickle   s:    	f$$U++ 	fLLde	fs    99Ndefault_mappingverbose_levelc                 >    U R                  US9n[        U4UUS.UD6$ )a  
Dump json of the text view.
**Parameters**

default_mapping : dictionary(optional), a dictionary of mapping of different types to json types.

by default DeepDiff converts certain data types. For example Decimals into floats so they can be exported into json.
If you have a certain object type that the json serializer can not serialize it, please pass the appropriate type
conversion through this dictionary.

force_use_builtin_json: Boolean, default = False
    When True, we use Python's builtin Json library for serialization,
    even if Orjson is installed.

verbose_level: int, default=None
    Override the verbose_level for the serialized output. See to_dict() for details.

kwargs: Any other kwargs you pass will be passed on to Python's json.dumps()

**Example**

Serialize custom objects
    >>> class A:
    ...     pass
    ...
    >>> class B:
    ...     pass
    ...
    >>> t1 = A()
    >>> t2 = B()
    >>> ddiff = DeepDiff(t1, t2)
    >>> ddiff.to_json()
    TypeError: We do not know how to convert <__main__.A object at 0x10648> of type <class '__main__.A'> for json serialization. Please pass the default_mapping parameter with proper mapping of the object to a basic python type.

    >>> default_mapping = {A: lambda x: 'obj A', B: lambda x: 'obj B'}
    >>> ddiff.to_json(default_mapping=default_mapping)
    '{"type_changes": {"root": {"old_type": "A", "new_type": "B", "old_value": "obj A", "new_value": "obj B"}}}'
r   )r   force_use_builtin_json)to_dict
json_dumps)ry   r   r   r   kwargsdics         r(   to_jsonSerializationMixin.to_json   s:    N lll7
+#9
 	
 	
r'   returnc                     Ub  US;  a  [        S5      eUc#  U R                  [        :X  a  SnOU R                  n[	        U R                  [        US95      $ )a  
Convert the result to a python dictionary.

**Parameters**

verbose_level: int, default=None
    Override the verbose_level for the serialized output.
    When None, the behavior depends on the original view:
    - If the original view is 'text', the verbose_level from DeepDiff initialization is used.
    - If the original view is 'tree', verbose_level=2 is used to provide the most detailed output.
    Valid values are 0, 1, or 2.
>   r         z#verbose_level should be 0, 1, or 2.r   r   )
ValueErrorviewr   r   rX   _get_view_resultsr   )ry   r   s     r(   r   SerializationMixin.to_dict   sZ     $i)GBCC yyI% ! $ 2 2D**9M*RSSr'   directedreport_repetition_requiredalways_include_valuesc                    U R                   b  [        [        5      eU(       a  U(       d  0 nU R                  R	                  5        Ho  u  pV/ XE'   U H`  n[        UR                  UR                  UR                  UR                  UR                  UR                  S9nXE   R                  U5        Mb     Mq     OU R                  n[        U R                  U R                  UUS9n	U	R!                  5         U(       a1  U R                  (       a   U R"                  (       d  [        [$        5      eU(       ak  U	R	                  5        HW  u  p['        U[(        5      (       d  M  UR	                  5        H'  u  p\['        U[(        5      (       d  M  SU;   d  M$  US	 M)     MY     U R*                  (       a  U R*                  U	S'   U R,                  (       a  SU	S'   [/        [1        U	5      5      $ )ao  
Dump to a dictionary suitable for delta usage.
Unlike to_dict, this is not dependent on the original view that the user chose to create the diff.

**Parameters**

directed : Boolean, default=True, whether to create a directional delta dictionary or a symmetrical

Note that in the current implementation the symmetrical delta (non-directional) is ONLY used for verifying that
the delta is being applied to the exact same values as what was used to generate the delta and has
no other usages.

If this option is set as True, then the dictionary will not have the "old_value" in the output.
Otherwise it will have the "old_value". "old_value" is the value of the item in t1.

If delta = Delta(DeepDiff(t1, t2)) then
t1 + delta == t2

Note that it the items in t1 + delta might have slightly different order of items than t2 if ignore_order
was set to be True in the diff object.

)tagt1_from_indext1_to_indext2_from_indext2_to_index
new_values)tree_resultsignore_orderr   _iterable_opcodes	old_value_numpy_pathsT_iterable_compare_func_was_used)group_byr   DELTA_ERROR_WHEN_GROUP_BYr   itemsr   r   r   r   r   r   r   appendr   treer   remove_empty_keysreport_repetition*DELTA_IGNORE_ORDER_NEEDS_REPETITION_REPORT
isinstancer   r   iterable_compare_funcr   rX   )ry   r   r   r   r   pathop_codesop_codenew_op_coderesult
report_keyreport_valuer   s                r(   _to_delta_dict!SerializationMixin._to_delta_dict   s   8 ==$6771 ""&"8"8">">"@*,!''G"(#KK&-&;&;$+$7$7&-&;&;$+$7$7#*#5#5#K &+22;?  ( #A !% 6 6**"7/	
 	  "%$*;*;DDZDZGHH,2LLN(
lG44'3'9'9';%eW55+:N %k 2 (< -;
  &*%6%6F>"%%8<F45V%%r'   prefixc                 D  ^ ^ / nTc  Sm[        T R                  R                  5       5      nU H(  nT R                  U    H  nU[        U5      /-  nM     M*     [	        T5      (       a  SR                  UU 4S jU 5       5      $ SR                  U4S jU 5       5      $ )a_  
The pretty human readable string output for the diff object
regardless of what view was used to generate the diff.

prefix can be a callable or a string or None.

Example:
    >>> t1={1,2,4}
    >>> t2={2,3}
    >>> print(DeepDiff(t1, t2).pretty())
    Item root[3] added to set.
    Item root[4] removed from set.
    Item root[1] removed from set.
 
c              3   8   >#    U  H  nT" TS 9 U 3v   M     g7f))diffNr!   ).0rr   ry   s     r(   	<genexpr>,SerializationMixin.pretty.<locals>.<genexpr>W  s      G1D 121#6s   c              3   0   >#    U  H  nT U 3v   M     g 7fNr!   )r   r   r   s     r(   r   r   X  s     8AF8A3s   )sortedr   keyspretty_print_diffcallablejoin)ry   r   r   r   keyitem_keys   ``    r(   prettySerializationMixin.pretty?  s     >Fdiinn&'C IIcN,X677 +  F99GGGGyy8888r'   r!   )NFNr   )TTF)r"   r#   r$   r%   r{   classmethodr   r	   rX   rV   r   r   rY   r   r
   rR   r   r   r&   r!   r'   r(   rq   rq      s    
d 
f 
f-
x~ -
iqruiv -
^TXc] TD T0 +/&+	G&G& %)G&  $	G&
 
G&R9XeCM&:; 9 9r'   rq   i   c                   (    \ rS rSrSrSrS rS rSrg)_SafeConstructorid  zVWraps a type constructor to prevent excessive memory allocation via the REDUCE opcode._wrappedc                     Xl         g r   r   )ry   wrappeds     r(   __init___SafeConstructor.__init__h  s    r'   c                     U Hc  n[        U[        5      (       d  M  U[        :  d  M&  [        R                  " SR                  U R                  R                  U[        5      5      e   U R                  " U0 UD6$ )NzRefusing to create {}() with size {}: exceeds the maximum allowed size of {} bytes. This could be a denial-of-service attack payload.)r   rV   _MAX_ALLOC_SIZEpickleUnpicklingErrorformatr   r"   )ry   argsr   args       r(   __call___SafeConstructor.__call__k  sk    C#s##o(=,,HHN.._I   }}d-f--r'   N)	r"   r#   r$   r%   rk   	__slots__r   r   r&   r!   r'   r(   r   r   d  s    `I 
.r'   r   c                   4   ^  \ rS rSrU 4S jrS rS rSrU =r$ )_RestrictedUnpicklerix  c                   > UR                  SS 5      U l        U R                  (       a  [        U R                  [        5      (       a  [	        U R                  /5      U l        O@[        U R                  [        [
        45      (       a  O[	        U R                  5      U l        U R                  [        -  U l        O[        U l        [        TU ]   " U0 UD6  g )Nsafe_to_import)	popr   r   r   rO   rP   SAFE_TO_IMPORTsuperr   )ry   r   r   	__class__s      r(   r   _RestrictedUnpickler.__init__z  s    $jj)94@$--w77&)4+>+>*?&@#D//#y1ABB&)$*=*=&>#"&"5"5"FD"0D$)&)r'   c                 F   SR                  X5      nX0R                  ;   a6   [        R                  U   n[        XB5      nU[        ;   a  [        U5      $ U$ [        [        R                  U5      5      S e! [         a     [        [        R                  U5      5      S ef = f)Nz{}.{})r   r   sysmodulesKeyErrorrh   MODULE_NOT_FOUND_MSGgetattr_SIZE_SENSITIVE_CALLABLESr   rn   FORBIDDEN_MODULE_MSG)ry   modulenamemodule_dot_class
module_objr   s         r(   
find_class_RestrictedUnpickler.find_class  s    ">>&7222c [[0
 *+C//',,J299:JKLRVV  c)*>*E*EFV*WX^bbcs   A6 6*B c                 &    US:X  a  [        S 5      $ g Nz<<NoneType>>)type)ry   pids     r(   persistent_load$_RestrictedUnpickler.persistent_load  s    . : !r'   r   )	r"   r#   r$   r%   r   r   r   r&   __classcell__)r   s   @r(   r   r   x  s    *W  r'   r   c                       \ rS rSrS rSrg)_RestrictedPickleri  c                     U[         L a  gg r   )	NONE_TYPE)ry   objs     r(   persistent_id _RestrictedPickler.persistent_id  s    )!r'   r!   N)r"   r#   r$   r%   r  r&   r!   r'   r(   r  r    s    r'   r  c                     [        U5      nU=(       d    [        R                  " 5       n[        XSS9R	                  U 5        U(       d  UR                  5       $ g)a  
**pickle_dump**
Dumps the obj into pickled content.

**Parameters**

obj : Any python object

file_obj : (Optional) A file object to dump the contents into

**Returns**

If file_obj is passed the return value will be None. It will write the object's pickle contents into the file.
However if no file_obj is passed, then it will return the pickle serialization of the obj in the form of bytes.
F)protocolfix_importsN)rY   ioBytesIOr  dumpgetvalue)r  file_objr  file_obj_passeds       r(   pickle_dumpr    sI      8nO'2::<HxFKKCP  "" r'   c                     U (       d  U(       d  [        S5      e[        U [        5      (       a  U R                  S5      n U (       a  [        R
                  " U 5      n[        XS9R                  5       $ )a  
**pickle_load**
Load the pickled content. content should be a bytes object.

**Parameters**

content : Bytes of pickled object. 

file_obj : A file object to load the content from

safe_to_import : A set of modules that needs to be explicitly allowed to be loaded.
    Example: {'mymodule.MyClass', 'decimal.Decimal'}
    Note that this set will be added to the basic set of modules that are already allowed.
    The set of what is already allowed can be found in deepdiff.serialization.SAFE_TO_IMPORT

**Returns**

    A delta object that can be added to t1 to recreate t2.

**Examples**

Importing
    >>> from deepdiff import DeepDiff, Delta
    >>> from pprint import pprint


z>Please either pass the content or the file_obj to pickle_load.utf-8r   )r   r   rR   ru   r
  r  r   load)contentr  r   s      r(   pickle_loadr    sU    8 8YZZ'3..)::g&HMMOOr'   c                 ^    SSSSSSSSS	S
SS.nU S:X  a  UR                  SSSSSSS.5        U$ )NzdType of {diff_path} changed from {type_t1} to {type_t2} and value changed from {val_t1} to {val_t2}.z7Value of {diff_path} changed from {val_t1} to {val_t2}.z%Item {diff_path} added to dictionary.z)Item {diff_path} removed from dictionary.z#Item {diff_path} added to iterable.z'Item {diff_path} removed from iterable.zAttribute {diff_path} added.zAttribute {diff_path} removed.z!Item root[{val_t2}] added to set.z%Item root[{val_t1}] removed from set.z'Repetition change for item {diff_path}.)type_changesvalues_changeddictionary_item_addeddictionary_item_removediterable_item_addediterable_item_removedattribute_addedattribute_removedset_item_addedset_item_removedrepetition_changer   z0Item {diff_path} ({val_t2}) added to dictionary.z4Item {diff_path} ({val_t1}) removed from dictionary.z.Item {diff_path} ({val_t2}) added to iterable.z2Item {diff_path} ({val_t1}) removed from iterable.z'Attribute {diff_path} ({val_t2}) added.z)Attribute {diff_path} ({val_t1}) removed.)r  r  r  r  r  r  )update)r   pretty_form_textss     r(   _get_pretty_form_textr$    sb    ~S!H#ND!J9==CF   )[+a'W)]#L%P		
 r'   c                    [        U R                  5      R                  n[        U R                  5      R                  nUS:X  a$  SR	                  [        U R                  5      5      O[        U R                  5      nUS:X  a$  SR	                  [        U R                  5      5      O[        U R                  5      nU R                  SS9n[        U R                  5      R                  U R                  S5      R	                  UUUUUS9$ )NrR   z"{}"root)r&  r   )	diff_pathtype_t1type_t2val_t1val_t2)r   t1r"   t2r   rR   r   r$  r   getreport_type)r   r(  r)  r*  r+  r'  s         r(   r   r     s    tww((Gtww((G,3u,<V]]3tww<(#dgg,F,3u,<V]]3tww<(#dgg,F		v	&I !3!34889I9I2NUU V  r'   c                    Uc  U R                  S5      S   nUS:X  a0  [        U S5       n[        UR                  5       5      nSSS5        U$ US;   a-   SSKn[        U S5       nUR                  U5      nSSS5        U$ US	:X  aG   [        R                  S
:  a  SSK	nOSSK
n [        U S5       nUR                  U5      nSSS5        U$ US:X  a2  [        U S5       nUR                  5       n[        U5      nSSS5        U$ US;   a   SSKnUR                  U 5      n[$        R'                  SU  35        W HR  nUR)                  5        H;  u  pU
R+                  5       n
[,        [.        [0        4 H  n U" U
5      n
XU	'     M9     M=     MT     U$ [5        SU S35      e! , (       d  f       W$ = f! [
         a    [        S5      Sef = f! , (       d  f       W$ = f! [
         a    [        S5      Sef = f! , (       d  f       W$ = f! , (       d  f       W$ = f! [
         aK    SSKn[        U S5       n[!        UR#                  U5      5      nSSS5         GM>  ! , (       d  f        GNN= ff = f! [2         a     GM  f = f)z1
Loads and deserializes the content of the path.
N.jsonr   >   ymlyamlr   Pyyaml needs to be installed.toml)      z,On python<=3.10 tomli needs to be installed.rbr   >   csvtsvzNOTE: CSV content was empty in ?Only json, yaml, toml, csv, tsv and pickle are supported.
 The  extension is not known.)splitopen
json_loadsreadr5  rv   	safe_loadr   version_infotomllibtomlir  r  	clevercsv
read_dictsr;  rT   
DictReaderrw   infor   striprV   rW   rN   	Exceptionr   )r   	file_typethe_filer  r5  rF  rG  r;  rowr   r   type_s               r(   load_path_contentrQ    s   
 JJsOB'	F$_ 1G b N_ 
o	%	I $_nnX.G T NQ 
f		X7*' $jj*G @ N= 
h	$mmoG!'*G : N5 
n	$	9**40G 	5dV<= C!iik
!5'2E %e $)C 3 *  N # &++4+5M$O P 	P_ _b NY  	I=>DH	I_T NE  	XLMSWW	X@ N; : N-  	9dCHs~~h78 !	9 % s   F#F5 %GG! !G! 2G; HH 9I7#
F25G
G!G8;
H

HI49I I4 
I0	*I40I47
J	J	Tc                     U S3n[         R                  " X5         [        XX#S9  U(       d  [         R                  " U5        gg! [         a    [         R                  " XA5        e f = f)z/
Saves and serializes the content of the path.
z.bak)r  r   rM  keep_backupN)osrename_save_contentremoverL  )r  r   rM  rS  backup_paths        r(   save_content_to_pathrY  H  sd    
 F$-KIId 	#	: IIk" 	  
		+$s   
A "A(c                    US:X  a3  [        US5       n[        U 5      n UR                  U 5        S S S 5        U $ US;   a+   SS Kn[        US5       nUR                  XS9n S S S 5        U $ US:X  a-   SS Kn[        US	5       nUR                  X5      n S S S 5        U $ US
:X  a   [        US	5       n[        XS9n S S S 5        U $ US;   aj   SS K	nUR                  n[        USSS9 n
[        U S   R                  5       5      nU" XS9nUR                  5         UR                  U 5        S S S 5        U $ [!        SU S35      e! , (       d  f       U $ = f! [         a    [	        S5      S ef = f! , (       d  f       U $ = f! [         a    [	        S5      S ef = f! , (       d  f       U $ = f! , (       d  f       U $ = f! [         a    SS Kn	U	R                  n GNf = f! , (       d  f       U $ = f)Nr3  w>   r4  r5  r   r6  )streamr7  zTomli-w needs to be installed.wbr   )r  >   r;  r<  r   )newline)
fieldnamesr=  r>  )r@  r   writer5  rv   	safe_dumptomli_wr  r  rG  
DictWriterr;  rT   r   writeheader	writerowsr   )r  r   rM  rS  rN  r5  rb  rG  dict_writerr;  csvfiler_  writers                r(   rV  rV  \  s   F$_ )GNN7# F NA 
o	%	I $_nnWn>G 6 N3 
f		J $ll75G ( N% 
h	$!'=G " N 
n	$	)#..K $R(Ggajoo/0J @F W%	 ) N # $++4+5M$O P 	PC _F N;  	I=>DH	I_6 N-  	J>?TI	J( N# " N  	)..K	) )( Nsf   EE E/2F F0
F-F? &AG 
EE,/
E>F
F*-
F<?GG 
G/c                 j    U R                  5       R                  S:X  a  [        U 5      $ [        U 5      $ )Nr   )as_tupleexponentrV   rW   r   s    r(   _serialize_decimalrm    s+    ~~  A%5zU|r'   c                 P    U R                   S:X  a  U R                  $ [        U 5      $ )Nr   )denominator	numeratorrW   rl  s    r(   _serialize_fractionrq    s$    AU|r'   c                 H    [        U S5      (       a  U R                  5       $ U $ )N_asdict)hasattrrs  rl  s    r(   _serialize_tupleru    s     ui  }}Lr'   c                      U R                  S5      $ ! [         a(    [        R                  " U 5      R                  S5      s $ f = f)z
Serialize bytes to JSON-compatible format.
First tries UTF-8 decoding for backward compatibility.
Falls back to base64 encoding for binary data.
r  ascii)r~   UnicodeDecodeErrorbase64	b64encoderl  s    r(   _serialize_bytesr{    sA    7||G$$ 7&--g667s    /AAc                     U R                   $ r   )r"   xs    r(   <lambda>r    s    AJJr'   c                 "    U R                  5       $ r   )	isoformatr}  s    r(   r  r    s
    r'   c                     [        U 5      $ r   )rR   r}  s    r(   r  r    s    Qr'   c                 "    U R                  5       $ r   )tolistr}  s    r(   r  r    s
    !((*r'   c                 "    U R                  5       $ r   )tobytesr}  s    r(   r  r    s
    !))+r'   c                 "    U R                  5       $ r   )
model_dumpr}  s    r(   r  r    s
    !,,.r'   c                 z   ^ U (       a&  [         R                  5       mTR                  U 5        O[         mU4S jnU$ )Nc                   > T	R                  5        H  u  p[        X5      (       d  M  U" U 5      s  $    U R                  R                  S:X  a  [	        [        U 5      5      $ 0 nU R                  R                   Hc  nUR                  R                  5        HB  u  pV[        U[        5      (       d  M  UR                  S5      (       a  M4   [        X5      X5'   MD     Me     U(       a  U$ [        U S5      (       aF  [        U 5      R                  5        VVs0 s H  u  pxUR                  S5      (       a  M  Xx_M!     snn$ [        SU < S[        U 5      R                   S35      e! [         a     M  f = fs  snnf )Nlist_reverseiterator___dict__z!Don't know how to JSON-serialize z (type z)); consider adding it to default_mapping.)r   r   r   r"   rT   r   __mro__r  property
startswithr   rL  rt  vars	TypeErrorr   )
r  original_type
convert_topropsr   r   
descriptorkv_convertor_mappings
            r(   
_convertor*json_convertor_default.<locals>._convertor  sV   );)A)A)C%M#--!#& *D ==!!%;;S	?"==((C$'LL$6$6$8 j(33DOOC<P<P&-c&8 %9 ) L 3
## !IOO--DA||C( -  /w 7#Y''( )55
 	
 % s   E(E98E9(
E65E6)JSON_CONVERTORr   r"  )r   r  r  s     @r(   json_convertor_defaultr    s7    +002!!/2+!
F r'   c                        \ rS rSrS rS rSrg)JSONDecoderi  c                 d    [         R                  R                  " U /UQ7SU R                  0UD6  g )Nobject_hook)r3  r  r   r  )ry   r   r   s      r(   r   JSONDecoder.__init__  s+    !!$VtVD4D4DVvVr'   c                 f    SU;   a*  SU;   a$  S H  nX   n[         R                  X35      X'   M      U$ )Nold_typenew_type)r  r  )TYPE_STR_TO_TYPEr.  )ry   r  type_keytype_strs       r(   r  JSONDecoder.object_hook  s;    s!24= 0 4 4X H 5 
r'   r!   N)r"   r#   r$   r%   r   r  r&   r!   r'   r(   r  r    s    Wr'   r  itemr   c                     g r   r!   )r  r   s     r(   r   r     s    
 r'   r   r   return_bytesc                     g r   r!   r  r   r   r  r   s        r(   r   r          r'   Fc                     g r   r!   r  s        r(   r   r     r  r'   l    l         c           
      F   [        U [        5      (       a  U $ [        U [        5      (       a  U [        :  d
  U [        :  a  [        U 5      $ [        U [        5      (       a/  U R                  5        VVs0 s H  u  pU[        U5      _M     snn$ [        U [        [        45      (       ak  U  Vs/ s H  n[        U5      PM     nn[        U S5      (       a.  [        U 5      " S0 [        [        U R                  U5      5      D6$ [        U 5      " U5      $ U $ s  snnf s  snf )zRecursively convert integers exceeding 64-bit range to strings.
orjson cannot serialize integers outside the signed 64-bit range._fieldsr!   )r   rY   rV   
_INT64_MAX
_INT64_MINrR   rX   r   _convert_oversized_intsrT   rU   rt  r   zipr  )r  r  r  	converteds       r(   r  r    s     #t
#sz!1S:5E3x#t:=))+F+$!*1--+FF#e}%%9<=A,Q/	=3	""9AtCY$?@AACy##J G=s   4D/Dc           	      ~   [         (       a  U(       d  UR                  SS5      n[         R                  [         R                  -  US'   U(       a  US==   [         R                  -  ss'   SU;   a  [        S5      e [         R                  " U 4S[        US90UD6nU(       a  U$ UR                  S	S
9$ [        R                  " U 4S[        US90UD6nU(       a  UR                  S	S
9$ U$ ! [
         aE  nS[        U5      ;   a0  [        U 5      n [         R                  " U 4S[        US90UD6n SnANe SnAff = f)z
Dump json with extra details that are not normally json serializable

parameters
----------

force_use_builtin_json: Boolean, default = False
    When True, we use Python's builtin Json library for serialization,
    even if Orjson is installed.
indentNoption	sort_keyszorjson does not accept the sort_keys parameter. If you need to pass sort_keys, set force_use_builtin_json=True to use Python's built-in json library instead of orjson.default)r   zInteger exceeds 64-bit ranger  )encoding)orjsonr   OPT_NON_STR_KEYSOPT_SERIALIZE_NUMPYOPT_INDENT_2r  dumpsr  rR   r  r~   r3  ru   )r  r   r   r  r   r  r   es           r(   r   r   /  sM   " v,Hd+!22V5O5OOx8 3 33& KL L	\\.O F M}}g}..*?K  =='=22'  	-Q7.t42?S 
 	s   = C- -
D<7:D76D77D<)r   )N   )NNNr   )NT)T)NFF)yr   r   r
  rT  r3  uuidloggingrebuiltinsr]   decimalorderly_setcollections	fractions	ipaddressry  r   r   	functoolsr   collections.abcr   r   typingr   r	   r
   r   r   r   deepdiff.helperr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   deepdiff.modelr   r  rv   	getLoggerr"   rw   r  r   r   r  CSV_HEADER_MAX_CHUNK_SIZEr   r   r   r   rP   r   rM   rN   rO   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r^   r_   r`   ra   rb   rc   re   rf   r  rh   rn   rq   r   	bytearrayr   r   	Unpicklerr   Picklerr  r  r  r$  r   rQ  rY  rV  rm  rq  ru  r{  FractionStableSetEqUUID
memoryviewr  r  r  r   r  r  r  loadsrA  r!   r'   r(   <module>r     s    
 	 	    	           -     " ' 
		8	$	9 	 J	   r w  .K * J  % %PUw 
3 	
 U 
3 U D U 
3 U D D 
3 D  !" !!#$ MM##((**zz((((9 @	+ 		k 	B9 B9P $ &ui&89 . .("6++ "J #."PJ8 9x#(%P	7OO'+  T	
  	
 
 . 	II   c c $ 
  T!" #$ c%d). 44(@N$%*Z$""  

 	 
 

TN ! 	  
 

TN ! 	 	 
 !
!
( $(#(	3
3TN3 !3 	3 3:3l TZZ[1
q  Fs   L LL