B
    v9a
7              
   @   s   d Z dddddddgZdZd	d
lmZmZ d	dlmZ ddlZeddddddddZ	dddddddddd	ddZ
dddddddddd	ddZedddZdd ZdddddddddZddddddddddZdS )z2.0.9dumpdumpsloadloadsJSONDecoderJSONDecodeErrorJSONEncoderzBob Ippolito <bob@redivi.com>   )r   r   )r       NFT)skipkeysensure_asciicheck_circular	allow_nanindent
separatorsdefault)	r
   r   r   r   clsr   r   r   	sort_keysc   	         K   s   |sD|rD|rD|rD|d krD|d krD|d krD|	d krD|
sD|sDt | }n2|d krPt}|f |||||||	|
d|| }x|D ]}|| q|W d S )N)r
   r   r   r   r   r   r   r   )_default_encoder
iterencoder   write)objfpr
   r   r   r   r   r   r   r   r   kwiterablechunk r   /usr/lib/python3.7/__init__.pyr   x   s    -
c   	         K   st   |sB|rB|rB|rB|d krB|d krB|d krB|d krB|	sB|
sBt | S |d krNt}|f ||||||||	d|
| S )N)r
   r   r   r   r   r   r   r   )r   encoder   )r   r
   r   r   r   r   r   r   r   r   r   r   r   r   r      s    ,

)object_hookobject_pairs_hookc             C   s   | j }|tjtjfrdS |tjtjfr.dS |tjr<dS t| dkr| d s`| d r\dS dS | d s| d	 sx| d
 r|dS dS n$t| d	kr| d sdS | d sdS dS )Nzutf-32zutf-16z	utf-8-sig   r	   r   z	utf-16-bez	utf-32-be      z	utf-16-lez	utf-32-lezutf-8)
startswithcodecsBOM_UTF32_BEBOM_UTF32_LEBOM_UTF16_BEBOM_UTF16_LEBOM_UTF8len)bZbstartswithr   r   r   detect_encoding   s$    
r,   )r   r   parse_float	parse_intparse_constantr   c         	   K   s"   t |  f||||||d|S )N)r   r   r-   r.   r/   r   )r   read)r   r   r   r-   r.   r/   r   r   r   r   r   r     s    
)encodingr   r   r-   r.   r/   r   c      	      K   s   t | tr"| drRtd| dn0t | ttfsBtd| jj | 	t
| d} |d kr|d kr|d kr|d kr|d kr|d kr|st	| S |d krt}|d k	r||d< |d k	r||d< |d k	r||d< |d k	r||d	< |d k	r||d
< |f |	| S )Nu   ﻿z-Unexpected UTF-8 BOM (decode using utf-8-sig)r	   z5the JSON object must be str, bytes or bytearray, not surrogatepassr   r   r-   r.   r/   )
isinstancestrr#   r   bytes	bytearray	TypeError	__class____name__decoder,   _default_decoderr   )	sr1   r   r   r-   r.   r/   r   r   r   r   r   r   +  s0    $



)__version____all__
__author__decoderr   r   encoderr   r$   r   r   r   r;   r,   r   r   r   r   r   r   <module>b   s4   
=8