
    &Vfq	                     N    d Z ddlZddlZ ed          Z ed          ZddZdS )a  A module providing a function for serializing JSON values with Infinity.

Python provides no way to override how json.dumps serializes
Infinity/-Infinity/NaN; if allow_nan is true, it encodes them as
Infinity/-Infinity/NaN, in violation of the JSON spec and in violation
of what JSON.parse accepts. If it's false, it throws a ValueError,
Neither subclassing JSONEncoder nor passing a function in the |default|
keyword argument overrides this.
    Ninfz-infutf-8c                 Z   t          | t                    r| S t          | t                    r2| t          k    rdS | t          k    rdS t          j        |           rdS | S t          | t                    r|                               S t          | t          t          f          rfd| D             S t          | t                    rfdt          |           D             S t          | t                    r2t          j        fd|                                 D                       S | S )a  Makes Python object appropriate for JSON serialization.

    - Replaces instances of Infinity/-Infinity/NaN with strings.
    - Turns byte strings into unicode strings.
    - Turns sets into sorted lists.
    - Turns tuples into lists.

    Args:
      obj: Python data structure.
      encoding: Charset used to decode byte strings.

    Returns:
      Unicode JSON data structure.
    Infinityz	-InfinityNaNc                 0    g | ]}t          |          S  Cleanse.0iencodings     Z/var/www/html/software/conda/lib/python3.11/site-packages/tensorboard/backend/json_util.py
<listcomp>zCleanse.<locals>.<listcomp>@   s#    2228$$222    c                 0    g | ]}t          |          S r	   r
   r   s     r   r   zCleanse.<locals>.<listcomp>B   s#    :::8$$:::r   c              3   ^   K   | ]'\  }}t          |          t          |          fV  (d S )Nr
   )r   kvr   s      r   	<genexpr>zCleanse.<locals>.<genexpr>D   sQ       '
 '
=AQWQ!!71h#7#78'
 '
 '
 '
 '
 '
r   )
isinstanceintfloat	_INFINITY_NEGATIVE_INFINITYmathisnanbytesdecodelisttuplesetsorteddictcollectionsOrderedDictitems)objr   s    `r   r   r   #   sK    #s 
	C		 ):&&&;Z__ 	5J	C		 zz(###	C$	'	' 	2222c2222	C		 ::::fSkk::::	C		 & '
 '
 '
 '
EHYY[['
 '
 '
 
 
 	
 
r   )r   )__doc__r&   r   r   r   r   r   r	   r   r   <module>r+      sa           E%LL	U6]] % % % % % %r   