o
    .i                  
   @  sv  U d dl mZ d dlZd dlZd dlZd dlmZ d dlmZm	Z	m
Z
 d dlmZmZmZmZ d dlmZ d dlmZmZmZmZmZmZmZ dd	lmZmZmZmZmZmZm Z m!Z! erd d
l"m#Z# d dl$m%Z% d dl&m'Z' d dl(m)Z)m*Z*m+Z+m,Z, d dl-m.Z. edZ/e0dZ1edZ2G dd dZ3e3j4e3j5e3j6e3j7e3j8e3j9e3j:e3j;dZ<de=d< dd dd dd dd e3j>e3j?e3j@e3jAdd d	ZBde=d< i d e3jCde3jDd e3jEd!e3jFd"e3jGd#e3jHd$e3jId%e3jJd&e3jKd'e3jLd(e3jMd)e3jNd*e3jOd+e3jPd,e3jQd-e3jRd.e3jSe3jTe3jUe3jVe3jWd/ZXde=d0< 			1	dGd2d3dHdAdBZY			1	dGd2d3dIdEdFZZdS )J    )annotationsN)getincrementaldecoder)CallableMappingSequence)datedatetime	timedeltatimezone)BytesIO)IOTYPE_CHECKINGAnyLiteralTypeVarcastoverload   )CBORDecodeEOFCBORDecodeErrorCBORDecodeValueErrorCBORSimpleValueCBORTag
FrozenDictbreak_marker	undefinedDecimal)MessageFraction)IPv4AddressIPv4NetworkIPv6AddressIPv6NetworkUUIDTzX^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)(?:\.(\d{1,6})\d*)?(?:Z|([+-])(\d\d):(\d\d))$utf-8c                   @  st  e Zd ZU dZdZded< ded< ded< 					
	ddddddZedddZedddZ	e	j
dd!dZ	edd"d#Zej
dd$d#Zedd%d&Zej
dd'd&Zedd(d)Zej
dd*d)Zdd,d-Zdd1d2Zdd5d6Zddd;d<Zdd?d@ZeddBdCZeddGdCZdddHdCZddIdJZddKdLZddMdNZddOdPZddRdSZddUdVZddWdXZddYdZZdd\d]Zdd^d_ZddadbZddcddZ ddedfZ!ddgdhZ"ddjdkZ#ddldmZ$ddndoZ%ddpdqZ&ddrdsZ'ddudvZ(ddxdyZ)dd{d|Z*dd~dZ+dddZ,dddZ-dddZ.dddZ/dddZ0dddZ1dddZ2dddZ3dddZ4dddZ5d	S )CBORDecodera  
    The CBORDecoder class implements a fully featured `CBOR`_ decoder with
    several extensions for handling shared references, big integers, rational
    numbers and so on. Typically the class is not used directly, but the
    :func:`load` and :func:`loads` functions are called to indirectly construct
    and use the class.

    When the class is constructed manually, the main entry points are
    :meth:`decode` and :meth:`decode_from_bytes`.

    .. _CBOR: https://cbor.io/
    )	_tag_hook_object_hook_share_index_shareables_fp_fp_read
_immutable_str_errors_stringref_namespace
_max_depth_decode_depth	IO[bytes]r.   zCallable[[int], bytes]r/   strr1   Nstrictr     	max_depthfptag_hook,Callable[[CBORDecoder, CBORTag], Any] | Noneobject_hook3Callable[[CBORDecoder, dict[Any, Any]], Any] | None
str_errors	read_sizeintr:   c                C  s@   || _ || _|| _|| _d| _g | _d| _d| _|| _d| _	dS )a.  
        :param fp:
            the file to read from (any file-like object opened for reading in binary
            mode)
        :param tag_hook:
            callable that takes 2 arguments: the decoder instance, and the
            :class:`.CBORTag` to be decoded. This callback is invoked for any tags
            for which there is no built-in decoder. The return value is substituted
            for the :class:`.CBORTag` object in the deserialized output
        :param object_hook:
            callable that takes 2 arguments: the decoder instance, and a
            dictionary. This callback is invoked for each deserialized
            :class:`dict` object. The return value is substituted for the dict in
            the deserialized output.
        :param str_errors:
            determines how to handle unicode decoding errors (see the `Error Handlers`_
            section in the standard library documentation for details)
        :param read_size:
            the minimum number of bytes to read at a time.
            Setting this to a higher value like 4096 improves performance,
            but is likely to read past the end of the CBOR value, advancing the stream
            position beyond the decoded data. This only matters if you need to reuse the
            stream after decoding.
            Ignored in the pure Python implementation, but included for API compatibility.
        :param max_depth:
            the maximum allowed container nesting depth

        .. _Error Handlers: https://docs.python.org/3/library/codecs.html#error-handlers

        NFr   )
r;   r<   r>   r@   r,   r-   r2   r0   r3   r4   )selfr;   r<   r>   r@   rA   r:    rD   [/lsinfo/ai/hellotax_ai/llm_service/venv_vllm/lib/python3.10/site-packages/cbor2/_decoder.py__init__F   s   (
zCBORDecoder.__init__returnboolc                 C     | j S )z
        Used by decoders to check if the calling context requires an immutable
        type.  Object_hook or tag_hook should raise an exception if this flag
        is set unless the result can be safely used as a dict key.
        )r0   rC   rD   rD   rE   	immutabley   s   zCBORDecoder.immutablec                 C  rI   N)r.   rJ   rD   rD   rE   r;         zCBORDecoder.fpvalueNonec                 C  s@   zt |js
tdW n ty   tdw || _|j| _d S )Nzfp.read is not callablezfp object has no read method)callableread
ValueErrorAttributeErrorr.   r/   rC   rN   rD   rD   rE   r;      s   
c                 C  rI   rL   )r*   rJ   rD   rD   rE   r<      rM   zCBORDecoder.tag_hookc                 C  "   |d u st |r|| _d S td)Nz#tag_hook must be None or a callable)rP   r*   rR   rT   rD   rD   rE   r<         
c                 C  rI   rL   )r+   rJ   rD   rD   rE   r>      rM   zCBORDecoder.object_hookc                 C  rU   )Nz&object_hook must be None or a callable)rP   r+   rR   rT   rD   rD   rE   r>      rV   c                 C  rI   rL   )r1   rJ   rD   rD   rE   r@      rM   zCBORDecoder.str_errorsc                 C  s4   |dkr	d| _ d S |dv r|| _ d S td|d)Nerrorr7   )r7   rW   replacebackslashreplacesurrogateescapezinvalid str_errors value zP (must be 'strict', 'error', 'replace', 'backslashreplace' or 'surrogateescape'))r1   rR   rT   rD   rD   rE   r@      s   


r'   c                 C  s   | j dur|| j| j < |S )z
        Set the shareable value for the last encountered shared value marker,
        if any. If the current shared index is ``None``, nothing is done.

        :param value: the shared value
        :returns: the shared value to permit chaining
        N)r,   r-   rT   rD   rD   rE   set_shareable   s   
zCBORDecoder.set_shareablestringstr | byteslengthc                 C  s   | j d ur<t| j }|dk r|dk}n|dk r|dk}n|dk r%|dk}n|dk r.|dk}n|d	k}|r>| j | d S d S d S )
N                  l              )r2   lenappend)rC   r\   r^   
next_indexis_referencedrD   rD   rE   _stringref_namespace_add   s   





z$CBORDecoder._stringref_namespace_addamountbytesc                 C  s4   |  |}t||k rtd| dt| d|S )zj
        Read bytes from the data stream.

        :param int amount: the number of bytes to read
        z*premature end of stream (expected to read z bytes, got z	 instead))r/   rg   r   )rC   rl   datarD   rD   rE   rQ      s   
zCBORDecoder.readFrK   unsharedr   c           	   	   C  s  | j | jkrtd| j d|r| j}d| _|r| j}d| _|  j d7  _ z?| dd }|d? }|d@ }t| }|| |W |rD|| _|rI|| _|  j d8  _ | j dksWJ | j dkre| j  d| _S S |rk|| _|rp|| _|  j d8  _ | j dks~J | j dkr| j  d| _w )	z
        Decode the next value from the stream.

        :raises CBORDecodeError: if there is any problem decoding the stream

        z!maximum container nesting depth (z
) exceededTNr   r   rd      )	r4   r3   r   r0   r,   rQ   major_decodersr-   clear)	rC   rK   ro   old_immutable	old_indexinitial_byte
major_typesubtypedecoderrD   rD   rE   decode   sD   




zCBORDecoder.decodebufobjectc                 C  sJ   t |}| j}|| _|  }|| _|W  d   S 1 sw   Y  dS )aA  
        Wrap the given bytestring as a file and call :meth:`decode` with it as
        the argument.

        This method was intended to be used from the ``tag_hook`` hook when an
        object needs to be decoded separately from the rest but while still
        taking advantage of the shared value registry.
        N)r   r;   ry   )rC   rz   r;   old_fpretvalrD   rD   rE   decode_from_bytes  s   
	$zCBORDecoder.decode_from_bytesrw   c                 C     d S rL   rD   rC   rw   rD   rD   rE   _decode_length     zCBORDecoder._decode_lengthallow_indefiniteLiteral[True]
int | Nonec                 C  r   rL   rD   rC   rw   r   rD   rD   rE   r     r   c                 C  s   |dk r|S |dkr|  dd S |dkr#tttd|  dd S |dkr5tttd|  d	d S |d
krGtttd|  dd S |dkrO|rOd S td|d)Nr_   r   r      z>H      z>Lrb      z>Q   rp   z#unknown unsigned integer subtype 0xx)rQ   r   rB   structunpackr   r   rD   rD   rE   r     s   c                 C  s   |  | |S rL   r[   r   r   rD   rD   rE   decode_uint.  s   zCBORDecoder.decode_uintc                 C  s   |  | | d S Nr   r   r   rD   rD   rE   decode_negint2  s   zCBORDecoder.decode_negintc           
      C  s  | j |dd}|d u rNg }	 | dd }|dkrd|}n.|d? dkrH|  |d	@ }|d u s5|tjkr=td
|d| |}|| ntdqn;|tjkr[td|d|dkre| |}n|}t }|rt|d}	|	| |	 ||	8 }|slt
|}| || | |S )NTr   r   r          rd   r   rp   z1invalid length for indefinite bytestring chunk 0xr   z4non-bytestring found in indefinite length bytestringz invalid length for bytestring 0xrc   )r   rQ   joinsysmaxsizer   rh   	bytearrayminextendrm   rk   r[   )
rC   rw   r^   rz   ru   resultrN   leftbuffer
chunk_sizerD   rD   rE   decode_bytestring6  sF   





zCBORDecoder.decode_bytestringc              
   C  s  | j |dd}|d u rgg }	 | dd }|dkrd|}nG|d? dkra|  |d	@ }|d u s5|tjkr=td
|dz| |d| j}W n tyZ } ztd|d }~ww |	| ntdqnn|tjkrttd|d|dkrz| |d| j}W nJ ty } ztd|d }~ww t
| j}|}	d}|	rt|	d}
|	|
k}z||| |
|7 }W n ty } ztd|d }~ww |	|
8 }	|	s| || | |S )NTr   r   r   r    rd   r`   rp   z-invalid length for indefinite string chunk 0xr   r(   zerror decoding unicode stringz,non-string found in indefinite length stringzinvalid length for string 0xrc   )r   rQ   r   r   r   r   ry   r1   UnicodeDecodeErrorrh   incremental_utf8_decoderr   rk   r[   )rC   rw   r^   rz   ru   r   rN   exccodecr   r   finalrD   rD   rE   decode_stringa  sb   









zCBORDecoder.decode_stringSequence[Any]c                 C  s   | j |dd}|d u r(g }| js| | 	 | jdd}|tu r!n|| qn'|tjkr5td|dg }| js?| | t	|D ]}|| jdd qC| jr]t
|}| | |S |S )NTr   ro   zinvalid length for array 0xr   )r   r0   r[   ry   r   rh   r   r   r   rangetuple)rC   rw   r^   itemsrN   indexitems_tuplerD   rD   rE   decode_array  s0   




zCBORDecoder.decode_arrayMapping[Any, Any]c                 C  s   | j |dd}|d u r)i }| | 	 | jddd}|tu rn	| jdd||< qni }| | t|D ]}| jddd}| jdd||< q4| jrV| | |}| | |S | jrdt|}| | |S |S )NTr   rK   ro   r   )r   r[   ry   r   r   r+   r0   r   )rC   rw   r^   
dictionarykey_frozen_dictrD   rD   rE   
decode_map  s2   



zCBORDecoder.decode_mapc                 C  s^   |  |}t| }r|| S t|d }| | | jdd|_| jr*| | |}| |S )NTr   )r   semantic_decodersgetr   r[   ry   rN   r*   )rC   rw   tagnumsemantic_decodertagrD   rD   rE   decode_semantic  s   



zCBORDecoder.decode_semanticc              
   C  sJ   |dk rt |S zt| | W S  ty$ } z	td|d|d }~ww )N   z*Undefined Reserved major type 7 subtype 0xr   )r   special_decodersKeyErrorr   )rC   rw   erD   rD   rE   decode_special  s   
zCBORDecoder.decode_specialr   c                 C  s   |   }| t|d S )Ni;
 )ry   r[   r   fromordinalrT   rD   rD   rE   decode_epoch_date  s   zCBORDecoder.decode_epoch_datec                 C  s   |   }| t|S rL   )ry   r[   r   fromisoformatrT   rD   rD   rE   decode_date_string  s   zCBORDecoder.decode_date_stringr   c                 C  s   |   }t|}|rc| \
}}}}}}}	}
}}|	d u r d}nt|	d}|rF|
dkr/d}nd}t|| }t|| }tt||d}ntj}| t	t|t|t|t|t|t|||S t
d|)Nr   z<06-r   )hoursminuteszinvalid datetime string: )ry   timestamp_rematchgroupsrB   r
   r	   utcr[   r   r   )rC   rN   r   yearmonthdayhourminutesecondsecfracoffset_signoffset_hoffset_mmicrosecondsignr   r   tzrD   rD   rE   decode_datetime_string  sN   
z"CBORDecoder.decode_datetime_stringc              
   C  sN   |   }z	t|tj}W n tttfy! } ztd|d }~ww | 	|S )Nz"error decoding datetime from epoch)
ry   r   fromtimestampr
   r   OverflowErrorOSErrorrR   r   r[   )rC   rN   tmpr   rD   rD   rE   decode_epoch_datetime;  s   

z!CBORDecoder.decode_epoch_datetimec                 C  sB   ddl m} |  }t|tstdt| | t||dS )Nr   )hexlifyzinvalid bignum value    )	binasciir   ry   
isinstancerm   r   r6   r[   rB   )rC   r   rN   rD   rD   rE   decode_positive_bignumF  s
   
z"CBORDecoder.decode_positive_bignumc                 C  s   |  |   d S r   )r[   r   rJ   rD   rD   rE   decode_negative_bignumP  s   z"CBORDecoder.decode_negative_bignumr   c              
   C  sh   ddl m} z|  \}}W n ttfy! } ztd|d }~ww || }| ||j|j	|fS )Nr   r   zIncorrect tag 4 payload)
decimalr   ry   	TypeErrorrR   r   as_tupler[   r   digits)rC   r   expsigr   r   rD   rD   rE   decode_fractionT  s   
zCBORDecoder.decode_fractionc              
   C  s^   ddl m} z|  \}}W n ttfy! } ztd|d }~ww | ||d||  S )Nr   r   zIncorrect tag 5 payloadr   )r   r   ry   r   rR   r   r[   )rC   r   r   r   r   rD   rD   rE   decode_bigfloat_  s   
zCBORDecoder.decode_bigfloatc                 C  sJ   | j d u r	td|  }z| j | }W |S  ty$   td| dw )Nz%string reference outside of namespacezstring reference 
 not found)r2   r   ry   
IndexError)rC   r   rN   rD   rD   rE   decode_stringrefj  s   
zCBORDecoder.decode_stringrefc                 C  s8   | j }t| j| _ | jd  z|  W || _ S || _ w rL   )r,   rg   r-   rh   ry   )rC   rt   rD   rD   rE   decode_shareablew  s   zCBORDecoder.decode_shareablec                 C  sV   | j dd}z| j| }W n ty   td| dw |d u r)td| d|S )NTr   zshared reference r   zshared value z has not been initialized)ry   r-   r   r   )rC   rN   sharedrD   rD   rE   decode_sharedref  s   zCBORDecoder.decode_sharedrefcomplexc              
   C  s\   | j ddd}zt| }W n ty( } zt|tstdd td|d }~ww | |S )NTr   z3error decoding complex: input value was not a tuplezerror decoding complex)ry   r   r   r   r   r   r[   )rC   inputvalrN   r   rD   rD   rE   decode_complex  s   


zCBORDecoder.decode_complexr    c              
   C  sl   ddl m} | jddd}z|| }W n ttfy0 } zt|ts'tdd td|d }~ww | |S )Nr   r   Tr   z4error decoding rational: input value was not a tuplezerror decoding rational)		fractionsr    ry   r   ZeroDivisionErrorr   r   r   r[   )rC   r    r   rN   r   rD   rD   rE   decode_rational  s   


zCBORDecoder.decode_rationalre.Pattern[str]c              
   C  sB   z	t |  }W n t jy } ztd|d }~ww | |S )Nz!error decoding regular expression)recompilery   rW   r   r[   )rC   rN   r   rD   rD   rE   decode_regexp  s   

zCBORDecoder.decode_regexpr   c              
   C  sN   ddl m} z
| |  }W n ty! } ztd|d }~ww | |S )Nr   )Parserzerror decoding MIME message)email.parserr   parsestrry   r   r   r[   )rC   r   rN   r   rD   rD   rE   decode_mime  s   

zCBORDecoder.decode_mimer&   c              
   C  sP   ddl m} z	||  d}W n ttfy" } ztd|d }~ww | |S )Nr   r%   )rm   zerror decoding UUID value)uuidr&   ry   r   rR   r   r[   )rC   r&   rN   r   rD   rD   rE   decode_uuid  s   

zCBORDecoder.decode_uuidc                 C  s   | j }g | _ |  }|| _ |S rL   )r2   ry   )rC   old_namespacerN   rD   rD   rE   decode_stringref_namespace  s
   z&CBORDecoder.decode_stringref_namespaceset[Any] | frozenset[Any]c                 C  s2   | j r| t| jddS | t| jddS )NT)rK   )r0   r[   	frozensetry   setrJ   rD   rD   rE   
decode_set  s   zCBORDecoder.decode_set#IPv4Address | IPv6Address | CBORTagc                 C  s|   ddl m} |  }t|trt|dvrtd|t|dv r)| ||S t|dkr7| td|S td|)Nr   )
ip_address)rb      r   zinvalid ipaddress value )rb   r   r    )		ipaddressr  ry   r   rm   rg   r   r[   r   )rC   r  rz   rD   rD   rE   decode_ipaddress  s   zCBORDecoder.decode_ipaddressIPv4Network | IPv6Networkc              
   C  sv   ddl m} |  }t|tr4t|dkr4| D ]}z| ||ddW   S  tt	fy3   Y  nw t
d|)Nr   )
ip_networkr   F)r7   zinvalid ipnetwork value )r  r  ry   r   r   rg   r   r[   r   rR   r   )rC   r  net_mapnetrD   rD   rE   decode_ipnetwork  s   zCBORDecoder.decode_ipnetworkc                 C  s   |   S rL   )ry   rJ   rD   rD   rE   decode_self_describe_cbor  s   z%CBORDecoder.decode_self_describe_cborr   c                 C  s   t | dd S )Nr   r   )r   rQ   rJ   rD   rD   rE   decode_simple_value  s   zCBORDecoder.decode_simple_valuefloatc              
   C  "   |  tttd| dd S )Nz>er   r   r[   r   r  r   r   rQ   rJ   rD   rD   rE   decode_float16     "zCBORDecoder.decode_float16c              
   C  r  )Nz>frb   r   r  rJ   rD   rD   rE   decode_float32  r  zCBORDecoder.decode_float32c              
   C  r  )Nz>dr   r   r  rJ   rD   rD   rE   decode_float64  r  zCBORDecoder.decode_float64NNr7   r   )r;   r5   r<   r=   r>   r?   r@   r6   rA   rB   r:   rB   )rG   rH   )rG   r5   )rN   r5   rG   rO   )rG   r=   )rN   r=   rG   rO   )rG   r?   )rN   r?   rG   rO   )rG   r6   )rN   r6   rG   rO   )rN   r'   rG   r'   )r\   r]   r^   rB   rG   rO   )rl   rB   rG   rm   )FF)rK   rH   ro   rH   rG   r   )rz   rm   rG   r{   )rw   rB   rG   rB   )rw   rB   r   r   rG   r   )F)rw   rB   r   rH   rG   r   )rw   rB   rG   rm   )rw   rB   rG   r6   )rw   rB   rG   r   )rw   rB   rG   r   )rw   rB   rG   r   )rG   r   )rG   r   )rG   rB   )rG   r   )rG   r]   )rG   r{   )rG   r   )rG   r   )rG   r    )rG   r   )rG   r   )rG   r&   )rG   r  )rG   r  )rG   r  )rG   r   )rG   r  )6__name__
__module____qualname____doc__	__slots____annotations__rF   propertyrK   r;   setterr<   r>   r@   r[   rk   rQ   ry   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r
  r  r  r  r  r  r  r  rD   rD   rD   rE   r)   &   s   
 3




$



+
C
 





0












	








r)   )r   r   r   r`   rb   rd   r  re   z,dict[int, Callable[[CBORDecoder, int], Any]]rq   c                 C     dS )NFrD   rJ   rD   rD   rE   <lambda>      r)  c                 C  r(  )NTrD   rJ   rD   rD   rE   r)    r*  c                 C  r   rL   rD   rJ   rD   rD   rE   r)    r*  c                 C     t S rL   )r   rJ   rD   rD   rE   r)    r*  c                 C  r+  rL   )r   rJ   rD   rD   rE   r)  #  r*  )	r            r_   r   r   r   rp   z'dict[int, Callable[[CBORDecoder], Any]]r   r   r`   rb   rd   r            #   $   %   d   ra   i  r  )i  i  i  i  r   r7   r8   r9   sbytes | bytearray | memoryviewr<   r=   r>   r?   r@   %Literal['strict', 'error', 'replace']rA   rB   r:   rG   r   c             	   C  sD   t | }t||||||d W  d   S 1 sw   Y  dS )a  
    Deserialize an object from a bytestring.

    :param bytes s:
        the bytestring to deserialize
    :param tag_hook:
        callable that takes 2 arguments: the decoder instance, and the :class:`.CBORTag`
        to be decoded. This callback is invoked for any tags for which there is no
        built-in decoder. The return value is substituted for the :class:`.CBORTag`
        object in the deserialized output
    :param object_hook:
        callable that takes 2 arguments: the decoder instance, and a dictionary. This
        callback is invoked for each deserialized :class:`dict` object. The return value
        is substituted for the dict in the deserialized output.
    :param str_errors:
        determines how to handle unicode decoding errors (see the `Error Handlers`_
        section in the standard library documentation for details)
    :param read_size:
        the minimum number of bytes to read at a time.
        Setting this to a higher value like 4096 improves performance.
        Ignored in the pure Python implementation, but included for API compatibility.
    :param max_depth:
        the maximum allowed container nesting depth
    :return:
        the deserialized object

    .. _Error Handlers: https://docs.python.org/3/library/codecs.html#error-handlers

    r<   r>   r@   rA   r:   N)r   r)   ry   )r6  r<   r>   r@   rA   r:   r;   rD   rD   rE   loads?  s   
&$r:  r;   r5   c                C  s   t | |||||d S )a  
    Deserialize an object from an open file.

    :param fp:
        the file to read from (any file-like object opened for reading in binary mode)
    :param tag_hook:
        callable that takes 2 arguments: the decoder instance, and the :class:`.CBORTag`
        to be decoded. This callback is invoked for any tags for which there is no
        built-in decoder. The return value is substituted for the :class:`.CBORTag`
        object in the deserialized output
    :param object_hook:
        callable that takes 2 arguments: the decoder instance, and a dictionary. This
        callback is invoked for each deserialized :class:`dict` object. The return value
        is substituted for the dict in the deserialized output.
    :param str_errors:
        determines how to handle unicode decoding errors (see the `Error Handlers`_
        section in the standard library documentation for details)
    :param read_size:
        the minimum number of bytes to read at a time.
        Setting this to a higher value like 4096 improves performance,
        but is likely to read past the end of the CBOR value, advancing the stream
        position beyond the decoded data. This only matters if you need to reuse the
        stream after decoding.
        Ignored in the pure Python implementation, but included for API compatibility.
    :param max_depth:
        the maximum allowed container nesting depth
    :return:
        the deserialized object

    .. _Error Handlers: https://docs.python.org/3/library/codecs.html#error-handlers

    r9  )r)   ry   )r;   r<   r>   r@   rA   r:   rD   rD   rE   loadp  s   )r;  r  )r6  r7  r<   r=   r>   r?   r@   r8  rA   rB   r:   rB   rG   r   )r;   r5   r<   r=   r>   r?   r@   r8  rA   rB   r:   rB   rG   r   )[
__future__r   r   r   r   codecsr   collections.abcr   r   r   r   r   r	   r
   ior   typingr   r   r   r   r   r   r   _typesr   r   r   r   r   r   r   r   r   r   email.messager   r   r    r  r!   r"   r#   r$   r  r&   r'   r   r   r   r)   r   r   r   r   r   r   r   r   rq   r%  r  r  r  r  r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r  r
  r  r  r   r   r  r   r:  r;  rD   rD   rD   rE   <module>   s    $(     o	
3