
    rh}                         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	J
r
Jr  SSKJr                   SS jrS rS rS	 r " S
 S5      rg)    N)chainislice   )handlerstagsutil)jsonc                     U=(       d    [         nU=(       d    [        UUUUUUU	UU
UUUUU S9nUR                  UR                  XS9XS9$ )ap  Return a JSON formatted representation of value, a Python object.

:param unpicklable: If set to ``False`` then the output will not contain the
    information necessary to turn the JSON data back into Python objects,
    but a simpler JSON stream is produced. It's recommended to set this
    parameter to ``False`` when your code does not rely on two objects
    having the same ``id()`` value, and when it is sufficient for those two
    objects to be equal by ``==``, such as when serializing sklearn
    instances. If you experience (de)serialization being incorrect when you
    use numpy, pandas, or sklearn handlers, this should be set to ``False``.
    If you want the output to not include the dtype for numpy arrays, add::

        jsonpickle.register(
            numpy.generic, UnpicklableNumpyGenericHandler, base=True
        )

    before your pickling code.
:param make_refs: If set to False jsonpickle's referencing support is
    disabled.  Objects that are id()-identical won't be preserved across
    encode()/decode(), but the resulting JSON stream will be conceptually
    simpler.  jsonpickle detects cyclical objects and will break the cycle
    by calling repr() instead of recursing when make_refs is set False.
:param keys: If set to True then jsonpickle will encode non-string
    dictionary keys instead of coercing them into strings via `repr()`.
    This is typically what you want if you need to support Integer or
    objects as dictionary keys.
:param max_depth: If set to a non-negative integer then jsonpickle will
    not recurse deeper than 'max_depth' steps into the object.  Anything
    deeper than 'max_depth' is represented using a Python repr() of the
    object.
:param reset: Custom pickle handlers that use the `Pickler.flatten` method or
    `jsonpickle.encode` function must call `encode` with `reset=False`
    in order to retain object references during pickling.
    This flag is not typically used outside of a custom handler or
    `__getstate__` implementation.
:param backend: If set to an instance of jsonpickle.backend.JSONBackend,
    jsonpickle will use that backend for deserialization.
:param warn: If set to True then jsonpickle will warn when it
    returns None for an object which it cannot pickle
    (e.g. file descriptors).
:param context: Supply a pre-built Pickler or Unpickler object to the
    `jsonpickle.encode` and `jsonpickle.decode` machinery instead
    of creating a new instance. The `context` represents the currently
    active Pickler and Unpickler objects when custom handlers are
    invoked by jsonpickle.
:param max_iter: If set to a non-negative integer then jsonpickle will
    consume at most `max_iter` items when pickling iterators.
:param use_decimal: If set to True jsonpickle will allow Decimal
    instances to pass-through, with the assumption that the simplejson
    backend will be used in `use_decimal` mode.  In order to use this mode
    you will need to configure simplejson::

        jsonpickle.set_encoder_options('simplejson',
                                       use_decimal=True, sort_keys=True)
        jsonpickle.set_decoder_options('simplejson',
                                       use_decimal=True)
        jsonpickle.set_preferred_backend('simplejson')

    NOTE: A side-effect of the above settings is that float values will be
    converted to Decimal when converting to json.
:param numeric_keys: Only use this option if the backend supports integer
    dict keys natively.  This flag tells jsonpickle to leave numeric keys
    as-is rather than conforming them to json-friendly strings.
    Using ``keys=True`` is the typical solution for integer keys, so only
    use this if you have a specific use case where you want to allow the
    backend to handle serialization of numeric dict keys.
:param use_base85:
    If possible, use base85 to encode binary data. Base85 bloats binary data
    by 1/4 as opposed to base64, which expands it by 1/3. This argument is
    ignored on Python 2 because it doesn't support it.
:param fail_safe: If set to a function exceptions are ignored when pickling
    and if a exception happens the function is called and the return value
    is used as the value for the object that caused the error
:param indent: When `indent` is a non-negative integer, then JSON array
    elements and object members will be pretty-printed with that indent
    level.  An indent level of 0 will only insert newlines. ``None`` is
    the most compact representation.  Since the default item separator is
    ``(', ', ': ')``,  the output might include trailing whitespace when
    ``indent`` is specified.  You can use ``separators=(',', ': ')`` to
    avoid this.  This value is passed directly to the active JSON backend
    library and not used by jsonpickle directly.
:param separators:
    If ``separators`` is an ``(item_separator, dict_separator)`` tuple
    then it will be used instead of the default ``(', ', ': ')``
    separators.  ``(',', ':')`` is the most compact JSON representation.
    This value is passed directly to the active JSON backend library and
    not used by jsonpickle directly.
:param include_properties:
    Include the names and values of class properties in the generated json.
    Properties are unpickled properly regardless of this setting, this is
    meant to be used if processing the json outside of Python. Certain types
    such as sets will not pickle due to not having a native-json equivalent.
    Defaults to ``False``.
:param handle_readonly:
    Handle objects with readonly methods, such as Django's SafeString. This
    basically prevents jsonpickle from raising an exception for such objects.
    You MUST set ``handle_readonly=True`` for the decoding if you encode with
    this flag set to ``True``.

>>> encode('my string') == '"my string"'
True
>>> encode(36) == '36'
True
>>> encode({'foo': True}) == '{"foo": true}'
True
>>> encode({'foo': [1, 2, [3, 4]]}, max_depth=1)
'{"foo": "[1, 2, [3, 4]]"}'

)unpicklable	make_refskeysbackend	max_depthwarnmax_iternumeric_keysuse_decimal
use_base85	fail_safeinclude_propertieshandle_readonlyoriginal_object)reset)indent
separators)r	   Picklerencodeflatten)valuer   r   r   r   r   r   r   contextr   r   r   r   r   r   r   r   r   s                     L/home/james-whalen/.local/lib/python3.13/site-packages/jsonpickle/pickler.pyr   r      sq    B oG !-'G  >>+F       c                     U=(       d    U(       + =(       a    [        U 5      U;   =(       a=    [        R                  " U 5      (       + =(       a    [        R                  " U 5      (       + $ )z>Detect cyclic structures that would lead to infinite recursion)idr   is_primitiveis_enum)objobjsmax_reachedr   s       r!   	_in_cycler*      sJ     
	;Y:2c7d? 	"!!#&&	"S!!r"   c                 N    [         R                  [        R                  " U 5      0$ )zlReturn a typeref dictionary

>>> _mktyperef(AssertionError) == {'py/type': 'builtins.AssertionError'}
True

)r   TYPEr   importable_name)r'   s    r!   
_mktyperefr.      s     IIt++C011r"   c                 6    [        U [        5      (       a  U 4$ U $ )z0Converts __slots__ = 'a' into __slots__ = ('a',))
isinstancestr)strings    r!   _wrap_string_slotr3      s    &#yMr"   c                       \ rS rSr              S#S jrS rS rS rS rS r	S	 r
S
 rS rS rS$S jrS rS rS rS rS rS rS rS rS rS rS%S jrS rS rS rS rS rS rS&S jr S  r!S! r"S"r#g)'r      Nc                    Xl         X l        U=(       d    [        U l        XPl        X`l        Xl        Xl        SU l        X0l	        0 U l
        / U l        Xpl        Xl        0 U l        Xl        U R                  (       a+  [         R"                  U l        [&        R(                  U l        O*[         R,                  U l        [&        R.                  U l        Xl        Xl        Xl        g N)r   r   r	   r   r   r   r   r   _depth
_max_depth_objs_seen	_max_iter_use_decimal
_flattenedr   r   B85
_bytes_tagr   	b85encode_bytes_encoderB64	b64encoder   r   _original_object)selfr   r   r   r   r   r   r   r   r   r   r   r   r   r   s                  r!   __init__Pickler.__init__   s    " '"$		($#

!'.??"hhDO"&..D"hhDO"&..D #"4 /r"   c                     [        U R                  S0 5      R                  5        H  u  pUR                  SS5      (       d  M    g   g)N_encoder_options	sort_keysFT)getattrr   valuesget)rG   _optionss      r!   _determine_sort_keysPickler._determine_sort_keys   s?    !$,,0BBGNNPJA{{;.. Q r"   c                    [        US5      (       a  U R                  (       a  [        S5      e[        US5      (       a4   [        [	        UR
                  R                  5       5      5      Ul        U$ U$ ! [        [        4 a     U$ f = f)N	__slots__zObjects with __slots__ cannot have their keys reliably sorted  by jsonpickle! Please sort the keys in the __slots__ definition instead.__dict__)hasattrr   	TypeErrordictsortedrV   itemsAttributeErrorrG   r'   s     r!   _sort_attrsPickler._sort_attrs  s    3$$ X 
 S*%%#F3<<+=+=+?$@A 
s
 ~. 
s    1A5 5B	B	c                 <    0 U l         SU l        / U l        0 U l        g r7   )r;   r9   r<   r?   rG   s    r!   r   Pickler.reset  s    

r"   c                 .    U =R                   S-  sl         g)z&Steps down one level in the namespace.r   N)r9   ra   s    r!   _pushPickler._push  s    qr"   c                 p    U =R                   S-  sl         U R                   S:X  a  U R                  5         U$ )zjStep up one level in the namespace and return the value.
If we're at the root, reset the pickler's state.
r   r8   )r9   r   )rG   r   s     r!   _popPickler._pop   s,     	q;;"JJLr"   c                     [        U5      nX R                  ;  nU(       a#  [        U R                  5      nX@R                  U'   U$ )z~
Log a reference to an in-memory object.
Return True if this object is new and was assigned
a new ID. Otherwise return False.
)r$   r;   len)rG   r'   objidis_newnew_ids        r!   _log_refPickler._log_ref)  s:     3jj(_F &JJur"   c                     U R                  U5      nU R                  (       + =(       d    U R                  (       + nU=(       d    U$ )zf
Log a reference to an in-memory object, and return
if that object should be considered newly logged.
)rn   r   r   )rG   r'   rl   pretend_news       r!   _mkrefPickler._mkref6  s7    
 s#***@$...@$f$r"   c                 j    [         R                  U R                  R                  [	        U5      5      0$ )z/Return a "py/id" entry for the specified object)r   IDr;   rO   r$   r]   s     r!   _getrefPickler._getref@  s"    3011r"   c                    U R                   (       a$  U R                  (       a  U R                  U5      nU$  U R                  [	        U5         nU$ ! [
         a,    U R                  U5      =o R                  [	        U5      '    U$ f = f)z>Flatten an object and its guts into a json-safe representation)r   r   _flatten_implr?   r$   KeyError)rG   r'   results      r!   _flattenPickler._flattenD  s    '',F 	LC1   L484F4Fs4KKC1Ls   A 2BBc                     U(       a  U R                  5         U R                  5       (       a  U R                  U5      nU R                  U5      $ )a  Takes an object and returns a JSON-safe representation of it.

Simply returns any of the basic builtin datatypes

>>> p = Pickler()
>>> p.flatten('hello world') == 'hello world'
True
>>> p.flatten(49)
49
>>> p.flatten(350.0)
350.0
>>> p.flatten(True)
True
>>> p.flatten(False)
False
>>> r = p.flatten(None)
>>> r is None
True
>>> p.flatten(False)
False
>>> p.flatten([1, 2, 3, 4])
[1, 2, 3, 4]
>>> p.flatten((1,2,))[tags.TUPLE]
[1, 2]
>>> p.flatten({'key': 'value'}) == {'key': 'value'}
True
)r   rR   r^   r|   )rG   r'   r   s      r!   r   Pickler.flattenO  s>    8 JJL$$&&""3'C}}S!!r"   c                 <    U R                   U R                  U5      0$ N)rA   rC   r]   s     r!   _flatten_bytestringPickler._flatten_bytestringq  s    !4!4S!9::r"   c                 f   [        U5      [        L a  U R                  U5      $ [        U5      [        [        [
        [        [        S 5      4;   d0  U R                  (       a!  [        U[        R                  5      (       a  U$ U R                  5         U R                  U R                  U5      5      $ r   )typebytesr   r1   boolintfloatr>   r0   decimalDecimalrd   rg   _flatten_objr]   s     r!   ry   Pickler._flatten_implt  s     9++C00 9dCT
;;*S'//"B"BJ 	

yy**3/00r"   c                 4    U R                   U R                  :H  $ r   )r9   r:   ra   s    r!   _max_reachedPickler._max_reached  s    {{doo--r"   c                 ^    U R                   (       a  SU-  n[        R                   " U5        g g )Nz/jsonpickle cannot pickle %r: replaced with None)r   warnings)rG   r'   msgs      r!   _pickle_warningPickler._pickle_warning  s$    99CcICMM# r"   c                    U R                   R                  U5        U R                  5       n [        XR                  X R
                  5      nU(       a  [        nOU R                  U5      nUc  U R                  U5        g U" U5      $ ! [        [        4 a  nUeS nAf[         a*  nU R                  c  UeU R                  U5      s S nA$ S nAff = fr   )r<   appendr   r*   r;   r   repr_get_flattenerr   KeyboardInterrupt
SystemExit	Exceptionr   )rG   r'   r)   in_cycleflatten_funces         r!   r   Pickler._flatten_obj  s    

#'')	) jj+~~NH##2237#$$S)$$!:. 	G 	)~~%~~a((		)s0   AB	 B	 	CBC(CCCc                 N    U Vs/ s H  o R                  U5      PM     sn$ s  snf r   )r|   )rG   r'   vs      r!   _list_recursePickler._list_recurse  s!    *-.#Qa #...s   "c                 |    U R                   (       a(  [        R                  [        R                  " U5      0nU$ S nU$ r   )r   r   FUNCTIONr   r-   )rG   r'   datas      r!   _flatten_functionPickler._flatten_function  s7    MM4#7#7#<=D  Dr"   c                 v    U R                  U5      nU R                  (       a  X2[        R                  '   U$ UnU$ r   )r|   r   r   STATE)rG   r'   r   states       r!   	_getstatePickler._getstate  s8    c"$  Dr"   c                 2   [         R                  " X5      (       d  U$ U R                  (       aa  U[        R                  " U R
                  5       VVs1 s H  u  pEUiM	     snn;   a(  [         R                  " U R
                  X5      (       a  U$ Uc  SnU R                  (       a  [        U[        [        45      (       a  O![        U[        5      (       d   [        U5      nU R                  U5      X1'   U$ s  snnf ! [         a    [        U5      n N2f = f)z7Flatten a key/value pair into the passed-in dictionary.null)r   is_picklabler   inspect
getmembersrF   is_readonlyr   r0   r   r   r1   r   r   r|   )rG   kr   r   attrvals         r!   _flatten_key_value_pairPickler._flatten_key_value_pair  s      &&K   G,>,>t?T?T,UV,Uytd,UVV  !6!6==K9AAU|!<!<As##G --"# W  Fs   C8C> >DDc                     U R                   nSnU HV  n UR                  S5      (       d  [        X5      nO%[        USUR                  R                   U 35      nU" XgU5        SnMX     U$ ! [
         a     Mi  f = f)NF__rP   T)r   
startswithrM   	__class____name__r\   )rG   r'   attrsr   r   okr   r   s           r!   _flatten_obj_attrsPickler._flatten_obj_attrs  s    ..A||D))#COE#C1S]]-C-C,DQC)HIE$' B  		 " s   AA--
A;:A;c                   ^
 Uc  / n[        [        R                  R                  U5      5      m
U
4S jn[        R
                  " UR                  5       Vs/ s H  oT" U5      (       d  M  US   PM     nn0 nU HB  n[        X5      n	[        R                  " U	5      (       a  XU'   M/  U R                  U	5      Xx'   MD     Xr[        R                  '   U$ s  snf )Nc                 T   > U S   R                  S5      (       + =(       a    U S   T;  $ )Nr   r   )r   )xallslots_sets    r!   valid_property3Pickler._flatten_properties.<locals>.valid_property  s'    tt,,I1\1IIr"   r   )set	itertoolsr   from_iterabler   r   r   rM   r   is_not_classr|   r   PROPERTY)rG   r'   r   allslotsr   r   
propertiesproperties_dictp_namep_valr   s             @r!   _flatten_propertiesPickler._flatten_properties  s    H 9??88BC	J ",,S]];
;Q~a?PDAaD; 	 
  FC(E  ''*/'*.--*>' ! .T]]
s   C+	Cc                    UR                   R                  5        Vs/ s H!  n[        [        US[	        5       5      5      PM#     nnU R
                  (       a  U R                  XU5      nU R                  U[        U6 U5      (       d\  [        U5       Vs/ s H4  oUR                  S5      (       a  M  UR                  S5      (       a  M2  UPM6     nnU R                  XU5        U$ s  snf s  snf )zAReturn a json-friendly dict for new-style objects with __slots__.rU   r   )r   mror3   rM   tupler   r   r   r   dirr   endswith)rG   r'   r   clsr   r   r   s          r!   _flatten_newstyle_with_slots$Pickler._flatten_newstyle_with_slots  s     }}((*
* gc;@A* 	 
 ""++Cx@D&&sE8,<dCCs8#a<<+=ajjQUFV8   ##C5
s   (C&C+2C+
C+c           	         0 n[        US5      n[        US5      nU(       + =(       a    [        US5      n[        R                  " US5      n[        R                  " US5      n[        R                  " US5      n[        R                  " U5      u  p[	        [        USS5      5      n[        [        U5      S	5      =(       a&    [        U5      R                  [        [        S	S
5      LnU(       a  UR                  nO[        U5      n[        R                  " U5      n[        R                  " U[        R                  " U5      5      nUbP  U R                  (       a  X[        R                  '   U" U 5      R!                  X5      nUc  U R#                  U5        U$ S
nU R$                  (       a  U R'                  X5      nU R                  (       Ga  U	(       a  U
(       d   UR)                  5       nOU
(       a   UR-                  S5      nU(       at  [/        U[0        5      (       a_   [3        UR5                  S5      5      n[6        R8                  [;        U5         nU H   n[        UU5      nU R=                  U5      s  $    GO1U(       Ga)  [A        U5      nS[C        U5      -
  nU(       a	  US
/U-  -  n[        US   SS5      S:X  a  [        RD                  US'   Uu  nnnnnU(       a-  U(       a&  [        US5      (       d  [/        U[F        5      (       a  US   (       a  [I        US   5      US'   US   (       a  [I        US   5      US'   [A        [K        U R<                  U5      5      n[C        U5      S-
  nUS:  a  UU   c  US-  nUS:  a  UU   c  M  US
US-    U[        RL                  '   U$ U(       a  [/        U[N        RP                  5      (       d  U R                  (       a  X[        R                  '   U(       aA  URS                  5        Vs/ s H  nU R=                  U5      PM     snU[        RT                  '   U(       a7  U(       d0  U R=                  URW                  5       5      U[        RX                  '   U(       a0  U R=                  UR[                  5       5      U[        R\                  '   U(       a+   UR                  5       nU(       a  U R_                  UU5      $  [/        U[N        RP                  5      (       aJ  U R                  (       a,  SRa                  URb                  S9U[        Rd                  '   U$ [1        U5      nU$ [        Rf                  " U5      (       a  U Ri                  XUS9  U$ [        Rj                  " U5      (       a  U Rm                  X5      $ [        Rn                  " U5      (       aE  [A        [K        U R<                  [q        XRr                  5      5      5      U[        Rt                  '   U$ U(       aS  [        Rj                  " U5      (       a  U Rm                  X5      $ [        USS
5        U Ri                  URv                  X+S9$ U(       a  U Ry                  X5      $ U(       a  U$ U R#                  U5        g
! [*         a     GNf = f! [*         a     GNf = f! [>         a     GNf = fs  snf ! [*         a    U R#                  U5         g
f = f)z?Recursively flatten an instance and return a json-friendly dictr   rV   rU   __getnewargs____getnewargs_ex____getinitargs___jsonpickle_exclude __getstate__N   .   r   r    
__newobj____setstate__      r   z{name}/{name})nameexcluderP   )=rW   r   
has_method
has_reducer   rM   r   r   objectr   r-   r   rO   r   r   OBJECTr   r   r   r   
__reduce__rX   __reduce_ex__r0   r1   itersplitsysmodulesnextr|   rz   listrj   NEWOBJrY   r   mapREDUCEtypes
ModuleTyper   	NEWARGSEXr   NEWARGSr   INITARGSr   formatr   MODULEis_dictionary_subclass_flatten_dict_objis_sequence_subclass_flatten_sequence_objis_iteratorr   r=   ITERATORrV   r   )rG   r'   r   	has_classhas_dict	has_slotshas_getnewargshas_getnewargs_exhas_getinitargsr   has_reduce_exr   has_own_getstater   
class_namehandlerr{   
reduce_valvarpathcurmodmodname
rv_as_listinsufficiencyfargsr   	listitems	dictitemsreduce_args
last_indexargs                                  r!   _flatten_obj_instancePickler._flatten_obj_instance  s   C-	3
+ L>WS+%>	.>? OOC1DE//#/@A$(OOC$8!
gc#8"=> #49n= D$C

,gfndCCD --Cs)C ))#.
,,sHLL$<=$.T[[!T]**35F~$$S)M
""++C6D-!$!1J !$!2!21!5J jS99":#3#3C#89G ![[g7F#*!(!9#}}V44 $+  "*-
 !C
O 3 4&="88J:a=*b9\I$(KKJqM7A44	9 (#C88&sD11 "!}(-jm(<
1!!}(-jm(<
1"&s4==*'E"FK!$[!1A!5J$/k*.E.M"a
 %/k*.E.M(34Dj1n(ED%KZU-=-=>>$.T[[! 252G2G2I(2I3DMM#&2I(T^^$ &7%)]]33E3E3G%HT\\"&*mmC4G4G4I&JT]]#	7((* >>%66  c5++,,$3$:$:$:$MT[[! K 3xK&&s++""3g">K$$S))--c88C  "&s4==&nn:U'V"WDK((--11#<< Cd#))#,,)NN44S?? KS!G !  	 !  	    X(   $$S)	sU   "Z ;Z0 )A[ [ [[ 
Z-,Z-0
Z>=Z>
[[[54[5c                 6   U R                   (       a8  U R                  U5      (       a  U R                  U5      $ U R                  U5      $ U R	                  5       n[        XR                  US5      nU(       a  gU R                  U5        U R                  U5      $ )z.Reference an existing object or flatten if newFN)r   rr   r"  rv   r   r*   r;   )rG   r'   r)   r   s       r!   _ref_obj_instancePickler._ref_obj_instance  s    {{3 11#66 <<$$++-K jj+uEHKK--c22r"   c           
      h    [         R                  [        USSU U R                  U R                  S9-   $ )NFT)r   r   r    r   r   )r   JSON_KEYr   r   r   )rG   r   s     r!   _escape_keyPickler._escape_key  s4    }}vLLnn 
 
 	
r"   c                     [         R                  " X5      (       d  U$ U R                  (       a9  [        U[        5      (       d$  U R                  U5      nU R                  U5      X1'   U$ )z'Flatten only non-string key/value pairs)r   r   r   r0   r1   r)  r|   rG   r   r   r   s       r!   "_flatten_non_string_key_value_pair*Pickler._flatten_non_string_key_value_pair  sP      &&K99Z3//  #AmmA&DGr"   c                    [         R                  " X5      (       d  U$ U R                  (       aM  [        U[        5      (       d  U$ UR                  [        R                  5      (       a  U R                  U5      nOSUc  SnU R                  (       a  [        U[        [        45      (       a  O![        U[        5      (       d   [        U5      nU R                  U5      X1'   U$ ! [         a    [	        U5      n N,f = f)z$Flatten string key/value pairs only.r   )r   r   r   r0   r1   r   r   r(  r)  r   r   r   r   r   r|   r,  s       r!   _flatten_string_key_value_pair&Pickler._flatten_string_key_value_pair  s      &&K99a%%dmm,,$$Q'y  ZC<%@%@3''QA --"	 ! AAs   C$ $C<;C<c                    Uc  UR                  5       nU R                  (       ae  U R                  n[        R                  " XS9 H  u  pVU" XVU5        M     U R
                  n[        R                  " XS9 H  u  pVU" XVU5        M     O2U R                  n[        R                  " XS9 H  u  pVU" XVU5        M     [        US5      (       a  [        UR                  5      (       a  UR                  n[        R                  " U5      (       a  [        U5      nORU R                  U5      (       a+  U R                  [        R                  " U" 5       5      5      nOU R!                  U5      nXS'   [        US5      (       a  U R"                  (       ao  XR$                  :w  a`  U R                  UR$                  5      (       a"  0 n	U R'                  UR$                  XS9  XS'   U$ U R!                  UR$                  5      US'   U$ )z8Recursively call flatten() and return json-friendly dictr   default_factoryrV   )r   r   r0  r   r[   r-  r   rW   callabler3  is_typer.   rr   r"  r   CloneFactoryrv   r   rV   r  )
rG   r'   r   r   r   r   r   factoryr   	dict_datas
             r!   r  Pickler._flatten_dict_obj  s   <==?D 9999G

38d# 9 ==G

38d# 9 22G

38d# 9 3)**x8K8K/L/L))G||G$$"7+ ;;w'' !66x7L7LWY7WXE !LL1E&+"# 3
##(8(8SLL=P{{3<<((	&&s||Y&P#,Z   $(<<#=Z r"   c                 H  ^  [        U5      [        [        4;   aL  T R                  U5      (       a*  [        U5      [        L a  T R                  $ T R
                  $ T R                  $ [        U5      [        [        4;   a#  T R                  (       d  T R                  $ U 4S j$ [        R                  " U5      (       a  T R                  $ [        R                  " U5      (       a  T R                  $ [        R                  " U5      (       a  [         $ T R#                  U5        g )Nc                    > [        U 5      [        L a  [        R                  O[        R                  U  Vs/ s H  nTR                  U5      PM     sn0$ s  snf r   )r   r   r   TUPLESETr|   )r'   r   rG   s     r!   <lambda>(Pickler._get_flattener.<locals>.<lambda>J  sH    "3i50

dhh.1A.1DMM!$cA As   A)r   r   rY   rr   r   r  rv   r   r   r   r   is_module_functionr   	is_objectr%  r5  r.   r   r]   s   ` r!   r   Pickler._get_flattener=  s    9t${{3*.s)t*;D&&AEAWAW ||# #Y5#,&##)))  $$S)))))^^C  )))\\# 	S!r"   c                     [        US5      (       a  U R                  UR                  U5        U Vs/ s H  o0R                  U5      PM     nnU R                  (       a  XB[
        R                  '   U$ U$ s  snf )z4Return a json-friendly dict for a sequence subclass.rV   )rW   r  rV   r|   r   r   SEQ)rG   r'   r   r   r   s        r!   r  Pickler._flatten_sequence_obj]  se    3
##""3<<6+./3aq!3/"N  L	 0s   A5)rC   rA   r9   r?   r:   r=   r;   rF   r<   r>   r   r   r   r   r   r   r   r   r   r   )TTNNFFNFFFNFFN)Tr   )Nr   )$r   
__module____qualname____firstlineno__rH   rR   r^   r   rd   rg   rn   rr   rv   r|   r   r   ry   r   r   r   r   r   r   r   r   r   r   r"  r%  r)  r-  r0  r  r   r  __static_attributes__r   r"   r!   r   r      s      40l(%2	 "D;1".
)6/6 8&pd3*
04l@	r"   r   )TTFNTNFNNFFFNNNFF)r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r   r*   r.   r3   r   r   r"   r!   <module>rJ     s|       
   # " " 
 	
	%Tn2b
 b
r"   