
    3j                         d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ ddlm	Z	m
Z
mZ ddlmZ 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZd Zd Zd	 Z G d
 d      Zy)    N)chainislice   )handlerstagsutil)jsonc                 R   |Z|st        j                  dt        d       |rt        j                  dt        d       |
rt        j                  dt        d       |xs t        }|xs t	        |||||||	||
|||||       }|j                  |j                  | |      ||      S )	a  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]]"}'

    z-keys will default to True in jsonpickle 5.0.0   )
stacklevelz@numeric_keys is deprecated, use keys=True (will remove in 5.0.0)zAuse_decimal is deprecated and will be removed in jsonpickle 5.0.0)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)warningsr   DeprecationWarningr	   Picklerencodeflatten)valuer   r   r   r   r   r   r   contextr   r   r   r   r   r   r   r   r   s                     ?/DATA/.local/lib/python3.12/site-packages/jsonpickle/pickler.pyr!   r!      s    D MM?"
 MMR"
 MMS"
 oG !-'G  >>U+Fz       c                     |xs | xr t        |       |v xr. t        j                  |        xr t        j                  |        S )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                 L    t         j                  t        j                  |       iS )zxReturn a typeref dictionary

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

    )r   TYPEr   importable_name)r+   s    r%   
_mktyperefr2      s     IIt++C011r&   c                 ,    t        | t              r| fS | S )z0Converts __slots__ = 'a' into __slots__ = ('a',))
isinstancestr)strings    r%   _wrap_string_slotr7      s    &#yMr&   c                       e Zd Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 d!dZd Zd Zd Zd Zd Zd Z	d	 Z
d
 Zd Zd"dZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd#dZd Zd Zd Zd Zd Zd Zd$dZd Z d  Z!y)%r    Nc                    || _         || _        |xs t        | _        || _        || _        || _        |
| _        d| _        || _	        i | _
        g | _        || _        |	| _        i | _        || _        | j                  r+t         j"                  | _        t&        j(                  | _        n*t         j,                  | _        t&        j.                  | _        || _        || _        || _        y 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__zPickler.__init__   s    " '"$		($#

!'.??"hhDO"&..D"hhDO"&..D #"4 /r&   c                     t        | j                  di       j                         D ]  \  }}|j                  dd      s y y)N_encoder_options	sort_keysFT)getattrr   valuesget)rJ   _optionss      r%   _determine_sort_keyszPickler._determine_sort_keys  s>    !$,,0BBGNNPJAw{{;. Q r&   c                     t        |d      r| j                  rt        d      t        |d      r4	 t        t	        |j
                  j                                     |_        |S |S # t        t        f$ r Y |S w xY w)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sortedrW   itemsAttributeErrorrJ   r+   s     r%   _sort_attrszPickler._sort_attrs  s    3$ X 
 S*%#F3<<+=+=+?$@A 
s
 ~. 
s   1A& &A98A9c                 <    i | _         d| _        g | _        i | _        y r:   )r>   r<   r?   rB   rJ   s    r%   r   zPickler.reset*  s    

r&   c                 .    | xj                   dz  c_         y)z&Steps down one level in the namespace.r   N)r<   ra   s    r%   _pushzPickler._push0  s    qr&   c                 n    | xj                   dz  c_         | j                   dk(  r| j                          |S )zzStep up one level in the namespace and return the value.
        If we're at the root, reset the pickler's state.
        r   r;   )r<   r   )rJ   r#   s     r%   _popzPickler._pop4  s,     	q;;"JJLr&   c                     t        |      }|| j                  v}|r$t        | j                        }|| j                  |<   |S )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)rJ   r+   objidis_newnew_ids        r%   _log_refzPickler._log_ref=  s>     3djj(_F &DJJur&   c                 h    | j                  |      }| j                   xs | j                   }|xs |S )z~
        Log a reference to an in-memory object, and return
        if that object should be considered newly logged.
        )rk   r   r   )rJ   r+   ri   pretend_news       r%   _mkrefzPickler._mkrefJ  s7    
 s#***@$...@$f$r&   c                 j    t         j                  | j                  j                  t	        |            iS )z/Return a "py/id" entry for the specified object)r   IDr>   rQ   r(   r^   s     r%   _getrefzPickler._getrefT  s"    3011r&   c                     | j                   r| j                  r| j                  |      }|S 	 | j                  t	        |         }|S # t
        $ r- | j                  |      x}| j                  t	        |      <   Y |S w xY w)z>Flatten an object and its guts into a json-safe representation)r   r   _flatten_implrB   r(   KeyError)rJ   r+   results      r%   _flattenzPickler._flattenX  s    '',F 	LC1   L484F4Fs4KKC1Ls   A 2A=<A=c                     |r| j                          | j                         r| j                  |      }| j                  |      S )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   rT   r_   rv   )rJ   r+   r   s      r%   r"   zPickler.flattenc  s;    8 JJL$$&""3'C}}S!!r&   c                 <    | j                   | j                  |      iS N)rD   rF   r^   s     r%   _flatten_bytestringzPickler._flatten_bytestring  s    !4!4S!9::r&   c                 L   t        |      t        u r| j                  |      S t        |      t        t        t
        t        t        d       fv s&| j                  rt        |t        j                        r|S | j                          | j                  | j                  |            S ry   )typebytesrz   r5   boolintfloatrA   r4   decimalDecimalrc   re   _flatten_objr^   s     r%   rs   zPickler._flatten_impl  s~     9++C00 9dCT
;;*S'//"BJ 	

yy**3/00r&   c                 4    | j                   | j                  k(  S ry   )r<   r=   ra   s    r%   _max_reachedzPickler._max_reached  s    {{doo--r&   c                 R    | j                   rd|z  }t        j                   |       y y )Nz/jsonpickle cannot pickle %r: replaced with None)r   r   )rJ   r+   msgs      r%   _pickle_warningzPickler._pickle_warning  s$    99CcICMM# r&   c                    | j                   j                  |       | j                         }	 t        || j                  || j
                        }|rt        }n| j                  |      }|| j                  |       y  ||      S # t        t        f$ r}|d }~wt        $ r)}| j                  || j                  |      cY d }~S d }~ww xY wry   )r?   appendr   r.   r>   r   repr_get_flattenerr   KeyboardInterrupt
SystemExit	Exceptionr   )rJ   r+   r-   in_cycleflatten_funces         r%   r   zPickler._flatten_obj  s    

#'')	) djj+t~~NH##2237#$$S)$$!:. 	G 	)~~%~~a((		)s0   AB =B CBC"C CCc                 J    |D cg c]  }| j                  |       c}S c c}w ry   )rv   )rJ   r+   vs      r%   _list_recursezPickler._list_recurse  s#    *-.#Qa #...s    c                 p    | j                   r't        j                  t        j                  |      i}|S d }|S ry   )r   r   FUNCTIONr   r1   )rJ   r+   datas      r%   _flatten_functionzPickler._flatten_function  s7    MM4#7#7#<=D  Dr&   c                 n    | j                  |      }| j                  r||t        j                  <   |S |}|S ry   )rv   r   r   STATE)rJ   r+   r   states       r%   	_getstatezPickler._getstate  s:    c"$D  Dr&   c                    t        j                  ||      s|S | j                  rW|t        j                  | j
                        D ch c]  \  }}|	 c}}v r#t        j                  | j
                  ||      r|S |d}| j                  rt        |t        t        f      rnt        |t              s	 t        |      }| j                  |      ||<   |S c c}}w # t        $ r t        |      }Y 2w xY w)z7Flatten a key/value pair into the passed-in dictionary.null)r   is_picklabler   inspect
getmembersrI   is_readonlyr   r4   r   r   r5   r   r   rv   )rJ   kr   r   attrvals         r%   _flatten_key_value_pairzPickler._flatten_key_value_pair  s      A&K   G,>,>t?T?T,UV,UytSd,UVV  !6!61=K9AAU|!<As#G --"Q# W  Fs   C4C C21C2c                     | j                   }d}|D ]R  }	 |j                  d      st        ||      }n%t        |d|j                  j                   |       } ||||       d}T |S # t
        $ r Y bw xY w)NF__rR   T)r   
startswithrO   	__class____name__r]   )rJ   r+   attrsr   r"   okr   r#   s           r%   _flatten_obj_attrszPickler._flatten_obj_attrs  s    ..A||D)#COE#C1S]]-C-C,DQC)HIE5$' B  		 " s   AA((	A43A4c                   
 |g }t        t        j                  j                  |            

fd}t	        j
                  |j                        D cg c]  } ||      s|d    }}i }|D ]=  }t        ||      }	t        j                  |	      r|	||<   *| j                  |	      ||<   ? ||t        j                  <   |S c c}w )Nc                 @    | d   j                  d       xr | d   vS )Nr   r   )r   )xallslots_sets    r%   valid_propertyz3Pickler._flatten_properties.<locals>.valid_property  s'    tt,,I1\1IIr&   r   )set	itertoolsr   from_iterabler   r   r   rO   r   is_not_classrv   r   PROPERTY)rJ   r+   r   allslotsr   r   
propertiesproperties_dictp_namep_valr   s             @r%   _flatten_propertieszPickler._flatten_properties  s    H 9??88BC	J ",,S]];
;Q~a?PAaD; 	 
  FC(E  '*/'*.--*>' ! .T]]
s   C"Cc                    |j                   j                         D cg c]   }t        t        |dt	                           " }}| j
                  r| j                  |||      }| j                  |t        | |      sOt        |      D cg c](  }|j                  d      r|j                  d      r'|* }}| j                  |||       |S c c}w c c}w )zAReturn a json-friendly dict for new-style objects with __slots__.rV   r   )r   mror7   rO   tupler   r   r   r   dirr   endswith)rJ   r+   r   clsr   r   r   s          r%   _flatten_newstyle_with_slotsz$Pickler._flatten_newstyle_with_slots  s     }}((*
* gc;@A* 	 
 ""++Cx@D&&sE8,<dCs8#a1<<+=ajjQUFV8   ##C5
s   %C	C C2Cc           	      f   i }t        |d      }t        |d      }| xr t        |d      }t        j                  |d      }t        j                  |d      }t        j                  |d      }t        j                  |      \  }	}
t	        t        |dd            }t        t        |      d	      xr& t        |      j                  t        t        d	d
      u}|r|j                  }nt        |      }t        j                  |      }t        j                  |t        j                  |            }|L| j                  r||t        j                  <    ||       j!                  ||      }|| j#                  |       |S d
}| j$                  r| j'                  ||      }| j                  r|	r|
s	 |j)                         }n|
r	 |j-                  d      }|rnt/        |t0              r^	 t3        |j5                  d            }t6        j8                  t;        |         }|D ]   }t        ||      }| j=                  |      c S  n|r tA        |      }dtC        |      z
  }|r	|d
g|z  z  }t        |d   dd      dk(  rt        jD                  |d<   |\  }}}}}|r|rt        |d      st/        |tF              r|d   rtI        |d         |d<   |d   rtI        |d         |d<   tA        tK        | j<                  |            }tC        |      dz
  }|dk\  r||   |dz  }|dk\  r||   |d
|dz    |t        jL                  <   |S |rt/        |tN        jP                        s| j                  r||t        j                  <   |r>|jS                         D cg c]  }| j=                  |       c}|t        jT                  <   |r2|s0| j=                  |jW                               |t        jX                  <   |r0| j=                  |j[                               |t        j\                  <   |r%	 |j                         }|r| j_                  ||      S t/        |tN        jP                        rH| j                  r/dja                  |jb                        |t        jd                  <   |S t1        |      }|S t        jf                  |      r| ji                  |||       |S t        jj                  |      r| jm                  ||      S t        jn                  |      rFtA        tK        | j<                  tq        || jr                                    |t        jt                  <   |S |rRt        jj                  |      r| jm                  ||      S t        |dd
       | ji                  |jv                  ||      S |r| jy                  ||      S |r|S | j#                  |       y
# t*        $ r Y w xY w# t*        $ r Y $w xY w# t>        $ r Y w xY wc c}w # t*        $ r | j#                  |       Y y
w xY w)z?Recursively flatten an instance and return a json-friendly dictr   rW   rV   __getnewargs____getnewargs_ex____getinitargs___jsonpickle_exclude __getstate__Nr   .   r   r    
__newobj____setstate__      r   z{name}/{name})nameexcluderR   )=rX   r   
has_method
has_reducer   rO   r|   r   objectr   r1   r   rQ   r   r   OBJECTr"   r   r   r   
__reduce__rY   __reduce_ex__r4   r5   itersplitsysmodulesnextrv   rt   listrg   NEWOBJrZ   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@   ITERATORrW   r   )rJ   r+   r   	has_classhas_dict	has_slotshas_getnewargshas_getnewargs_exhas_getinitargsr   has_reduce_exr   has_own_getstater   
class_namehandlerru   
reduce_valvarpathcurmodmodname
rv_as_listinsufficiencyfargsr   	listitems	dictitemsreduce_args
last_indexargs                                  r%   _flatten_obj_instancezPickler._flatten_obj_instance)  s   C-	3
+ L>WS+%>	.>? OOC1DE//#/@A$(OOC$8!
M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":#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&sD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+""3g">K$$S)--c488C "&s4==&dnn:U'V"WDK((-11#t<< Cd#))#,,g)NN44S$?? KS!G !  	 !  	    X(   $$S)	sU   1W W. )AW> W> X-X 	W+*W+.	W;:W;>	X
XX0/X0c                    | j                   r3| j                  |      r| j                  |      S | j                  |      S | j	                         }t        || j                  |d      }|ry| j                  |       | j                  |      S )z.Reference an existing object or flatten if newFN)r   rn   r  rq   r   r.   r>   )rJ   r+   r-   r   s       r%   _ref_obj_instancezPickler._ref_obj_instance  s    {{3 11#66 <<$$++-K djj+uEHKK--c22r&   c           	      n    t         j                  t        |dd| | j                  | j                        z   S )NFT)r   r   r$   r   r   )r   JSON_KEYr!   r   r   )rJ   r   s     r%   _escape_keyzPickler._escape_key  s4    }}vLLnn 
 
 	
r&   c                     t        j                  ||      s|S | j                  r5t        |t              s%| j                  |      }| j                  |      ||<   |S )z'Flatten only non-string key/value pairs)r   r   r   r4   r5   r  rv   rJ   r   r   r   s       r%   "_flatten_non_string_key_value_pairz*Pickler._flatten_non_string_key_value_pair  sN      A&K99Z3/  #AmmA&DGr&   c                    t        j                  ||      s|S | j                  rCt        |t              s|S |j                  t        j                        rU| j                  |      }nC|d}| j                  rt        |t        t        f      rnt        |t              s	 t        |      }| j                  |      ||<   |S # t        $ r t	        |      }Y ,w xY w)z$Flatten string key/value pairs only.r   )r   r   r   r4   r5   r   r   r  r  r   r   r   r   r   rv   r  s       r%   _flatten_string_key_value_pairz&Pickler._flatten_string_key_value_pair  s      A&K99a%dmm,$$Q'y  ZC<%@3'QA --"Q	 ! AAs    C CCc                    ||j                         }| j                  rk| j                  }t        j                  ||      D ]  \  }} ||||        | j
                  }t        j                  ||      D ]  \  }} ||||        n5| j                  }t        j                  ||      D ]  \  }} ||||        t        |d      rt        |j                        r~|j                  }t        j                  |      rt        |      }nL| j                  |      r*| j                  t        j                   |                   }n| j!                  |      }||d<   t        |d      r{| j"                  ro||j$                  k7  r`| j                  |j$                        r'i }	| j'                  |j$                  |	|       |	|d<   |S | j!                  |j$                        |d<   |S )z8Recursively call flatten() and return json-friendly dictr   default_factoryrW   )r   r   r  r   r\   r  r   rX   callabler  is_typer2   rn   r  r   CloneFactoryrq   r   rW   r   )
rJ   r+   r   r   r"   r   r   factoryr#   	dict_datas
             r%   r   zPickler._flatten_dict_obj  s   <==?D 9999G

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

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

3811d# 9 3)*x8K8K/L))G||G$"7+ ;;w' !66x7L7LWY7WXE !LL1E&+D"# 3
#(8(8SCLL=P{{3<<(	&&s||Y&P#,Z   $(<<#=Z r&   c                     t        |      t        t        fv rF j                  |      r)t        |      t        u r j                  S  j
                  S  j                  S t        |      t        t        fv r j                  s j                  S  fdS t        j                  |      r j                  S t        j                  |      r j                  S t        j                  |      rt         S  j#                  |       y )Nc                     t        |       t        u rt        j                  nt        j                  | D cg c]  }j                  |       c}iS c c}w ry   )r|   r   r   TUPLESETrv   )r+   r   rJ   s     r%   <lambda>z(Pickler._get_flattener.<locals>.<lambda>^  sC    9% 

XX#>#Qa 0#>   ?s   A)r|   r   rZ   rn   r   r   rq   r   r   r   r   is_module_functionr   	is_objectr  r  r2   r   r^   s   ` r%   r   zPickler._get_flattenerQ  s    9t${{3*.s)t*;D&&AEAWAW ||# #Y5#,&##)))  $$S))))^^C )))\\# 	S!r&   c                     t        |d      r| j                  |j                  |       |D cg c]  }| j                  |       }}| j                  r||t
        j                  <   |S |S c c}w )z4Return a json-friendly dict for a sequence subclass.rW   )rX   r   rW   rv   r   r   SEQ)rJ   r+   r   r   r#   s        r%   r   zPickler._flatten_sequence_objq  sf    3
#""3<<6+./3aq!3/"DN  L	 0s   A*)TTNNFFNFFFNFFN)Try   )Nr   )"r   
__module____qualname__rK   rT   r_   r   rc   re   rk   rn   rq   rv   r"   rz   rs   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r   r   r   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.   r2   r7   r    r   r&   r%   <module>r(     s|       
   # " " 
 	
	%hV2b
 b
r&   